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
How to make a make a door that need two keys to unlock it?
Raymond Offline
Member

Posts: 126
Threads: 24
Joined: Feb 2011
Reputation: 0
#10
RE: How to make a make a door that need two keys to unlock it?

void OnStart()
{
AddUseItemCallback("UseKey1", "prisonkeylight_1", "mansion_3", "KeyCounter", true);
AddUseItemCallback("UseKey2", "prisonkeydark_1", "mansion_3", "KeyCounter", true);
SetLocalVarInt("KeysUsed", 0);
}

void KeyCounter(string &in asItem, string &in asEntity)
{
SetLocalVarInt("KeysUsed", GetLocalVarInt("KeysUsed")+1);

if(GetLocalVarInt("KeysUsed")==2)
{
SetSwingDoorLocked("LockedDoor", false, true);
}
}

Like this?

One World To Another [DEMO] coming soon.
03-09-2011, 10:31 AM
Find


Messages In This Thread
RE: How to make a make a door that need two keys to unlock it? - by Raymond - 03-09-2011, 10:31 AM



Users browsing this thread: 3 Guest(s)