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
Check My Key-to-Door Script. Thanks!
AggressiveGecko Offline
Junior Member

Posts: 4
Threads: 2
Joined: Oct 2011
Reputation: 0
#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
Gamemakingdude Offline
Senior Member

Posts: 470
Threads: 82
Joined: Nov 2010
Reputation: 9
#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
Apfel Offline
Junior Member

Posts: 19
Threads: 3
Joined: Jun 2011
Reputation: 1
#3
RE: Check My Key-to-Door Script. Thanks!

void OnStart()

with capital S
10-07-2011, 03:47 PM
Find
AggressiveGecko Offline
Junior Member

Posts: 4
Threads: 2
Joined: Oct 2011
Reputation: 0
#4
RE: Check My Key-to-Door Script. Thanks!

THANK YOU SO MUCH!!! Big Grin
10-07-2011, 04:04 PM
Find




Users browsing this thread: 1 Guest(s)