void OnStart()
{
SetEntityCallbackFunc("InsertNoteName", "PickUpNote");
SetEntityCallbackFunc("InsertKeyName", "PickUpKey");
AddEntityCollideCallback("Player", "InsertScriptAreaName", "AreaCollideMsg", true, 1);
}
void PickUpNote(string &in asEntity, string &in type)
{
SetLocalVarInt("Note", 1);
}
void PickUpKey(string &in asEntity, string &in type)
{
SetLocalVarInt("Key", 1);
}
void AreaCollideMsg(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("Note") == 0)
{
SetMessage("MessageCategory", "MessageEntry", 0);
//This should be the message if the Player haven't picked up the note and the key.
StartPlayerLookAt("NoteName", 5, 15, "");
StopPlayerLookAt();
}
else if(GetLocalVarInt("Note") == 1 && !GetLocalVarInt("Key") == 1)
{
SetMessage("MessageCategory", "MessageEntry", 0);
//This should be the message if the Player picked up the note, but not the key.
StartPlayerLookAt("KeyName", 5, 15, "");
StopPlayerLookAt();
}
else if(GetLocalVarInt("Note") == 1 && GetLocalVarInt("Key") == 1)
{
}
}