04-25-2014, 04:35 PM
I am trying to code a way to check for multiple items. The obvious way is not working so Im hoping someone may know a way to check for multiple items before finishing it.
Is there an If / Then / Else function within the HPL2 engine script anyway, if so it would make things easier..
I basically want them to try the key, if the player has not got the other keys in their inventory then it just pops up a message saying "I should grab those keys before I leave" and then does nothing else. Once the player has the keys, it does the normal action that I already coded.
Is there an If / Then / Else function within the HPL2 engine script anyway, if so it would make things easier..
I basically want them to try the key, if the player has not got the other keys in their inventory then it just pops up a message saying "I should grab those keys before I leave" and then does nothing else. Once the player has the keys, it does the normal action that I already coded.
Spoiler below!
Code:
void LeavingHouse(string &in asItem, string &in asEntity)
{
if(HasItem("BarricadeLockKey")==true)
and
if(HasItem("CarterIslandEntranceKey")==true)
{
SetLevelDoorLocked("HouseDoor", false);
PlaySoundAtEntity("", "unlock_door", "HouseDoor", 0, false);
CompleteQuest("LeaveHouse","LeaveHouse");
}
}