Frictional Games Forum (read-only)

Full Version: Leveldoor lock doesn't work properly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everybody,

I have a key called Bedroomkey and a leveldoor called Bedroomlevel. Now I have this script:

PHP Code:
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
 
SetSwingDoorLocked("Bedroomlevel"falsetrue);
 
PlaySoundAtEntity("""unlock_door""Bedroomlevel"0false);
 
RemoveItem("Bedroomkey");


I can here the unlock_door sound and the Bedroomkey is gone from my inventory but the door is not unlocked :/ How can I fix this?

Luke
You need SetLevelDoorLocked for level doors Wink

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Bedroomlevel", false);
PlaySoundAtEntity("", "unlock_door", "Bedroomlevel", 0, false);
RemoveItem("Bedroomkey");
}
Thanks didn't know about thatWink