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
Help,multiple scripts in one map!
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#20
RE: Help,multiple scripts in one map!

(01-03-2012, 07:42 PM)MrBigzy Wrote: Just rename one of the KeyOnDoor functions to KeyOnDoor2 or something like that, for example:

////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "key_1", "door1", "KeyOnDoor", true);
AddUseItemCallback("", "Bigroomkey", "door2", "KeyOnDoor2", true);
SetEntityCallbackFunc("key_1", "OnPickup");
AddEntityCollideCallback("Player", "InYourFace", "Woho", true, 1);
}

void Woho(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Untrustable_1", true);
PlaySoundAtEntity("", "scare_ghost.snt", "Untrustable_1", 0, false);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("key_1");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("grunt_1", true);
GiveSanityDamage(10.0f, true);
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Bigroomkey", false, true);
PlaySoundAtEntity("", "unlock_door", "door2", 0, false);
RemoveItem("Bigroomkey");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}

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

}

Ohh i see.Thank you mister!


Well now the key goes to the door,but the door stays locked Sad
(This post was last modified: 01-03-2012, 08:12 PM by Datguy5.)
01-03-2012, 08:06 PM
Find


Messages In This Thread
Help,multiple scripts in one map! - by Datguy5 - 12-21-2011, 07:00 PM
RE: Multiple scripts in one map. - by stokesie95 - 12-21-2011, 08:21 PM
RE: Multiple scripts in one map. - by Datguy5 - 12-21-2011, 09:12 PM
RE: Multiple scripts in one map. - by Datguy5 - 12-23-2011, 11:00 AM
RE: Multiple scripts in one map. - by stokesie95 - 12-29-2011, 07:47 PM
RE: Multiple scripts in one map. - by Datguy5 - 12-31-2011, 12:18 AM
RE: Multiple scripts in one map. - by stokesie95 - 12-31-2011, 11:43 AM
RE: Multiple scripts in one map. - by Datguy5 - 01-01-2012, 05:32 PM
RE: Help,multiple scripts in one map! - by Datguy5 - 01-03-2012, 08:06 PM



Users browsing this thread: 3 Guest(s)