Inventory items used on things help?

Started by McMonsterBrothers, Tue 31/05/2011 06:06:46

Previous topic - Next topic

McMonsterBrothers

Ok, i need help lol.

My problem is, I want to make it so a certain thing happens if the player uses a specific inventory item on a hotspot.
And I want something else to happen if the player uses anything other than that inventory item on that hotspot.

Can you please help?
I cant seem to figure out how to set it up so it will work properly, I know that it is probably easy, but this is my first game XD and I need all the help I can.

Khris

Asked and answered countless times. Please use the forum search first.

Code: ags
function hDoor_UseInv() {

  if (player.ActiveInventory == iKey) {
    Display("You unlock the door.");
    ...
  }
  else {
    Display("That doesn't work.");
  }
}

selmiak

I was also desperately searching for this in the basic AGS Tutorial on the main website. Maybe adding this there will reduce the frequency this question is asked ;)

SMF spam blocked by CleanTalk