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 Lock opened with armor puzzle
Ermu Offline
Member

Posts: 86
Threads: 13
Joined: Jan 2012
Reputation: 2
#1
Lock opened with armor puzzle

Hey!

So, my problem is that i've been making a puzzle, where you need to find 2 armor heads and place them to 2 helmetless armors, to unlock the door. My problem is at the point that there should be the both armor heads placed to unlock the door, but the door will unlock even if there is one helmet only placed, and as i said, it shouldn't unlock until both have been placed.

The reason why i placed "else"s at the point it checks for the other armor, is because i thought that would work since it didn't work without it.

SCRIPT:

void OnStart()
{
AddEntityCollideCallback("upstairs_doorhead_2", "upstairs_doorarea_2", "upstairsdoor2", true, 1);
AddEntityCollideCallback("upstairs_doorhead_1", "upstairs_doorarea_1", "upstairsdoor1", true, 1);
}

void upstairsdoor1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("upstairs_doorhead_1", false);
SetEntityActive("upstairs_doorheadless_1", false);
SetEntityActive("upstairs_doorarmor_1", true);
if(GetEntityExists("upstairs_doorheadless_2") == true)
{
SetSwingDoorLocked("upstairs_door", false, false);
}
else
{
SetSwingDoorLocked("upstairs_door", false, true);
}
}

void upstairsdoor2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("upstairs_doorhead_2", false);
SetEntityActive("upstairs_doorheadless_2", false);
SetEntityActive("upstairs_doorarmor_2", true);
if(GetEntityExists("upstairs_doorheadless_1") == true)
{
SetSwingDoorLocked("upstairs_door", false, false);
}
else
{
SetSwingDoorLocked("upstairs_door", false, true);
}
}

Thanks for your help, Ermu.
(This post was last modified: 02-16-2012, 05:05 PM by Ermu.)
02-16-2012, 05:04 PM
Find


Messages In This Thread
Lock opened with armor puzzle - by Ermu - 02-16-2012, 05:04 PM
RE: Lock opened with armor puzzle - by Ermu - 02-16-2012, 08:24 PM
RE: Lock opened with armor puzzle - by Statyk - 02-16-2012, 09:21 PM
RE: Lock opened with armor puzzle - by Ermu - 02-16-2012, 09:58 PM



Users browsing this thread: 2 Guest(s)