I'm having trouble understanding why there's a problem because I performed a similar solution in my own map, here's just a snippet:
AddTimer("opendoor", 0.25f, "TimerOpenDoor");
AddTimer("lightsout", 1, "TimerOpenDoor");
AddTimer("stopeffects", 2, "TimerOpenDoor");
StartScreenShake(0.007f,2, 0.25f,1);
FadePlayerFOVMulTo(1.5, 0.5f);
}
void TimerOpenDoor(string &in asTimer)
{
if(asTimer == "stopeffects")
{
FadePlayerFOVMulTo(1, 1);
PlaySoundAtEntity("breath", "react_breath.snt", "Player", 1.0 / 0.75f, false);
return;
}
if(asTimer == "lightsout")
{
SetLocalVarInt("lightsout", 1);
for(int i=4;i<=6;i++)
SetLampLit("chandelier_simple_short_"+i, false, true);
for(int i=0;i<=6;i++)
SetLampLit("LampBlownOut_"+i, false, true);
PlaySoundAtEntity("breath2", "react_breath.snt", "Player", 1.0 / 1, false);
return;
}
PlaySoundAtEntity("Wind", "general_wind_whirl", "Player", 2, false);
PlaySoundAtEntity("scare", "react_scare.snt", "Player", 0.75f, false);
SetSwingDoorClosed("castle_4", false, false);
SetSwingDoorDisableAutoClose("castle_4", true);
AddTimer("castle_4", 0.01f, "TimerSwingDoor");
GiveSanityDamage(10, true);
}
^^
And that works just fine. Is the code working correctly? The function TimerLight isn't working? This is weird....
Outside the if statements, in TimerLight, put a command. If that doesn't work, then the whole function isn't working, and it's just an error when calling it.
Oh yeah, so I don't forget, is the script working at all? Are other functions working correctly?