Blockland Forums > Modification Help
OnPlayerWithItemTouch?
::Matt:::
Okay guys, so I am wondering if I could get some help on an event.
What I want it to basically do is find out what item the player is holding. If the item is related to
--- Code: ---"datablock ItemData", 1);
--- End code ---
then it would do whatever the player schedules it to do with the other event, onPlayerWithItemTouched.
What I have so far, which isn't much...
--- Code: ---registerInputEvent("OnItemTouch", "Self", "datablock ItemData", 1);
--- End code ---
Haha :) any help would be much appreciated. I suck at scripting events.
takato14:
Let me see if I actually understand what you're wanting to check for before I try to explain it...
You're trying to set an input that's triggered when a player collides with a brick, but only when s/he has a specific item in their inventory?
Nexus:
If you want to test for which a player hits a brick with a specific item, that should come default with every item.
--- Code: ---function ItemImage::onHitObject(%this, %player, %slot, %col, %pos, %normal)
--- End code ---
::Matt:::
--- Quote from: takato14 on February 01, 2011, 10:27:51 PM ---Let me see if I actually understand what you're wanting to check for before I try to explain it...
You're trying to set an input that's triggered when a player collides with a brick, but only when s/he has a specific item in their inventory?
--- End quote ---
Precisely! :)
::Matt:::
--- Quote from: Nexus on February 02, 2011, 03:01:26 AM ---If you want to test for which a player hits a brick with a specific item, that should come default with every item.
--- Code: ---function ItemImage::onHitObject(%this, %player, %slot, %col, %pos, %normal)
--- End code ---
--- End quote ---
Ok, I'll try it.