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
-Simple- key open door
MaZiCUT Offline
Senior Member

Posts: 536
Threads: 31
Joined: Jun 2012
Reputation: 17
#4
RE: -Simple- key open door

(06-23-2012, 09:12 AM)andyrockin123 Wrote: Fun with scripting! Assuming you have a basic understanding of how to write scripts, it will need to look like this:


void OnStart()
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFDOOR", "NAMEOFFUNCTION", true);
}

void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
RemoveItem("NAMEOFKEY");
}

If you already have an OnStart function in your script, add the "AddUseItemCallback" to it.
NAMEOFKEY - Replace with the name of your key

NAMEOFDOOR - Replace with the name of your door

NAMEOFFUNCTION - Can be named anything you'd like
Y U NO Play sound at entity? Tongue

Anyways Andy, I've had a goddamned problem ever since i couldn't get that closet open with a crowbar, I can't make a key unlock a door no matter every right thing i do Huh

Hi.
(This post was last modified: 06-23-2012, 11:09 AM by MaZiCUT.)
06-23-2012, 11:07 AM
Website Find


Messages In This Thread
-Simple- key open door - by Jagsrs28 - 06-23-2012, 09:00 AM
RE: -Simple- key open door - by Adny - 06-23-2012, 09:12 AM
RE: -Simple- key open door - by MaZiCUT - 06-23-2012, 11:07 AM
RE: -Simple- key open door - by Jagsrs28 - 06-23-2012, 12:04 PM
RE: -Simple- key open door - by Jagsrs28 - 06-23-2012, 09:59 AM
RE: -Simple- key open door - by Your Computer - 06-23-2012, 12:28 PM
RE: -Simple- key open door - by MaZiCUT - 06-23-2012, 12:31 PM
RE: -Simple- key open door - by Adny - 06-23-2012, 12:35 PM
RE: -Simple- key open door - by Jagsrs28 - 06-23-2012, 12:46 PM
RE: -Simple- key open door - by MaZiCUT - 06-23-2012, 12:49 PM
RE: -Simple- key open door - by Cruzore - 06-23-2012, 12:49 PM
RE: -Simple- key open door - by Adny - 06-23-2012, 12:50 PM
RE: -Simple- key open door - by MaZiCUT - 06-23-2012, 12:53 PM
RE: -Simple- key open door - by Adny - 06-23-2012, 01:03 PM
RE: -Simple- key open door - by MaZiCUT - 06-23-2012, 01:22 PM
RE: -Simple- key open door - by Jagsrs28 - 06-23-2012, 01:25 PM
RE: -Simple- key open door - by Your Computer - 06-23-2012, 01:36 PM



Users browsing this thread: 1 Guest(s)