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 locked door and key that opens it.
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#5
RE: How to make locked door and key that opens it.

void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true); --> is your key named "awesomekey_1"? The door name must be "mansion_1" as well.
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true); --> again door name "mansion_1"?
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1"); --> just to remove the key from inventory after it is used, key name "awesomekey_1"
}

Check the tutorial video on making doors. If you follow step by step you can't go wrong.
09-30-2010, 08:58 PM
Find


Messages In This Thread
RE: How to make locked door and key that opens it. - by HakePT - 09-30-2010, 08:58 PM



Users browsing this thread: 1 Guest(s)