Skip to Content
Mavix

Doorlock System

Lock any door in the city and choose who can open it, all from an in-game menu.

What it is

The doorlock system locks doors and lets only the right people open them: the police station for police, a shop's back door for its staff, a gang hideout for one item holder. Doors are not locked out of the box. Staff create every door in game with the doorlock menu, and it works at once without a restart.

For every detail of the menu, see the official ox_doorlock guide.

How players use a door

  • Walk up to a locked door. A small lock icon shows on it.
  • If you are allowed, press E to unlock it, and E again to lock it.
  • A door with a passcode asks for the code first.
  • A door that allows lockpicking can be picked with a lockpick item: hold the third eye (Left Alt) on the door and choose Pick lock. A short skill check appears; if you fail, the lockpick can break.
  • Some doors lock again by themselves after a set time.

Keys & commands

Key / commandWhat it doesWho
E near a doorLock or unlockPlayers allowed on that door
Third eye → Pick lockLockpick a door that allows itAnyone with a lockpick
/doorlockOpen the doorlock menu (list of doors, create a new one)Staff (group.admin)
/doorlock closestOpen the settings of the nearest doorStaff (group.admin)

Create a door

The door settings: name, passcode, auto-lock, and the switches for locked, double, automatic, lockpick and hide UI.
The door settings: name, passcode, auto-lock, and the switches for locked, double, automatic, lockpick and hide UI.

Open the menu

Stand near the door and type /doorlock. The Doors list opens. Click Create a new door.

Name it

On the General tab, fill in Door name. Use a clear name you will recognise later, for example mrpd_front or burgershot_back.

Choose the kind of door

  • Single door: leave Double and Automatic off.
  • Double door: turn Double on. You will click both halves.
  • Sliding gate or garage door: turn Automatic on. Door Rate sets how fast it moves.

Choose who can open it

  • Groups tab: add a row per job, with the lowest Grade that may open it. Grade 0 means every rank of that job.
  • Items tab: an item that opens the door, like a keycard. Tick Remove on use if it should be used up.
  • Characters tab: single players by their character id.
  • Passcode on the General tab: a code anyone can type to open it. You can combine them; anyone who matches one of them can open the door.

Set the behaviour

  • Locked: the door is locked after every server restart. Turn it on for nearly every door.
  • Autolock Interval: seconds after which an unlocked door locks again (leave empty for never).
  • Interact Distance: how close players must stand.
  • Lockpick: allow lockpicking. The Lockpick tab sets the difficulty.
  • Hide UI: no lock icon on the door.
  • Hold Open: the door stays open while unlocked.
  • Sound tab: the lock and unlock sounds.

Pick the door in the world

Click Confirm door. The menu closes and the screen says Create new door: interact with [LMB], cancel with [RMB]. Look at the door (it gets an outline) and left-click it. For a double door, click the second half too. Right-click cancels.

Done

The door is saved and works straight away.

Edit or delete a door

  • Stand near it and type /doorlock closest to open its settings. Change what you need and click Confirm door.
  • Or type /doorlock, find the door in the Doors list and use its menu: edit it, Teleport to door, or Delete door.
  • In a door's settings, the copy button copies its settings and Apply copied settings pastes them onto another door. This is handy for many doors of the same building.

Config options

File: [ox]/ox_doorlock/config.lua

OptionWhat it changesExample
Config.CommandPrincipalWho may use /doorlock'group.admin'
Config.DrawTextUIShow an "[E] Unlock door" prompt as well as the lock iconfalse
Config.NotifyShow a notification after locking or unlockingfalse
Config.PlayerAceAuthorisedLet staff open every doorfalse
Config.LockDifficultyDefault lockpick skill check{ 'easy', 'easy', 'medium' }
Config.LockpickItemsItems that work as a lockpick{ 'lockpick' }
Config.CanPickUnlockedDoorsLockpicks can also lock an open doorfalse

Admin Quick Test

This test creates the Mission Row police station front doors yourself, for every police rank.

Setup

  1. You must be staff (group.admin). Start as a civilian: /setjob me unemployed 0.
  2. Teleport to Mission Row: /tp 434.75 -981.92 30.84, then step out in front of the double front doors. For reference, a common setup puts the front doors around 434.75, -981.92, 30.84 with the two halves at 434.75, -980.62 and 434.75, -983.22.

Create the door

  1. Type /doorlock. Expected: the Doors list opens. Click Create a new door.
  2. General tab: Door name mrpd_front, turn on Locked and Double. Leave Passcode empty.
  3. Groups tab: add a row with Group police and Grade 0.
  4. Click Confirm door. Expected: the text "Create new door: interact with [LMB], cancel with [RMB]".
  5. Look at the left half and left-click, then the right half and left-click. Expected: the text goes away and a lock icon appears on the doors.

Test who can open it

  1. As a civilian, press E at the doors. Expected: nothing happens; they stay locked.
  2. /setjob me police 0 and press E. Expected: both halves unlock and the icon changes. Press E again. Expected: they lock.
  3. Auto-lock: /doorlock closest, set Autolock Interval to 10, click Confirm door. Unlock the doors and wait 10 seconds. Expected: they lock by themselves.

Lockpick (optional)

  1. /doorlock closest, turn on Lockpick, save. /setjob me unemployed 0 and /giveitem me lockpick 2. Hold Left Alt on the door and choose Pick lock. Expected: an easy, easy, medium skill check. Passing it unlocks the doors; failing can break a lockpick. Turn Lockpick off again afterwards.

The end

  1. Keep mrpd_front if you want it, or delete it: /doorlock → mrpd_front → Delete door. Then /setjob me unemployed 0. Result: the police station front doors open only for police.

If it doesn't work

/doorlock does nothing: you are not in group.admin. No outline when you look at the door: it is not a real door object; try the other half or another door. The door ignores E: you are on the wrong job, below the grade, or too far away.

On this page