Author Topic: Event: ifItemInSlot / ifItemInHand (V2)  (Read 10423 times)

ifItemInSlot / ifItemInHand (V2)
Two variable events that check if the user has/is holding an item.

Instructions
Self -> ifItemInSlot [SLOT] [ITEM] [SEARCH INVENTORY?]
Self -> ifItemInHand [ITEM]
[SLOT] is the slot you would like to check in.
[ITEM] is the item you would like to check for. "NONE" checks for the absence of an item.
[SEARCH INVENTORY?] determines if you want to search the entire inventory or not.
This event requires Variable Events V.3! It uses VariableTrue/VariableFalse for the results.

Notes
You can ignore [SLOT] if you have [SEARCH INVENTORY?] checked off, since it searches all slots.
By searching all slots for "NONE," you're checking to see if the user is able to recieve another item.
Now things are possible that used to require scripts, like keys for doors and axes for cutting trees!

Problems
No problems have been found, including console errors.
Please report any if you find them!

Download
WillHostForFood: Event_ifItemInSlot.zip
Return To Blockland: Event_ifItemInSlot.zip
(Last updated on: 11/3/08 at 4:30 P.M. EST.)

Installation
Save Event_ifItemInSlot.zip into the Add-Ons folder in your Blockland folder.
« Last Edit: November 04, 2008, 09:39:35 AM by Truce »

Yet another epic event.  Nice job.

Neat idea.

You could get rid of the [SEARCH INVENTORY] and make ALL work for [SLOT] or something

Seems pretty fun to me.
Testing.

Epic,I could make a harmless item a key with this.

Epic,I could make a harmless item a key with this.

Exactly, my good sir.

EDIT:

Heck, you could even make a new item if you had to.
Does nothing, but if it's checked for... VariableTrue -> DoorOpen. :o

Epic,I could make a harmless item a key with this.
Exactly why I downloaded :D

I just did a quick test, CopBlock, and since I didn't have a "key" item, I put:

Code: [Select]
onActivate -> Client -> Centerprint "You need a key to open this door!"
onActivate -> Self -> ifItemInSlot 1 Dirk *checked*
VariableTrue -> Client -> Centerprint "However, you pick the lock with your dirk!"
VariableTrue -> Self -> DoorOpen
onDoorOpened -> Self -> DoorClose


sweet there are so many things you can do with this!!!!!

Someone needs to make - A THING THAT SETS YOUR INVENTORY!


Omg modders, you suck at this!



I had hoped he was sarcastic so I didn't give him the link :|

How exactly do you make it restrict people without the items from doing things? I'm pretty sure I'm doing something wrong. But when I try to make it restrict me from getting something without a bow I get the item anyways.

...handicapped me is handicapped. -.- Found out what i did wrong as soon as I posted this...
« Last Edit: November 02, 2008, 02:22:29 PM by Mateo »