Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Volcan on Wed 28/11/2012 21:13:41

Title: HasInventory in negative way (Solved)
Post by: Volcan on Wed 28/11/2012 21:13:41
How to tell if the player does not have an item?

if Not(player.HasInventory(iKey)){
DisplayAtY(TY, "There's a key in the drawer.");
}   
Title: Re: HasInventory in negative way
Post by: Crimson Wizard on Wed 28/11/2012 21:16:37
By using "not" operator ('!'):

Code (ags) Select

if (!player.HasInventory(iKey)){
DisplayAtY(TY, "There's a key in the drawer.");
}   


More info: http://www.adventuregamestudio.co.uk/wiki/?title=Script_language_keywords#Operators
Title: Re: HasInventory in negative way
Post by: Volcan on Wed 28/11/2012 21:20:21
Thank you. It works.