Well before I just fixed select parts of your script. This should be the fix for the whole thing.
void OnStart()
{
AddEntityCollideCallback("Player", "attic_sound_scare1", "OnBegin", true, 1);
AddEntityCollideCallback("Player", "mainatticscare", "OnPickup", true, 1);
SetEntityPlayerInteractCallback("note_attic_desk", "OnTake", true);
}
void OnBegin(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "amb_idle_whimp.snt", "attic_sound_scare1", 0.0f, true);
PlaySoundAtEntity("", "insanity_baby_cry.snt", "attic_sound_scare1", 0.0f, true);
PlaySoundAtEntity("", "door_level_cistern_close.snt", "attic_sound_scare1", 0.0f, true);
PlaySoundAtEntity("", "general_thunder.snt", "attic_sound_scare1", 0.0f, true);
PlaySoundAtEntity("", "break_stairs.snt", "attic_sound_scare1", 0.0f, true);
}
void OnPickup(string &in asEntity)
{
SetEntityActive("mainatticscare");
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor1", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor1", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor2", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor2", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor3", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor3", false);
CreateParticleSystemAtEntity("", "ps_dust_impact", "Partdoor4", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Partdoor4", false);
PlaySoundAtEntity("", "lurker_hit_Wood", "Player", 0, false);
GiveSanityDamage(20, true);
AddPlayerBodyForce(-40000, 25000, 0, false);
FadePlayerRollTo(75, 3, 2);
StartPlayerLookAt("level_celler_1", 2, 2, "");
SetPlayerCrouching(true);
AddTimer("", 2, "Timer1");
AddTimer("", 10, "Timer2");
GivePlayerDamage(10, "BloodSplat", false, false);
SetLanternDisabled(true);
PlaySoundAtEntity("", "player_bodyfall", "Player", 0, false);
FadeRadialBlurTo(1, 0.5);
}
void Timer1(string &in asTimer)
{
StartPlayerLookAt("level_celler_1", 0.4, 0.4, "");
FadePlayerRollTo(-75, 3, 2);
AddTimer("", 2, "Timer3");
PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
}
void Timer3(string &in asTimer)
{
PlaySoundAtEntity("", "react_sigh", "Player", 0, false);
StartPlayerLookAt("level_celler_1", 0.7, 0.7, "");
FadePlayerRollTo(0, 0, 0);
AddTimer("", 2, "Timer5");
FadeRadialBlurTo(0, 1);
}
void Timer5(string &in asTimer)
{
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
}
void Timer2(string &in asTimer)
{
SetPlayerCrouching(false);
StopPlayerLookAt();
SetLanternDisabled(false);
}
void OnLeave ()
{
}