Skip to content
Documentation
R_Npcrobbery

r_npcrobbery Configuration

r_npcrobbery config: framework and integrations, money and police, the robbery, jewelry, masks, citizens that rob you back, witnesses, alarms, zones, the citizen classes, logs and security.

All settings live in shared/config.lua, and the citizen classes in shared/config_victims.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 robbery / chase / call bars
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, bars and custom target

R.Target is only used for picking up a dropped wallet. 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 WALLET, STOP THEM, HANDS UP, JEWELRY and 911 CALL bars. 'rscripts' shows pills at the bottom of the screen in your Accent colour, 'gta' shows GTA's timer bars. 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 every cash reward 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,
    canRob = true,          -- false = on-duty police can't rob citizens
}

jobs and onDutyOnly decide who counts as police, both for R.Robbery.police and for canRob.

The robbery

R.Robbery = {
    police = 0,             -- police needed to rob a citizen
    cooldown = 120,         -- seconds before you can rob again after a robbery
    retry = 15,             -- seconds before you can try again after one goes wrong
    aimTime = 0.3,          -- seconds of pointing a gun at someone before they give in
    aimDistance = 8.0,
    maxDistance = 12.0,     -- they run if you get further away than this
    duration = 8,           -- seconds of aiming while they dig out the wallet
    panicAfter = 3,         -- seconds without a gun on them before they run, 0 = never
    tossDistance = 4.0,     -- how close you must stand for them to throw you the wallet
    melee = true,           -- knives, bats and other melee weapons can rob too
    skillCheck = false,     -- e.g. { 'easy', 'medium' }, failing makes them run
    hurry = {
        enabled = true,     -- a warning shot makes them dig out the wallet faster
        boost = 0.75,       -- +75 % speed
        time = 3,           -- seconds each shot keeps them hurrying
    },
    chaseTime = 12,         -- seconds to stop a runner with a warning shot or a hit
    warnDistance = 25.0,    -- how close to them a warning shot must be
    fightTime = 60,         -- seconds a fight lasts before they give up
    pickupTime = 60,        -- seconds a dropped wallet stays on the ground
    wallet = 'prop_ld_wallet_01',
    purse = 'prop_ld_purse_01', -- women throw a purse, false = a wallet for everyone
    talk = true,            -- victims and witnesses speak with GTA's own voice lines
}

The skill check is lib.skillCheck. Swap it for your own in SkillCheck in client/cl_custom.lua.

Jewelry

R.Jewelry = {
    enabled = true,         -- after the wallet you can make them drop their jewelry (R.Victims jewelry)
    time = 15,              -- seconds to ask for it before they walk off with it
    stripTime = 4,          -- seconds they fumble taking it off
    pickupTime = 30,        -- seconds it stays on the ground
    props = {               -- what lands on the ground, items without a prop only get the marker
        pocket_watch = 'p_watch_02',
        pearl_necklace = 'p_jewel_necklace02_s',
    },
}

After they throw the wallet, press E to make them drop what they wear. What they wear is rolled from their class's jewelry list in shared/config_victims.lua.

Masks

R.Disguise = {
    enabled = true,         -- without a mask the police alert describes the robber (SuspectDescription in server/sv_custom.lua)
    callFactor = 0.5,       -- with a mask victims and witnesses call the police this much less often
    hint = true,            -- tell the robber when they start without a mask
}

The description says male or female, a hat, glasses and the weapon type. Change the wording in SuspectDescription in server/sv_custom.lua.

When they pull a gun

R.Reversal = {
    weapon = 'WEAPON_PISTOL',
    decideTime = 5,         -- seconds to put your hands up or shoot first
    key = 73,               -- control to put your hands up, 73 = X
    keyLabel = 'INPUT_VEH_DUCK', -- the same control for the help text
    robTime = 10,           -- seconds they go through your pockets
    account = 'cash',       -- 'cash' | 'bank' | 'black_money'
    takePercent = 80,       -- % of that account they take
    maxTake = 0,            -- most they take, 0 = no limit
    shootChance = 3,        -- % they still shoot you after taking the money
}

Put your hands up and they rob you. Shoot first, or wait too long, and it turns into a gunfight. How often a citizen draws is the draw weight of their class.

Witnesses

R.Witnesses = {
    enabled = true,
    radius = 35.0,          -- how far away people notice the robbery
    panicRadius = 15.0,     -- people closer than this run away in panic first
    max = 6,                -- most people that react to one robbery
    callers = 2,            -- most of them that end up calling the police
    chance = 50,            -- % each witness calls once they are far enough away
    safeDistance = 30.0,    -- how far a runner gets before stopping to call
    delay = { 1, 3 },       -- seconds before people further away start calling
    callTime = 8,           -- seconds you have to aim at a caller before the call goes through
}

A caller gets a red marker and the 911 CALL bar starts. Aim at them, hit them or fire a shot close by and the call stops.

Alarms

R.Alarm = {
    delay = { 5, 15 },      -- seconds from the call to the police alert
    cooldown = 60,          -- seconds between two alerts about the same robber
    blip = { sprite = 59, colour = 1, scale = 1.2, time = 90 },
}

The alert goes to R.Dispatch after delay seconds.

Zones

R.Zones = {
    enabled = false,        -- true = citizens can only be robbed inside the zones below
    debug = false,
    list = {
        grove = {
            thickness = 30.0,
            points = {
                vec3(-181.35, -1503.81, 29.28),
                vec3(-245.34, -1582.32, 29.28),
                vec3(-245.54, -1707.32, 29.28),
                vec3(-184.44, -1763.43, 29.28),
                vec3(-50.08, -1606.60, 29.28),
            },
        },
    },
}

Off by default, so citizens can be robbed anywhere. Turn on debug to see the zones in game.

Citizens

shared/config_victims.lua sorts citizens into classes by ped model. Any model not in a list uses default. The model lists are shortened here:

R.Victims = {
    rich = {
        cash = { 250, 1200 },
        call = 60,              -- % they call the police after you let them go
        bend = { fight = 0 },    -- % they turn back and attack when you bend down for the dropped jewelry
        reactions = { comply = 80, flee = 15, fight = 0, draw = 5 },
        jewelry = {             -- what they wear and hand over after the wallet, each rolls its own %, 5 % or less = rare find
            { name = 'pocket_watch', chance = 20, amount = { 1, 1 } },
            { name = 'pearl_necklace', chance = 12, amount = { 1, 1 } },
            { name = 'wedding_ring', chance = 15, amount = { 1, 1 } },
            { name = 'diamond_ring', chance = 4, amount = { 1, 1 } },
        },
        models = { 'a_f_m_bevhills_01', 'a_m_y_business_01', ... },
    },

    gang = {
        cash = { 100, 600 },
        call = 0,
        bend = { fight = 35 },
        reactions = { comply = 45, flee = 10, fight = 20, draw = 25 },
        weapon = 'WEAPON_KNIFE', -- what they fight with, false = fists
        jewelry = {
            { name = 'wedding_ring', chance = 8, amount = { 1, 2 } },
            { name = 'diamond_ring', chance = 3, amount = { 1, 1 } },
        },
        models = { 'g_m_y_ballaeast_01', 'g_m_y_famca_01', ... },
    },

    poor = {
        cash = { 0, 60 },
        call = 10,
        bend = { fight = 0 },
        reactions = { comply = 70, flee = 25, fight = 5, draw = 0 },
        jewelry = {
            { name = 'wedding_ring', chance = 6, amount = { 1, 1 } },
        },
        models = { 'a_m_m_tramp_01', 'a_m_y_methhead_01', ... },
    },

    default = {
        cash = { 50, 450 },
        call = 35,
        bend = { fight = 5 },
        reactions = { comply = 75, flee = 15, fight = 0, draw = 10 },
        jewelry = {
            { name = 'wedding_ring', chance = 8, amount = { 1, 1 } },
            { name = 'pocket_watch', chance = 6, amount = { 1, 1 } },
            { name = 'pearl_necklace', chance = 6, amount = { 1, 1 } },
        },
    },
}
FieldWhat it does
cashMoney in the wallet, min and max
call% they call the police after you let them go
bend% they attack when you bend down for the jewelry
reactionsWeights for comply, flee, fight and draw
weaponWhat they fight with, false = fists
jewelryWhat they may wear, each item rolls its own chance
modelsThe ped models in this class

R.Blacklist in the same file lists the models that can never be robbed: police, sheriffs, SWAT, rangers, guards and soldiers.

Admin, logs and security

R.Admin = {
    command = 'npcrobbery',
    group = { 'group.admin', 'group.god' },
}

R.Logs = {
    enabled = true,
    type = 'webhook',       -- 'webhook' (set it in server/sv_custom.lua) | 'ox_lib'
    showIp = false,
}

R.Security = {
    interactDistance = 2.5,
    requestCooldown = 500,  -- ms
}

The admin command is on the Exports page.