World · Overextended

ox_doorlock

Door locking for every door on the map, configured from an in-game menu instead of a config file full of coordinates.

Locking doors used to mean hand-writing hashes and coordinates for every door in every MLO. ox_doorlock replaced that with an in-game creation menu: look at a door, register it, choose who can open it. It stores the result in the database, which means the door layout of a server survives a restart and can be edited by staff rather than by a developer.

Official documentation Repository All resources

At a glance

MaintainerOverextended
Latest releasev1.22.1 · 2026-04-25
Last code change2026-07-03
LicenceGPL-3.0
Written inTypeScript
GitHub stars183
StatusActive

Figures read from the repository on 2026-09-22.

Why servers run it

  • In-game door creation. No coordinate hunting, no restart to test.
  • Doors are stored in MySQL, so they are data rather than code.
  • Per-door access by job, group, item or character id.
  • Handles double doors, sliding doors, garages and gates, which the home-made versions usually do not.

Installing ox_doorlock

  1. 1. Install oxmysql and ox_lib

    Both are required.

  2. 2. Import the SQL

    The release carries the doorlock table.

  3. 3. Give yourself the creation permission

    Door creation is ace-gated. Add the ace to server.cfg for your own identifier before you go looking for the menu.

  4. 4. Create doors in game

    Use the command, look at the door, fill in the form. It is saved immediately.

Working examples

Granting yourself door creation rights

add_ace group.admin command.doorlock allow
add_principal identifier.fivem:1234567 group.admin

Checking a door's state from another script

local state = exports.ox_doorlock:getDoorFromName('mrpd_front')
if state and state.state == 1 then
    -- locked
end

What goes wrong

Doors live in the database, not in a config file. Backing up your server means backing up that table; copying the resource folder to a new server brings no doors with it.

MLO doors change with the MLO. Updating an interior can move or replace a door model, which orphans the entry.

Ace permissions are required for the creation menu and are the usual reason the command 'does nothing'.

ox_doorlock — questions people ask

Do locked doors show on the map?
No. A door lock is world state, not a map feature. If you want a station or a gate marked, that is a blip or something drawn into the map texture.
Where are the ox_doorlock docs?
coxdocs.dev/ox_doorlock, including the full door option table and the exports.

Runs alongside

ox_lib

The shared library half the modern FiveM ecosystem depends on: menus, notifications, progress bars, zones, callbacks and a cache.

oxmysql

The MySQL wrapper the modern FiveM stack runs on: promise-based, prepared-statement aware and a drop-in replacement for mysql-async.

ox_target

The third-eye interaction system most modern scripts target: look at a thing, get a menu, click an option.