Skip to main content

Overview

RARX Doors is a modular door-lock system for FiveM. Lock any door on the map in seconds through an in-game admin panel, restrict access by job/grade, gang/organization, or required items, and integrate seamlessly with the most popular lockpick minigames. All changes are persisted to the database and broadcast live to every connected client — no restarts, no SQL editing. Framework, inventory, lockpick and gang systems are auto-detected at startup, so the script works on a wide range of stacks out of the box.

Features

In-Game Door Creator

Lock any door on the map directly in-game. Pick the model, position, heading and locked state in seconds — no SQL editing, no restarts.

Database-Backed Doors

Every door is persisted and broadcast live to every connected client. Create, edit and delete on the fly.

Job & Grade Locks

Restrict access by job name and grade level. Mix multiple jobs on the same door for cross-department buildings.

Gang & Organization Locks

Native QB gangs plus auto-detection of origen_ilegalv2, qs-crimencreator, jc_organizaciones and rcore_gangs.

Item-Based Keys

Require a specific item to open or close a door, with optional consume-on-use behavior.

Lockpick Integration

Plug-and-play with qb-lockpick, lockpick and t3_lockpick. Auto-detected at startup.

Discord Webhook Logs

Independent webhooks for door creation, deletion and usage. Full audit trail for staff actions.

Lock / Unlock SFX

Bundled lock and unlock sounds play locally with proximity falloff. Immersive without bloating the network.

Requirements

  • Framework: QBCore, QBox, or ESX (auto-detected)
  • ox_lib
  • oxmysql
The framework is detected automatically at startup in this order: qbx_coreqb-corees_extended. The same detection runs for lockpick, inventory and gang systems. No manual configuration is needed if you use one of the supported resources.

Installation

1

Download & Extract

Download the latest version from your Keymaster and extract it into your server’s resources folder.
2

Import Database

The required table is created automatically on first start. No SQL import is needed.
3

Add to server.cfg

Make sure ox_lib and oxmysql are started before this resource.
4

Configure

Edit config/config.lua to set the language, admin groups, command name and Discord webhook URLs. Door definitions live in the database and are managed through the in-game panel.

Framework-Specific Notes

No additional setup required. QBox is detected first and uses the QBCore-compatible API via exports['qb-core']:GetCoreObject(). If QBox is started but the qb-core export is missing, the script falls back to exports['qbx_core']:GetCoreObject() automatically.

Configuration

General Settings

Admin Permissions

Discord Webhooks

Leave any URL empty to disable that channel.

Door Management

All doors are created and managed through the in-game admin panel, accessible with /doors (or your configured command).

Creating a Door

  1. Run the management command (default: /doors).
  2. Aim at the door you want to lock and use the Create action — the model, coords and heading are filled in automatically.
  3. Set the lock state, optionally add job/gang/item restrictions.
  4. Save. The new door is broadcast to every connected client instantly.

Restriction Types

Restrictions are combined with AND logic when multiple are set on the same door (e.g. police grade 2 and keycard item).

Auto-Detected Integrations

The script logs what it detects when it starts:
If the script can’t find one of these (other than a framework), it prints a yellow warning and falls back gracefully — gang-restricted doors won’t enforce gangs, lockpick-only doors won’t be pickable, etc.

Localization

Translation files live in config/translations/. Supported out of the box:
  • English (en.lua)
  • Spanish (es.lua)
Set the language with Config.Language in config/config.lua.

Exports & Events API

rarx_doors exposes only a small surface — most integration is event-driven. The admin panel and door state are fully managed internally.

Client Exports

export → —
Opens the admin management panel without typing the slash command. Useful for integrating the panel into your custom HUD/menu. Permissions are still enforced server-side.

Client Events

Listen — fired by rarx_doors

event → —
Fires once the player’s character is loaded and doors have been pushed from the server. Use it to gate any logic that depends on doors being registered locally.
event → —
Fires when the character is unloaded (multicharacter logout) or when the player disconnects. Use it to clear any per-character caches that reference doors.
event → doorData
Server-broadcast event fired whenever an admin creates a new door, so every connected client registers it without restarting.
event → doorId
Inverse of the above — broadcast when a door is removed.
event → doorId, locked
Broadcast when any player locks/unlocks a door. Each client updates its local state so doors animate consistently for everyone.
event → —
Tells the client to open the admin management panel. Permission check happens server-side before this is fired.
event → text, type, length
Server-side helper to forward a notification to a specific player. Goes through the existing Custom.Notify (ox_lib by default) so it looks consistent with the rest of your stack.

Server Callbacks

These are registered with lib.callback.register and consumed by the admin panel UI. They’re listed here for advanced integrations:

Server Events

event → doorId, currentLocked
Triggered by the client when a player tries to lock/unlock a door. Server validates job, gang, item, and lockpick conditions, then broadcasts the new state with rarx_doors:client:UseDoor.

Usage Examples

Open the admin panel from your custom HUD

Wait for doors to be ready before drawing your own UI overlays

Send a one-off notification through the doors notify pipeline

Troubleshooting

None of qb-core, qbx_core, or es_extended is running. Start one of them before rarx_doors.
Either the door doesn’t have lockpick enabled in its config, or no supported lockpick resource is running. Check the startup log line * Lockpick: ... — if it shows the yellow warning, install qb-lockpick, lockpick, or t3_lockpick.
The item catalog is read from your detected inventory. Make sure your inventory resource is started before rarx_doors, and check the startup log line * Inventory: .... If it shows the yellow warning, your inventory isn’t recognized — the script falls back to QBCore.Shared.Items (qb-core only).
QBCore gangs are read from PlayerData.gang.name and PlayerData.gang.grade.level. If you use a custom gang system, make sure it’s one of the auto-detected ones (origen_ilegalv2, qs-crimencreator, jc_organizaciones, rcore_gangs) — otherwise the door falls back to framework gangs.
Your group doesn’t match any entry in Config.GroupPermissions. On QBCore the group lives in PlayerData.permission or the ACE permission list; on ESX it comes from xPlayer.getGroup(). Make sure your admin group is listed.
Live updates rely on the server broadcasting rarx_doors:client:CreateDoor/UpdateDoor/DeleteDoor. If these events don’t reach the client, check that your oxmysql and ox_lib versions are up to date and that no other resource is throwing errors during onPlayerLoad.

Compatibility

The auto-detection in init.lua is the easiest extension point. To add support for a new inventory, lockpick or gang system, append your resource name to the corresponding list in init.lua and implement the matching branch in server/door.lua (GetItems callback) or client/door.lua (gang check block). No core code changes are required.