GUI, Inventory & Menu: Difference between revisions
Jump to navigation
Jump to search
→Checking if the player has a certain Inventory Item
Line 182: | Line 182: | ||
''I want an interaction to happen only when the player has an Inventory Item (like a key to open a door) OR something not to happen when the player has an Item. How do I do that?'' | ''I want an interaction to happen only when the player has an Inventory Item (like a key to open a door) OR something not to happen when the player has an Item. How do I do that?'' | ||
Simply use the [http://www. | Simply use the [http://www.adventuregamestudio.co.uk/manual/ags49.htm#character.inventoryquantity InventoryQuantity] property, e.g.: | ||
if (player.InventoryQuantity[iKey.ID] == 0) | if (player.InventoryQuantity[iKey.ID] == 0) |