Author Topic: More Event Help  (Read 773 times)

Using the IfItemInHand event, I am adding to a village RPG. You need to give an item to someone. If you don't have the item with you, the person will say that they've lost ___. I need to make it so that once you have the item, they don't say that they've lost the item, and Cancel Events doesn't work. How should it work?

I do not know about the IfItemInHand event, but should work something like this.

0 [tick] 0 IfItemInHand > toggleEventEnabled > 2
1 [tick] 500 IfItemInHand > toggleEventEnabled > 2
2 [tick] 33 onPlayerTouch > centerPrint > 'You have lost ___'.

You will need to change it accordingly to the item of your choice. Yet again, this is just a guess, as I have not got the IfItemInHand event.

ifItemInHand is an output even that works with the Variable events.
Upon triggering (such as onActivate), it will either return true or false.

So, set up something like this:

Code: [Select]
onActivate -> Self -> ifItemInHand (Gun)
VariableTrue -> Client -> Centerprint ("Ah, you brought me the gun! Thanks!")
VariableTrue -> Player -> removeItem (Gun)
VariableTrue -> Player -> setItem (None)
VariableFalse -> Client -> Centerprint ("Hey there, could you bring me a gun?")

The reason you should use removeItem and setItem to none is because removeItem handles the inventory, and setItem handles the hand.

(Come to think of it, I don't know why I didn't add a setItem none feature in removeItem when I made it... I might update that later.)

One thing, if players don't know they're participating in whatever quest then they might not want to give away their stuff...

One thing, if players don't know they're participating in whatever quest then they might not want to give away their stuff...

Then just throw in another var "startedQuest" as boolean.

Code: [Select]
[b]onActivate -> Self -> ifItemInHand (Gun)[/b]
VariableTrue -> Client -> Centerprint ("Ah, you brought me the gun! Thanks!")
VariableTrue -> Player -> removeItem (Gun)
VariableTrue -> Player -> setItem (None)
VariableFalse -> Client -> Centerprint ("Hey there, could you bring me a gun?")

how can you activate with a gun? just wondering

Thanks so much! Now I need to download the RemoveItem events.