I solved it, thanks guys!
I have another problem though... In one part of the cs, you are supposed to put coal in a furnace and then pull a lever to make a machine start working. I made it so that when you pull the lever it creates a particle system (steam) and also the sound for the steam. But if you pull the lever again, it creates more steam and more sound, wich is not supposed to happen. How do I fix this? And also, I made a jump scare, and made it so that when it happens the sound of the player reacting scared is supposed to play, but it doesn't...
Here's the script for the jump scare:
void OnStart()
{
AddEntityCollideCallback("Player", "GhostArea", "GhostFunc", true, 1);
}
void GhostFunc(string &in asParent, string &in asChild, int alState)
{
AddPropForce("vase01_1", 0, 0, -2000, "world");
StartPlayerLookAt("vase01_1", 5, 10, "");
AddTimer("StopLookTimer1", 0.2f, "StopLookFunc1");
PlaySoundAtEntity("", "react_scare.snt", "player", 0.1f, true);
}
void StopLookFunc1(string &in asTimer)
{
StopPlayerLookAt();
}
Do any of you know how to fix this? :S