Docs

X3D House Robbery

Pick the door, search the floor, crack the safe, with a cooldown per house and both minigames in the same zip.

Buy / Get freeConfig builder

Installation

  1. Drop x3d_houserobbery into resources/
  2. Pick a minigame source, either one
  3. Add to server.cfg, minigames first
ensure x3d_lockpick
ensure x3d_safe
ensure x3d_houserobbery
  1. Add these items to your items table: keycards keycard_red keycard_gold keycard_silver and safe keys loot_house_red loot_house_gold loot_house_silver (names from sv_config.lua)

No SQL to run.

Updating from 1.0.0: since 1.2.0 the minigames are no longer inside the zip. If you already moved x3d_lockpick and x3d_safe into resources/, keep using them.

Config (config.lua)

Option What it does
Config.Framework 'auto' uses ESX when present, otherwise standalone · 'esx' · 'standalone'
Config.Minigame 'auto' uses x3d_lockpick/x3d_safe when started, otherwise ox_lib · 'x3d' · 'ox_lib'
Config.Locale 'th' or 'en'
Config.InventoryResource an inventory with a CanCarryItemSrc export, to check weight before handing loot over · false = no check
Config.RequiredJobs minimum on-duty players per job before a robbery, e.g. { police = 2 } · {} = no check
Config.BlockedJobs jobs that cannot rob, e.g. { police = true }
Config.Alert alert the jobs in jobs on a break-in · chance 0–1 · delay in ms · blipTime seconds the map circle stays · jobs = {} = off
Config.AdminBlips true = admins see every house as a map blip on join (with x3d_adminpanel, toggle it from the panel)
Config.Alert = { jobs = { 'police' }, chance = 1.0, delay = 15000, blipTime = 60 }

Config.Settings = {
    lockpickPins       = 3,        -- lockpick pins (ox_lib = number of rounds)
    safeCombination    = { {0, 20}, {30, 60}, {80, 99} },  -- safe code, one random number per range
    searchDuration     = 10000,    -- time per search point (ms)
    cooldownTime       = 3600000,  -- per-house cooldown (ms)
    portalDrawDistance = 8.0,      -- distance the door label appears
    zoneDrawDistance   = 3.0,      -- distance the search labels appear
    interactDistance   = 1.5,      -- E range
    robControl         = 38,       -- key (38 = E)
    robControlLabel    = 'E',
}

Standalone

Without ESX, items and money go through ox_inventory when it runs. Admins use ACE: add_ace group.admin x3d_houserobbery.admin allow

Standalone has no jobs. If you set Config.RequiredJobs, write Framework.GetJob in addons/framework/server.lua, otherwise nobody can rob.

Adding houses

Config.HouseRob holds one block per house:

  • portal — the entrance and exit (type = 'entrance' / 'exit') with coords, destination and heading
  • robzone — points inside, type = 'search' (loot spot) or 'safe'

Copying an existing house block and changing the coordinates is the quickest way.

Loot (sv_config.lua)

Table What it does
Config.Search floor loot: itemName, quantity = {min, max}, percent
Config.Keycard each keycard colour (itemName) is swapped for a safe key (getkeyName) when the door is picked
Config.Safe safe loot per key (keyName) · getItem always given · randomItem rolled by percent

A failed lockpick has a 30% chance to break the keycard. Leftover safe keys are taken back when the player leaves the house.

Every item has to already exist in your items table; this script does not add items. money and black_money are paid into the player's money accounts.

Admin panel

With X3D Admin Panel installed you get a "House robbery" page: every house with its status, and a toggle for house blips on the map (green = robbable · faded red = on cooldown). Without the panel everything works the same.

Exports

exports['x3d_houserobbery']:forceExit(src)   -- push a player out of a house (admin, or unsticking)

Troubleshooting

E at the door does not start a robbery — the player needs at least one keycard in the bag.

No minigame appears — the console shows no minigame available: start x3d_lockpick/x3d_safe or ox_lib, ensured before the main resource.

"Not enough police" — Config.RequiredJobs counts on-duty players only. Set it to {} if you don't want the check.

Inside but no search points — that house has no robzone set yet.

Searching gives nothing — the item names in sv_config.lua have to match your items table.

View product page