How to set up a FiveM house robbery script
Our Advanced House Robbery V2 (tk_houserobbery) supports ESX, QBCore and Qbox. To set it up, turn off the house robbery your server already runs, add the items, then set the police count and cooldowns in config. In the script, players take a job at a phone booth, lockpick the door and rob one of four interiors from the game map.
Before you start
- ESX, QBCore or Qbox. Qbox runs it through its QBCore support, with
Config..Framework = 'qb' - bl_ui and pd-safe for the default minigames. You can replace both in
client/.main_editable.lua - Optional: ox_lib,
ox_targetorqb-target, andtk_dispatchorcd_dispatch. - No SQL file to import:
READMEhas no database step..txt - The houses use interiors that already exist in the game map, set in
Config. Shell interiors do not work with it, as our docs say..Houses
Turn off the old house robbery
On a QBCore server made with the txAdmin recipe, qb-houserobbery sits in resources/ and starts with the ensure [qb] line in server.
- Stop the server.
- Move the
qb-houserobberyfolder out ofresources/[qb]to a folder outsideresources. It no longer starts. To roll back, move it back. - On ESX or Qbox, remove the
ensureorstartline of any other house robbery resource you run, or move its folder out the same way.
Moving qb-houserobbery leaves the lockpick item in qb-core/, and tk_houserobbery uses that item for doors and safes.
Install the resource
-
Extract
tk_houserobberyinto yourresourcesfolder. The download, copy and escrow steps are in how to install FiveM scripts. -
In
server, after your framework, inventory and target, and after ox_lib when.cfg Configis true, add:.UseOxLib ensure bl_ui ensure pd-safe ensure tk_houserobbery -
If you replace the default minigames, leave out the
bl_uiandpd-safelines.
Add the items
README lists every item the script gives or uses, in an ox_inventory block and a qb-inventory block.
- With ox_inventory, which Qbox also uses, copy the
Items (ox_inventory)block intoox_inventory/. ox_inventory already definesdata/ items.lua lockpick, so leave that entry out. - With qb-inventory, copy the
Items (qb-inventory)lines intoqb-core/, insideshared/ items.lua QBCore. qb-core already defines.Shared .Items lockpickanddiamond, so leave those two out. - With ESX’s own inventory,
READMEhas no item rows. The script calls.txt xPlayerand.addInventoryItem xPlayer, so each item name in the ox_inventory block must exist as a row in ESX’s.removeInventoryItem itemstable, the onees_extendedcreates. Weapons, such as the switchblade, are given as weapons and need no row..sql - Copy the PNG files from
tk_houserobbery/into your inventory’s image folder.images - In
config, point.lua Configat that folder:.ImagePath 'nui:/(the default) or/ ox_inventory/ web/ images' 'nui:/. The equipment shop and the loot buyer then show the item pictures./ qb-inventory/ html/ images'
Config sets the tools: lockpick for doors and safes, cutter for the glass display and WEAPON_SWITCHBLADE for paintings. The equipment shop in Config sells all three.
Connect the framework and your resources
The Advanced House Robbery V2 page lists the supported inventories, targets and dispatch resources. In config:
- Set
Configto.Framework 'esx', or to'qb'on QBCore and Qbox. - Set
Configto.Inventory 'ox'for ox_inventory or'qs'for qs-inventory. Keep'default'for qb-inventory or ESX’s own inventory: it uses the framework’s item functions. - Set
Configto.Target 'ox'or'qb'.'none'shows[E]prompts instead. - Set
Configto.Dispatch 'tk'for tk_dispatch or'cd'for cd_dispatch.'default'sends police a map blip, styled inConfig..Blip - Set
Configto.NotificationType 'esx','qb','ox'or'mythic'. - For ox_lib prompts, set
Config. For these prompts and for.UseOxLib = true 'ox'notifications, remove the--from--'@ox_lib/ininit.lua', fxmanifest..lua
The tk_dispatch and cd_dispatch alerts go to the police job only. If your police job has another name, change jobs = {'police'} and job_table = {'police'} in client/.
Set police and cooldowns
- Set
Configto the number of police needed online before a door can be lockpicked. The default is.PoliceRequired 0. - In
Config, list each police job with its lowest counting grade, such as.PoliceJobs police = 0. The count checks job and grade, not duty. - Set
Config, in milliseconds. The default.Cooldown .user 1000 * 60 * 30is 30 minutes between jobs for one player;0turns it off. - Set
Config, also in milliseconds. The default.Cooldown .house 1000 * 60 * 120keeps a robbed house closed for 2 hours. - To allow robberies only at night, set
Config..RobAtNightOnly = true - To skip the phone booths, set
Config. Players then lockpick any door listed in.UsePhoneBooths = false Config..Entrances
Alerts also come from failed lockpicks (Config, in percent) and from a woken homeowner (Config).
Check it works
Use a character without a police job: police skip the lockpick and cannot take jobs.
- Set
Config, restart the server with no police online, and put a.PoliceRequired = 1 lockpickin your inventory. - At a phone booth, use “Use phone booth” and press “Accept Job”. The notification “GPS set to job location” appears with a waypoint.
- Try to lockpick the marked door. “Not enough police on duty” appears.
- Set
Configback to your value and restart the server, which also clears the job cooldown. Take a job again and lockpick the door. The pd-safe minigame opens, and success lets you in..PoliceRequired
The Advanced House Robbery V2 showcase on YouTube (1:35) shows the robbery in game.
If it fails
[WARNING] pd-safe resource not started. Skipping lockpick minigame. Install pd-safe or change minigame in client/: doors and safes open with no minigame. Startmain_editable.lua pd-safe, or changeDoDoorLockpickMinigameandDoSafeLockpickMinigameinclient/.main_editable.lua [WARNING] bl_ui resource not started. Skipping minigame. Install bl_ui or change minigame in client/: the security panel hack is skipped. Startmain_editable.lua bl_ui, or changeDoSecurityDisableMinigame.- “You need” followed by an amount and an item: the player lacks the tool, or the item is missing from your inventory’s item list.
- “Not enough police on duty”: fewer players hold a job and grade from
Configthan.PoliceJobs Config..PoliceRequired - A cooldown that ends almost at once: a value typed as minutes (
30) is read as 30 milliseconds. Write1000 * 60 * 30. - Item pictures missing in the shop or buyer screen: copy the PNG files and check
Config..ImagePath
