10-02-2014, 02:32 AM
Hi there, sorry for asking so many questions, but I really need to lol. Anyways, what I'm trying to do is make a door that will open upon entering a scripting area. Also, I was hoping to make another door that would close upon entering the room. Here's what I have so far for my script. However, it doesn't seem to work. I have the door open amount set to 1.
[/php]
PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player", "dooropen", "DoorFunction", true, 1);
}
void OnEnter()
{
PlayMusic("06_amb", true, 0.9, 1.0, 1, true);
}
void DoorFunction(string &in asParent, string &in asChild, int alState)
{
SetMoveObjectStateExt("castle_1", 0, 5, 10, 10, false);
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);
}