Sorry for being an (almost) complete noob...But what the hell is wrong with...
GetSwingDoorLocked("Door1");
if(GetSwingDoorLocked("Door1") == false) {
SetEntityActive("LadderFunc", true);
}
Im trying to make so when i unlock a hatch (Door1 is actually a hatch), it will activate a "climb" function (that is unactivated, atleast in the map editor) , or rather the Ladder Area thingy. I don't want it to be active all the time because then i would be able to just glitch thru it. I've been trying to solve this a bit over 1½ hours.
(Don't laugh at my newb script/programming skills)
Full script for the map:
void OnStart() {
AddUseItemCallback("", "Key1", "Door1", "DoorOne", true);
AddUseItemCallback("", "Key2", "Door2", "DoorTwo", true);
GetSwingDoorLocked("Door1");
if(GetSwingDoorLocked("Door1") == false) {
SetEntityActive("LadderFunc", true);
}
}
void DoorOne(string &in asItem, string &in asEntity) {
SetSwingDoorLocked("Door1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door", 0, false);
RemoveItem("Key1");
}
void DoorTwo(string &in asItem, string &in asEntity){
SetSwingDoorLocked("Door2", false, true);
PlaySoundAtEntity("", "unlock_door", "Door2", 0, false);
RemoveItem("Key2");
}
EDIT: Formatted the text :S