03-05-2012, 08:07 PM
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
Unless I'm just an idiot and coded my door open wrong, which I'll post here:
Thanks for the help!
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
Unless I'm just an idiot and coded my door open wrong, which I'll post here:
Code:
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!