Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 2 Votes - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to unlock door with key?
Author Message
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #20
RE: How to unlock door with key?
(07-06-2011 10:18 PM)Tirilno Wrote:  Can you guys please look at my script? Smile 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) Tongue

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()
{

}

07-06-2011 10:26 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
How to unlock door with key? - HumiliatioN - 12-09-2010, 10:48 PM
RE: How to unlock door with key? - house - 12-10-2010, 04:42 AM
RE: How to unlock door with key? - jens - 12-11-2010, 01:06 PM
RE: How to unlock door with key? - Tirilno - 07-06-2011, 10:18 PM
RE: How to unlock door with key? - Kyle - 07-06-2011 10:26 PM
RE: How to unlock door with key? - Tirilno - 07-06-2011, 10:32 PM
RE: How to unlock door with key? - Kyle - 07-08-2011, 01:12 AM
RE: how do i do a jump scare - drumslaya - 09-21-2012, 01:43 PM
RE: How to unlock door with key? - Statyk - 09-26-2012, 04:23 PM



User(s) browsing this thread: 1 Guest(s)