ToggleDoorlock
lua
This sets the lock of the property entrance. For MLO doors, use setDoorState.
Parameters
- playerId:
number | nilThe player who locks or unlocks the door. Passnilfor a server call, which skips all checks. - propertyId:
numberThe property ID - doorLocked:
booleantrueto lock,falseto unlock
Return Value
booleanWhether the lock state was setstring?A message for the player: locked, unlocked, or the reason it failed
Behavior
- The player must be online.
- It fails during a police lockdown that blocks door management.
- The player needs entry access to the property. Players with the police raid permission don't.
- No player, key or lockdown checks are done.
Player call
Server call