Level door doesn't open. (SOLVED)
Hi.
I made a script that is supposed to unlock a level door.
The problem is that i can hear it unlock and the sanity boost works, but the door are still locked???
Here is the full script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Scary1", "TurnOff", true, 0);
AddUseItemCallback("", "Key2", "prison_2", "UsedKeyOnDoor2", true);
}
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("prison_2", false, false);
PlaySoundAtEntity("", "unlock_door", "prison_2", 0, false);
RemoveItem("Key2");
PlayMusic("10_puzzle02.ogg", false, 0.7, 0.1, 10, true);
RemoveItem("Key2");
GiveSanityBoost();
}
void TurnOff(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(100.0f, true);
PlaySoundAtEntity("", "react_pant6", "lamp", 0, false);
StartPlayerLookAt("ScaryArea1",5.0f,10.0f,"");
AddTimer("ScaryArea1_02",1.5f,"ScaryArea12");
SetLampLit("lamp", false, true);
SetLampLit("lamp_1", false, true);
SetLampLit("lamp_2", false, true);
SetLampLit("lamp_3", false, true);
SetLampLit("lamp_4", false, true);
PlayMusic("Skummellyd3.ogg", false, 1.0f, 0, 0, false);
AddTimer("LightOn",5.0f,"TurnOn");
AddTimer("LightOn2",3.0f,"TurnOn2");
}
void ScaryArea12(string& asEntityName)
{
StopPlayerLookAt();
}
void TurnOn(string &in asTimer)
{
PlayMusic("Normal.ogg", true, 1.0f, 0, 0, true);
SetLampLit("lamp", true, true);
SetLampLit("lamp_1", true, true);
SetLampLit("lamp_2", true, true);
SetLampLit("lamp_3", true, true);
SetLampLit("lamp_4", true, true);
GiveSanityDamage(5.0f, true);
SetMessage("IntroCategory", "Intro5", 5.0f);
}
void TurnOn2(string &in asTimer)
{
SetEntityActive("infected_1", false);
}
void NoteMemento(string &in asEntity)
{
AddQuest("questtest3","questtest3");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
SetupLoadScreen("LoadingText", "Loading_Library", 1, "images.jpg");
}
(This post was last modified: 03-05-2011, 10:10 PM by Henriksen.)
|