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
How do I open a door with a crowbar?
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: How do I open a door with a crowbar?

Alot of people are asking how to do this lately.
Quote:AddUseItemCallback("", "crowbar_1", "prison_locked", "UnlockDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "door_script_1", "crowbarfunc", true, 1);
}
void UnlockDoor(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);
//SetSwingDoorLocked("prison_locked", false, true);
//PlaySoundAtEntity("", "unlock_door", "prison_locked", 0, false);
RemoveItem("crowbar_1");
}
void crowbarfunc(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("prison_locked", 0.0f);
SetEntityActive("crowbar_joint_1", false);
SetEntityActive("crowbar_dyn_1", true);
//PlaySoundAtEntity("", "unlock_door", "prison_locked", 0, false);

}
Add a crowbar_joint_1 in the door in set it inactive.
Same with crowbar_dyn_1 in the same place.
Put a little scriptarea on the left or right of the crowbar (depending on the door). The script above works like this:
You put the crowbar in the door by the adduseitemcallback. This enables the crowbar to be pulled.
Then when the crowbar collides with the scriptarea you made next to the crowbar, it will activate the script to break the door and set the other crowbar active and fall down.
Rename the Door, crowbars as to the names in your level editor, make sure you put the door as locked. : D

(This post was last modified: 01-04-2012, 10:19 AM by flamez3.)
01-04-2012, 10:18 AM
Find


Messages In This Thread
RE: How do I open a door with a crowbar? - by flamez3 - 01-04-2012, 10:18 AM



Users browsing this thread: 1 Guest(s)