So I am making a Timer Script for a scare, and I got this error:
Here is my script:
AddEntityCollideCallback("Player", "HoleCeilingEvent", "CollideHoleCeilingEventFunc", true, 1);
void CollideHoleCeilingEventFunc(string &in asParent, string &in asChild, int alState)
{
AddTimer("starteventhole", 0, "CeilingHoleEvent");
AddTimer("voice1", 1, "CeilingHoleEvent");
AddTimer("rock1", 1.5f, "CeilingHoleEvent");
AddTimer("rock2", 2.0f, "CeilingHoleEvent");
AddTimer("voice2", 3.0f, "CeilingHoleEvent");
}
void CeilingHoleEvent(string &in Timer)
{
string x = asTimer; <--- It says that this is the problem!
if (x == "starteventhole")
{
StartScreenShake(0.008f, 2.5f, 2.0f,6.0f);
}
else if (x == "voice1")
{
PlayGuiSound("react_scare4.ogg", 1);
}
else if (x == "rock1")
{
SetEntityActive("RockCeiling1", true);
}
else if (x == "rock2")
{
SetEntityActive("RockCeiling2", true);
}
else if (x == "voice2")
{
PlayGuiSound("react_scare2.ogg", 1);
}
}
Could anybody help?