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
Script Help Two locked doors + keys on one map???
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#3
RE: Two locked doors + keys on one map???

You're using the same callback. Try this instead:

////////////////////////////

// Run first time starting map

void OnStart()

{

AddUseItemCallback("", "key_1", "door_1", "UsedKeyOnDoor", true);

AddUseItemCallback("", "key_2", "door_2", "UsedKeyOnDoor_2", true);

}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

PlaySoundAtEntity("", "unlock_door", "door_1", 0, false);

SetSwingDoorLocked("door_1", false, true);

RemoveItem("key_1");

}



void UsedKeyOnDoor_2(string &in asItem, string &in asEntity)

{

PlaySoundAtEntity("", "unlock_door", "door_2", 0, false);

SetSwingDoorLocked("door_2", false, true);

RemoveItem("key_2");

}



////////////////////////////

// Run when entering map

void OnEnter()

{



}



////////////////////////////

// Run when leaving map

void OnLeave()

{


}

Got ninja'd by beecake XD

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 09-28-2012, 02:23 PM by The chaser.)
09-28-2012, 02:23 PM
Find


Messages In This Thread
RE: Two locked doors + keys on one map??? - by The chaser - 09-28-2012, 02:23 PM



Users browsing this thread: 2 Guest(s)