r_storage Configuration
r_storage config: framework and integrations, money and police, the bolt cutters, crates and loot, noise and the alarm, the three warehouse sizes, the doors, hooks and the admin command.
All settings live in shared/config.lua, and the doors in shared/config_doors.lua. Restart the
resource after changing them.
General
R.Framework = 'auto' -- 'auto' | 'esx' | 'qb' | 'qbox'
R.Inventory = 'auto' -- 'auto' | 'ox_inventory' | 'qb-inventory' | 'quasar' | 'framework'
R.Target = 'auto' -- 'auto' | 'ox_target' | 'qb-target' | 'none' (key prompt) | 'custom' (edit BridgeCustomTarget in bridge/cl_target.lua)
R.Notify = 'auto' -- 'auto' | 'ox_lib' | 'esx' | 'qb' | 'okok' | 'quasar' | 'codesign'
R.TextUI = 'gta' -- 'gta' | 'ox_lib' | 'okok' | 'qb' | 'jg' | 'cd' | 'esx' | 'custom' (edit BridgeTextUI in bridge/cl_textui.lua)
R.Meters = 'rscripts' -- 'rscripts' | 'gta' | 'custom' (edit BridgeMeters in bridge/cl_meters.lua), the noise bar
R.Dispatch = 'auto' -- 'auto' | 'cd_dispatch' | 'ps-dispatch' | 'qs-dispatch' | 'rcore_dispatch' | 'core_dispatch' | 'tk_dispatch' | 'lb-tablet' | 'linden' | 'op' | 'custom' | 'none'
R.Locale = '' -- '' = ox:locale convar, or 'en' / 'fi'
R.Debug = false
R.UI = {
Accent = '#9a27ea',
}Prompt, noise bar and custom target
R.Target is used for the padlock, the door, the crates and the exit. With 'none' you get a key
prompt instead. R.TextUI picks how the prompts look. For custom, edit BridgeTextUI in
bridge/cl_textui.lua.
R.Meters is the noise bar. 'rscripts' shows a pill at the bottom of the screen in your
Accent colour, 'gta' shows GTA's timer bar. For 'custom', fill in BridgeMeters.Show(bars)
and BridgeMeters.Hide() in bridge/cl_meters.lua. Each bar has label, value (0-1), warn
and icon.
R.Target = 'custom' is for any other target script: fill in BridgeCustomTarget in
bridge/cl_target.lua (AddBoxZone, AddModels, AddEntity, Remove; each option has name,
label, icon, distance, canInteract and onSelect). The bridge/ folder is open, so you
can edit it freely.
Money and police
R.Money = {
dirty = false, -- true = pay found cash as dirty money
dirtyItem = 'auto', -- 'auto' = ESX black_money, qb-inventory markedbills, ox/qs black_money item, or an item name
}
R.Police = {
jobs = { 'police', 'sheriff' },
onDutyOnly = true,
required = 0, -- police needed online to break in
canRob = true, -- false = on-duty police can't break in
}jobs and onDutyOnly decide who counts as police, both for required and for canRob. The
dispatch alert goes to every job in jobs.
The break-in
R.Break = {
range = 2.5, -- metres you may be from the lock
item = 'bolt_cutter', -- item needed to cut the lock, false = none
noise = 35, -- % noise when the lock is cut
}
R.Bag = 45 -- duffel bag drawable worn during the robbery, false = noneThe bag goes on at the break-in and comes off when you leave the warehouse or walk 30 m from the open door. A player who already wears a bag keeps their own.
Crates
R.Crates = {
item = 'WEAPON_CROWBAR', -- item needed to pry crates, false = none
emptyChance = 15, -- % a crate holds nothing
range = 3.0, -- metres you may be from the crate
filler = true, -- false bottom and boxes inside the crates
props = { -- what is lifted out of the crate, by the rarest find in it
money = 'prop_cash_case_02',
metalscrap = 'prop_tool_box_04',
steel = 'prop_tool_box_01',
copper = 'prop_car_battery_01',
aluminum = 'prop_jerrycan_01a',
plastic = 'prop_jerrycan_01a',
rubber = 'prop_cs_cardbox_01',
lockpick = 'prop_tool_box_04',
advancedlockpick = 'prop_tool_box_01',
electronickit = 'prop_tool_drill',
},
}Add a line to props when you add a loot item, or nothing is lifted out for it.
Noise and the alarm
R.Noise = {
enabled = true, -- false = no noise bar and no alarm
decay = 5, -- % the noise of a door drops every minute
}
R.Alarm = {
sound = true, -- alarm bell at the door when the noise hits 100 %
duration = 12, -- seconds the bell rings
blip = { sprite = 473, colour = 1, scale = 1.1, time = 60 },
}Each door has its own noise, shared by everyone inside. Cutting the lock adds R.Break.noise, and
every crate adds its size's noise. At 100 % the bell rings for players near the door and inside,
and the police get the alert. blip is the blip on the police map.
Warehouse sizes
R.Storage = {
small = {
crates = { 3, 4 }, -- crates to pry in one robbery
noise = 18, -- % noise per crate
open = 8, -- minutes the door stays broken
cooldown = 30, -- minutes before the door can be robbed again
fill = 70, -- % of the shelves that hold cargo
finds = 2, -- most finds in one crate
loot = {
money = { chance = 15, amount = { 80, 240 } },
items = {
{ name = 'metalscrap', chance = 90, amount = { 2, 5 } },
{ name = 'plastic', chance = 70, amount = { 2, 4 } },
{ name = 'rubber', chance = 50, amount = { 1, 3 } },
{ name = 'lockpick', chance = 15, amount = { 1, 1 } },
},
},
},
medium = { --[[ 5-7 crates, 14 % noise, 10 min open, 45 min cooldown ]] },
large = { --[[ 8-10 crates, 12 % noise, 12 min open, 60 min cooldown, up to 3 finds ]] },
}| Option | What it does |
|---|---|
crates | How many crates the robbery has, picked between the two numbers |
noise | Noise each crate adds |
open | Minutes the door stays open after the break-in, then everyone inside is let out |
cooldown | Minutes the door stays locked after that |
fill | How full the shelves look |
finds | Most finds in one crate. When more roll, the rarest are kept |
loot | Each item and the money roll their own chance in %, with amount as min and max |
Finds with a chance of 5 or less get the Rare find message.
Doors
R.Doors = {
{
id = 'pacific_bait_storage',
label = 'Pacific Bait Storage',
size = 'small',
coords = vector3(54.19, -2569.25, 5.00),
exit = vector4(53.57, -2569.26, 5.00, 88.9),
lock = vector4(55.101, -2568.694, 6.240, 268.9),
},
--[[ white_widow_garage, celltowa_unit, convenience_store_lockup, foreclosed_garage, xero_gas_factory ]]
}| Field | What it is |
|---|---|
id | Unique name, used by the admin command and the hooks |
label | Shown in the police alert and the logs |
size | small, medium or large, which warehouse and which R.Storage rules it uses |
coords | The door |
exit | Where players come out, with their heading |
lock | Where the padlock hangs, with the heading of a player facing the door |
To add a door, copy an entry and give it a new id. R.Interiors below the doors holds the three
GTA warehouses and their crate spots, so you don't need to touch it.
Other settings
R.Instances = {
base = 6200, -- first routing bucket, each door uses base + its number
}
R.Admin = {
command = 'storagerob',
group = 'group.admin',
}
R.Blips = {
enabled = false, -- true = a map blip on every door
sprite = 478,
colour = 31,
scale = 0.8,
}
R.Logs = {
enabled = false,
type = 'webhook', -- 'webhook' (URL in server/sv_custom.lua) | 'ox_lib'
showIp = false,
}Every door has its own warehouse, so robberies at different doors never meet. Change
R.Instances.base only if another script uses routing buckets 6201 to 6206.
Admin command
/storagerob <action> for R.Admin.group.
| Action | What it does |
|---|---|
status | Every door that is being robbed, open or on cooldown |
reset <door> | Send everyone inside out, lock the door again and clear its noise. Door number or id |
reset all | The same for every door |
Hooks
server/sv_custom.lua and client/cl_custom.lua are open. Fill in these functions to tie the
script to your server:
| Function | File | When |
|---|---|---|
CanRob(src, doorId) | server | Before a break-in. Return false to block it. |
OnLooted(src, doorId, found) | server | When a robber leaves, with the items they found. |
OnAlarm(data, src) | server | When the alarm goes off (used for lb-tablet). |
CanRob(doorId) | client | Before a break-in. Blocks dead, cuffed or in-vehicle players by default. |
Dispatch(data) | client | Sends the alert to your dispatch. Add your own under custom. |