I want to open a door with a crowbar like in the guest room and I've been trying to copy the script and the areas in the editor. I've also searched in the forum but I still can't get it to work and I hope you guys can help.
This is what my script looks like now and I got this from another thread in the forum.
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Crowbar_1", "AreaPutCrowbar", "CrowbarAppear", true, 1);
AddEntityCollideCallback("Crowbar_1", "mansion_2", "CrowbarAppear", true, 1);
AddEntityCollideCallback("Crowbar_joint", "break", "BreakDoor", true, 1);
void CrowbarAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Crowbar_joint", true);
RemoveItem("Crowbar_1");
}
void BreakDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_2", false, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
PlaySoundAtEntity("", "break_wood", "BreakEffect", 0.0, false);
SetEntityActive("Crowbar_joint", false);
SetEntityActive("crowbar", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
So if it's possible please copy my script and repost it as it should be and of course tell me what's wrong with it
Thanks in advance!
I saw that I missed one of the"}" in the beggining of the script but it still wont work, just letting you know.