Can you guys help me out. I just cant get it to work.
Script:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("mansion_3", "ScriptArea_1", "Func01", true, 1);
PlayMusic("06_amb.ogg", true, 1, 0, 0, true);
AddEntityCollideCallback("player", "ScriptArea_3", "viini", true, 1);
AddUseItemCallback("", "key_tower_1", "mansion_5", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity){
SetSwingDoorLocked("mansion_5", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_5", 0.0f, true);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("mansion_3", 0, 0, 5, "World");
PlaySoundAtEntity("", "21_bang_door.snt", "mansion_3", 0, false);
PlaySoundAtEntity("", "22_start.ogg", "mansion_3", 0, false);
StartPlayerLookAt("mansion_3", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}
void viini(string &in asParent, string &in asChild, int alState)
PlaySoundAtEntity("", "05_event_bottles.ogg", "Player", 0, false);
}
////////////////////////////
// SetEntityActive("ParticleSystem_10", true); Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}