The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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 Multiple Keys
BadCoverMan Offline
Junior Member

Posts: 27
Threads: 7
Joined: Feb 2012
Reputation: 0
#1
Multiple Keys

Hello, I had just one key and everything was fine. Then when I tried to have a second key and second locked door, neither of them worked anymore. Here's the script. Any help would be much appreciated. I'm very new to scripting as well so I apologize if it's a really stupid mistake.

Spoiler below!

////////////////////////////
// Run when entering map
void OnEnter()
{
AddUseItemCallback("", "LockedDoorKey1", "LockedDoor_1", "UsedLockedDoorKey1", true);
}

void UsedLockedDoorKey1(string &in asItem, string &in asEntity)
{
AddUseItemCallback("", "SecondFloorKey", "LockedDoor_2", "UsedSecondFloorKey", true);
}

void UsedSecondFloorKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("LockedDoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor_1", 0, false);
RemoveItem("LockedDoorKey1");

SetSwingDoorLocked("LockedDoor_2", false, true);
PlaySoundAtEntity("", "unlock_door", "LockedDoor_2", 0, false);
RemoveItem("SecondFloorKey");
}

02-21-2012, 07:24 PM
Find


Messages In This Thread
Multiple Keys - by BadCoverMan - 02-21-2012, 07:24 PM
RE: Multiple Keys - by BallisticDK - 02-21-2012, 08:10 PM
RE: Multiple Keys - by BadCoverMan - 02-21-2012, 08:19 PM
RE: Multiple Keys - by Ninami - 02-21-2012, 08:27 PM
RE: Multiple Keys - by BadCoverMan - 02-21-2012, 08:36 PM
RE: Multiple Keys - by Ninami - 02-21-2012, 08:40 PM



Users browsing this thread: 1 Guest(s)