Hey there,
I'm trying to script an area where if the player remains in it, after 7 seconds a sound will play. Once the sound triggers, it won't ever happen again. If the player leaves the area before the sound plays, then it can be triggered again.
Here's what I have:
//LION SETPIECEvoid LionRoar(string &in asParent, string &in asChild, int state){ AddTimer("CountdownToRoar", 7, "LionIsRoaring"); AddDebugMessage("I see you.", false); if (state == 1) { SetGlobalVarInt("InLion", 1); } else if (state == -1) { SetGlobalVarInt("InLion", 0); }}
void LionIsRoaring(string &in asTimer){ if (GetGlobalVarIn("InLion") == 1) { PlayGuiSound("low_lion_growl.snt", 1000); RemoveEntityCollideCallback("Player", "SurpriseLion_1"); RemoveTimer("CountdownToRoar"); AddDebugMessage("Roar.", false); }}
However, I get a "No matching signatures for GlobalVarInt(string@&)" for my LionIsRoaring func.
Can anyone explain to me what I'm doing wrong or just help me code this in another way?
Cheers
PS: Sorry, idk how to format that nicely for you