I cant get my script to work :(
Can someone please check this out for a little second...
I just want to make "daniel" to look back to an "unlocked" door.
so he opens the door and the door SLAMS back and close... { the door must stay UNLOCKED- need to get open still }
I jope some can help me PLEASE!
Here is my script so far...
////////////////////////////
// Run when entering map
void OnStart()
{
AddUseItemCallback("", "key_1", "monsterdoor", "UsedKeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_1", "UsedKeyOnDoor1", true);
AddUseItemCallback("", "key_3", "door_3", "UsedKeyOnDoor2", true);
AddEntityCollideCallback("Player" , "ScaryTrigger" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player" , "ScaryTrigger" , "Func01" , true, 1);
AddEntityCollideCallback("Player" , "serge1" , "MonsterFunc2" , true , 1);
AddEntityCollideCallback("Player" , "serge1" , "Func02" , true, 1);
AddEntityCollideCallback("Player" , "RoomTwoArea" , "CollideRoomTwo" , true, 1);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
StartPlayerLookAt("mansion_2", "10.0f", "10.0f", "");
AddTimer("", 1,0f, "stoplook");
}
void stoplook(string &in asTimer)
{
StopPlayerLookAt();
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door", "monsterdoor", 0, false);
RemoveItem("key_1");
}
void UsedKeyOnDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);
RemoveItem("key_2");
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_3", false, true);
PlaySoundAtEntity("", "unlock_door", "door_3", 0, false);
RemoveItem("key_3");
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_1" , true);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("servant_brute_1", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}
void MonsterFunc2(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_brute_2" , true);
}
void Func02(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("servant_brute_2", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc2(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
|