Frictional Games Forum (read-only)

Full Version: Unlocking Level Doors with Item Pick-Up.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody, I am having some trouble with scripting. I am very new with scripting, but I have done some work and get what functions do, and how they do it. I also understand the .lang file fairly well also. So, my problem is, I want a level door that is usually locked, to become unlocked when I pick up the lantern. I have tried
Code:
SetLevelDoorLocked(string& asName, bool abLocked);
with the bool set to both true and false, with no difference, the door is still locked. If it helps, I have lantern set as the PlayerInteractCallBack, and in that function I have the code above, and a message that does display properly. Any help on this matter would be greatly appreciated.

Regards
mmeowwcat
Are you sure that it's a lever door and not a swing door? Swing doors are the ones that you can push and pull open.

Also, ensure that you callbacks and items match. But if you still need help, post your script file.
Check the door's name, try to set it inactive with SetEntityActive to test.
SetEntityPlayerInteractCallback("YOURITEM", "AfterPickUpLantern", true);
---
void AfterPickUpLantern(string &in asItem)
{
PlaySoundAtEntity("", "unlock_door", "YOURLEVELDOOR", 0, false);
SetLevelDoorLocked("YOURLEVELDOOR", false);
}

---*FOR SWINGDOOR*---
SetSwingDoorLocked("YOURSWINGDOOR", false, true);

Maybe this would work.
DnALANGE your answer actually worked, thank you so much. Also, thank you to everybody else who took time out of their day to try and help me out with this.