Hi i am having problems unlocking a locked gate. The gate locks fine. Problem is i cant get the gate to unlock. I know for sure it is reading the uids as it is displaying the correct message to the players. Here is the code i am using, any suggestions?
I create a gate and name it gate1 and in the init field i have this
this addEventHandler ["HandleDamage",{}]; lock= [] execVM "lock.sqf"
lock.sqf contains this
Lock = true;
APlayers = ["123456", "123456"];
while {Lock} do
{
gate1 animate ["Door01",0];
sleep 0.1;
};
I then create a trigger over the gate and in the init field i have this
unlock = [] execVM "unlock.sqf"
unlock.sqf contains this
if (getPlayerUID player in APlayers) then
{
Lock = false;
gate1 animate ["Door01",1];
hint "Gate Unlocked!";
}
else
{
Lock = true;
gate1 animate ["Door01",0];
hint "Gate Is Locked!";
};