Tirilno
Junior Member
Posts: 27
Threads: 5
Joined: Jul 2011
Reputation:
0
|
RE: How to unlock door with key?
(07-06-2011, 10:26 PM)Kyle Wrote: (07-06-2011, 10:18 PM)Tirilno Wrote: Can you guys please look at my script? I have tried everyting and looked through every 'how to' and tutorial videos I find but I can't unlock my door -.- I want my door to be open when I use the key, but It's still locked after I use it :/ (I'm using a level door)
void OnStart()
{
AddUseItemCallback("", "Storagekey_1", "Storagedoor", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Storagedoor", false, true);
PlaySoundAtEntity("", "Unlock_door", "Storagedoor", 0, false);
}
void OnLeave()
{
}
For level doors you have to use this:
SetLevelDoorLocked(string& asName, bool abLocked);
Try this:
void OnStart()
{
AddUseItemCallback("", "Storagekey_1", "Storagedoor", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Storagedoor", false);
PlaySoundAtEntity("", "unlock_door", "Storagedoor", 0, false);
}
void OnLeave()
{
}
Haha, now I understand why it didn't work.. xD Thank you so much
|
|
07-06-2011, 10:32 PM |
|