Nono, keep the timer you had before in Scream_1, put another one in Scream_Trigger, call another function with it, Scream_Trigger. Put the StopPlayerLookAt function in there. So basically, Scream_1 triggers a timer, after 2 seconds the sound plays, you look at the door, and another timer is called, then 2 seconds or more later, the player stops looking at the door.
void OnStart()
{
AddEntityCollideCallback("Player", "Scream", "Scream_1", true, 1);
}
void Scream_1(string &in asParent, string &in asChild, int alStates)
{
AddTimer("Somenamedoesntreallymatter", 2.0f, "Scream_Trigger");
}
void Scream_Trigger(string &in asTimer)
{
PlaySoundAtEntity("Scream_1", "04_scream.snt", "Scream_1", 0, false);
StartPlayerLookAt("LookArea_1", 1, 1, "");
AddTimer("Somenamedoesntreallymatter", 2.0f, "LookArea_Trigger");
}
void LookArea_Trigger(string &in asParent, string &in asChild, int alStates)
{
StopPlayerLookAt();
}
It's all a consecutive thing, this way the timers just from function to function.