How to set up a FiveM house robbery script
Our Advanced House Robbery V2 (tk_houserobbery) supports ESX, Qbox and QBCore. 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. Here’s how it plays: 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, Qbox or QBCore. On Qbox it runs through Qbox’s QBCore support, so you use
Config..Framework = 'qb' - bl_ui and pd-safe for the default minigames. You can swap either one out in
client/.main_editable.lua - Optional: ox_lib,
ox_targetorqb-target, andtk_dispatchorcd_dispatch. - There’s no SQL file to import.
READMEhas no database step..txt - The houses are interiors that already exist in the game map, set in
Config. Shell interiors won’t work with it, as our docs explain..Houses
Turn off the old house robbery
On a QBCore server made with the txAdmin recipe, qb-houserobbery sits in resources/. It starts with the ensure [qb] line in server.
- Stop the server.
- Move the
qb-houserobberyfolder out ofresources/[qb]to somewhere outsideresources. It won’t start any more. 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.
The lockpick item stays in qb-core/ after the move. You’ll still want it, because tk_houserobbery uses it 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, add these lines after your framework, inventory and target. If.cfg Configis true, put them after ox_lib as well:.UseOxLib ensure bl_ui ensure pd-safe ensure tk_houserobbery -
If you’ve replaced the default minigames, leave out the
bl_uiandpd-safelines.
Add the items
README lists every item the script gives or uses. There’s one block for ox_inventory and one for qb-inventory.
- With ox_inventory, which Qbox also uses, copy the
Items (ox_inventory)block intoox_inventory/. Leave out thedata/ items.lua lockpickentry, since ox_inventory already has one. - With qb-inventory, copy the
Items (qb-inventory)lines intoqb-core/, insideshared/ items.lua QBCore. qb-core already has.Shared .Items lockpickanddiamond, so leave those two out. - With ESX’s own inventory,
READMEhas no item rows for you. The script gives and takes items with.txt xPlayerand.addInventoryItem xPlayer. So every item name in the ox_inventory block needs a row in ESX’s.removeInventoryItem itemstable, the onees_extendedcreates. Weapons such as the switchblade are given as weapons and don’t need a 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:/. Then the equipment shop and the loot buyer 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 Qbox and QBCore. - Set
Configto.Inventory 'ox'for ox_inventory or'qs'for qs-inventory. For qb-inventory or ESX’s own inventory, keep'default', which uses the framework’s item functions. - Set
Configto.Target 'ox'or'qb'. With'none', players get[E]prompts instead. - Set
Configto.Dispatch 'tk'for tk_dispatch or'cd'for cd_dispatch. With'default', police get a map blip, which you style inConfig..Blip - Set
Configto.NotificationType 'esx','qb','ox'or'mythic'. - For ox_lib prompts, set
Config. These prompts and.UseOxLib = true 'ox'notifications also need the--removed from--'@ox_lib/ininit.lua', fxmanifest..lua
The tk_dispatch and cd_dispatch alerts only go to the police job. If your police job has a different name, change jobs = {'police'} and job_table = {'police'} in client/.
Set police and cooldowns
- Set
Configto how many police must be online before anyone can lockpick a door. The default is.PoliceRequired 0. - In
Config, list each police job with its lowest grade that counts, such as.PoliceJobs police = 0. The count looks at job and grade, not duty. - Set
Configin milliseconds. The default,.Cooldown .user 1000 * 60 * 30, gives one player 30 minutes between jobs. Set it to0to turn it off. - Set
Config, also in milliseconds. The default,.Cooldown .house 1000 * 60 * 120, keeps 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 can then lockpick any door listed in.UsePhoneBooths = false Config..Entrances
Police can also be alerted by a failed lockpick (Config, a 40% chance) or by a homeowner who wakes up (Config).
Check it works
Test with a character who doesn’t have a police job. Police skip the lockpick and can’t 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”. You’ll get the notification “GPS set to job location” and a waypoint.
- Try to lockpick the marked door. You’ll see “Not enough police on duty”.
- Put
Configback to your own value and restart the server. The restart also clears the job cooldown. Take a job again and lockpick the door. The pd-safe minigame opens, and if you succeed, you’re in..PoliceRequired
To see the robbery in game, watch the Advanced House Robbery V2 showcase on YouTube (1:35).
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 doesn’t have 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 Configasks for..PoliceRequired - A cooldown that ends almost at once: a value typed as minutes (
30) is read as 30 milliseconds. Write1000 * 60 * 30instead. - Item pictures missing in the shop or buyer screen: copy the PNG files over and check
Config..ImagePath
