Basic inventory problems

Started by , Sat 23/09/2006 17:52:56

Previous topic - Next topic

m0ds

Hello.. I'm having a few problems with some basic inventory functionality, and the manual isn't giving me many tips. I'm probably just looking in the wrong place but I'd appreciate a quick bit of guidance!

I'm using "Run script" & it's when the player uses an item from the inventory with a character... what is the code to check if it's inventory item number 3 being used?

Many thanks!

Ashen

#1
player.ActiveInventory

As in:
Code: ags

if (player.ActiveInventory == inventory[3]) { // or whatever the Script-o-name of the item is ('iKey', 'iPoster', 'iBadger', etc)
  // Do stuff
}


You should be able to check the NUMBER of the item with player.ActiveInventory.ID (i.e. if player.ActiveInventory.ID == 3)), but the above way is better.

You could've got this from the 'Text script equivilant code' bit on the Interaction Editor ...
I know what you're thinking ... Don't think that.

m0ds


SMF spam blocked by CleanTalk