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
Padlock Question
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#2
RE: Padlock Question

(03-05-2012, 08:07 PM)Nevicar Wrote: Hello everyone!

I have a question about padlocks; how would I go about setting it up on a prison door and then unlocking it with a key and having it disappear with the key from the inventory? I can't seem to find much about that in the wiki, sadly, and figured I'd ask here to pick your guys brains Smile

Unless I'm just an idiot and coded my door open wrong, which I'll post here:


AddUseItemCallback("", "key1", "padlock_1", "func_key", true);

void func_key(string &in item, string &in door){  SetSwingDoorLocked("padlock_1", false, true);  PlaySoundAtEntity("Player", "unlock_door", door, 0, false); RemoveItem(item);}

Thanks for the help!
AddUseItemCallback("", "key1", "padlock_1", "KeyOnDoor", true);

void KeyOnDoor (string &in item, string &in door)
{

SetSwingDoorLocked("padlock_1 ", false, true);
PlaySoundAtEntity("", "unlock_door", "padlock_1 ", 0, false);
RemoveItem("key1");
}



Test that Wink

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 03-05-2012, 10:13 PM by jessehmusic.)
03-05-2012, 10:12 PM
Website Find


Messages In This Thread
Padlock Question - by Nevicar - 03-05-2012, 08:07 PM
RE: Padlock Question - by jessehmusic - 03-05-2012, 10:12 PM
RE: Padlock Question - by Nevicar - 03-05-2012, 10:44 PM
RE: Padlock Question - by palistov - 03-06-2012, 01:22 AM
RE: Padlock Question - by Nevicar - 03-06-2012, 02:33 AM



Users browsing this thread: 1 Guest(s)