Hey got some problem with my Script for making a vase move away from a box down to the floor :S
void OnStart()
{
[u][i][b]AddEntityCollideCallback("Player", "ScriptArea_4", "paranormal1", true, 1);[/b][/i][/u]
AddEntityCollideCallback("Player", "scriptarea1", "LookAt", true, 1);
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
AddEntityCollideCallback("Player", "InsanityArea_1", "Lookatdamage", false, 1);
AddEntityCollideCallback("Player", "Lookat2", "Lookat2Func", true, 1);
AddEntityCollideCallback("Monster", "MonsterDie", "MonsterDie", true, 1);
AddEntityCollideCallback("Player", "Inactivescriptarea", "Scream", true, 1);
PlayMusic("01_amb_darkness", true, 5, 2, 0, true);
SetEntityPlayerInteractCallback("Lab_key", "ActiveArea", true);
SetEnemyDisabled("graveyard_corpse_1", true);
SetEntityPlayerInteractCallback("EXAMPLE_DOOR", "frontdoor", false);
}
[u][b][i]void paranormal1(string &in asParent, string &in asChild, int alState)
{
AddPropForce("vase", 5, 0, 0, "world");
AddBodyForce("vase", 5, 0, 0, "world");
PlaySoundAtEntity("", "react_scare", "Player", 10, true);
}[/i][/b][/u]
void func_slam(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Doorslam", 1, 1, "");
SetSwingDoorClosed("Doorslam", 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);
StopPlayerLookAt();
}
void Lookatdamage(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(30, true);
}
void frontdoor(string &in asEntity)
{
SetMessage("Message", "LockedDoor", 0);
}
void MonsterDie(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", false);
}
void DoorLockedPlayer(string &in entity)
{
if(GetSwingDoorLocked("EXAMPLE_DOOR") == true)
{
SetMessage("Messages", "LockedDoor", 2);
}
}
void Scream(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 2, "");
AddTimer("", 10, "Timertrigger2");
}
void Timertrigger2(string &in asTimer)
{
SetMessage("Message", "Whatwasthat", 5);
}
void ActiveArea(string &in asEntity)
{
SetEntityActive("Inactivescriptarea", true);
SetEntityActive("script_slam", true);
}
void LookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("LookAt", 1, 2, "");
SetPlayerActive(false);
SetMessage("Message", "whathappend", 5);
AddTimer("", 5, "Timertrigger1");
}
void Timertrigger1(string &in asTimer)
{
SetPlayerActive(true);
StopPlayerLookAt();
}
void Lookat2Func(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("ScriptArea_1", 1, 2, "");
SetPlayerActive(false);
SetMessage("Message", "whatis", 5);
AddTimer("", 5, "Timertrigger3");
}
void Timertrigger3(string &in asTimer)
{
StartPlayerLookAt("ScriptArea_2", 1, 2, "");
AddTimer("", 5, "Timertrigger4");
}
void Timertrigger4(string &in asTimer)
{
StartPlayerLookAt("ScriptArea_3", 1, 2, "");
AddTimer("", 5, "Timertrigger5");
}
void Timertrigger5(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}
void OnLeave()
{
}