Three items check

Started by ManicMatt, Thu 01/01/2015 23:35:23

Previous topic - Next topic

ManicMatt

Hello, old timer ManicMatt here. I have been able to retrieve my old game in progress from years ago (Long story) and I have EGO talk to a character, run script 20, then the game crashes if EGO doesn't and says the character doesn't have the inventory items. I want the game to check if EGO has all three, then the next line of script kicks in, otherwise he says something else and we are returned to the dialogue options.  Please help! I searched the forums but strangely couldn't find an answer! (I've been at this for hours!)

Code: ags

if (value==20){
if (player.ActiveInventory == inventory[26]) player.ActiveInventory = inventory[21]; player.ActiveInventory = inventory[18];
 character[EGO].Say("I have all three!");
}
else {
  character[EGO].Say("I haven't got all three!");
}
}

Gurok

I think your if statement is a little bit off. Try this:

Code: ags
if (player.HasInventory(inventory[26]) && player.HasInventory(inventory[21]) && player.HasInventory(inventory[18]))
[img]http://7d4iqnx.gif;rWRLUuw.gi

ManicMatt

That did the trick! Thanks a million!! The dialogue is placeholder by the way!

SMF spam blocked by CleanTalk