07-19-2013, 10:23 PM
I'm trying to set up a slam door script. This is what I have -
void OnStart()
{
AddEntityCollideCallback("Player", "slam_attic_1", "attic_slam_1", true, 1);
}
void slam_attic_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("attic_slam_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
slam_attic_1 is the script name and attic_slam_1 is the door name.
void OnStart()
{
AddEntityCollideCallback("Player", "slam_attic_1", "attic_slam_1", true, 1);
}
void slam_attic_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("attic_slam_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}
slam_attic_1 is the script name and attic_slam_1 is the door name.