The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Crowbar Script
TheBaker Offline
Junior Member

Posts: 15
Threads: 5
Joined: Aug 2011
Reputation: 0
#1
Crowbar Script

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 Smile
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.

(This post was last modified: 08-26-2011, 11:57 PM by TheBaker.)
08-26-2011, 11:54 PM
Find


Messages In This Thread
Crowbar Script - by TheBaker - 08-26-2011, 11:54 PM
RE: Crowbar Script - by Prelauncher - 08-27-2011, 12:32 AM
RE: Crowbar Script - by TheBaker - 08-27-2011, 10:45 AM
RE: Crowbar Script - by TheBaker - 08-27-2011, 12:35 PM



Users browsing this thread: 1 Guest(s)