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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check My Key-to-Door Script. Thanks!
Author Message
AggressiveGecko Offline
Junior Member

Posts: 4
Joined: Oct 2011
Reputation: 0
Post: #1
Check My Key-to-Door Script. Thanks!
Ok this is my scripting to open a specific door with a key. I have spent TOO much time trying to fix this script by watching other people and if someone could just help me out here I would be SO thankful!! BTW i'm using notepad++
////////////////////////////
// Run first time starting map
void Onstart()
{
AddUseItemCallback("", "torturechamberkey_1", "torturechamberdoor_1", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("torturechamberdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "torturechamberdoor_1", 0, false);
RemoveItem("torturechamberkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
10-07-2011 03:39 PM
Find all posts by this user Quote this message in a reply
Gamemakingdude Offline
Senior Member

Posts: 478
Joined: Nov 2010
Reputation: 9
Post: #2
RE: Check My Key-to-Door Script. Thanks!
PHP Code: (Select All)
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntity,false,true);
    
PlaySoundAtEntity("","unlock_door"asEntity0false);
    
RemoveItem(asItem);


Replace your unlock script with this.
This will work with any key and will unlock any door with the key. Just make sure you change your item call back function to usedkeyondoor.

Rep if like me or im helpful or you love my stories!
Stephanos house
10-07-2011 03:43 PM
Find all posts by this user Quote this message in a reply
Apfel Offline
Junior Member

Posts: 7
Joined: Jun 2011
Reputation: 0
Post: #3
RE: Check My Key-to-Door Script. Thanks!
void OnStart()

with capital S
10-07-2011 03:47 PM
Find all posts by this user Quote this message in a reply
AggressiveGecko Offline
Junior Member

Posts: 4
Joined: Oct 2011
Reputation: 0
Post: #4
RE: Check My Key-to-Door Script. Thanks!
THANK YOU SO MUCH!!! Big Grin
10-07-2011 04:04 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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