Supported Frameworks
| Value | Framework |
|---|---|
standalone | No framework — cash handled internally |
nat | NAT2K15 framework |
nd | ND_Core |
How a Robbery Works
Player aims at an NPC
When a player raises a weapon within
Config.DistanceToRob metres of a pedestrian NPC, the script detects the aim automatically. No keybind or menu is needed.NPC reacts
After
Config.Wait.NPCReactTime seconds, the NPC raises its hands and enters a fear animation.Progress bar runs
A progress bar appears on-screen for
Config.Wait.TimeToRob seconds. The player must keep the weapon aimed and stay within range for the bar to complete.NPC potentially alerts police
After
Config.Wait.AlertCopsTime seconds (which may overlap with the progress bar), the script rolls against Config.ChanceToCallCops. On a hit, a server-wide notification broadcasts the robbery’s street name to all online players.NPC potentially retaliates
If
Config.PedTakesAim.Enabled is true, the script rolls against Config.PedTakesAim.Chance. On a hit, the NPC draws Config.PedTakesAim.Weapon and opens fire.The cop alert broadcasts the robbery’s street name to all players on the server. No ACE permissions are required on the player side — the broadcast is server-side and fires automatically.
Configuration
All settings live inconfig.lua in the resource root. The values below are the shipped defaults.
config.lua
Configuration Options Explained
DistanceToRob
DistanceToRob
Controls how close a player must be to a pedestrian for the robbery to trigger. Lower values (2–3) demand the player be nearly on top of the NPC; higher values (6–8) let players rob from a safer distance. The default of
4 balances realism with usability.MinCash and MaxCash
MinCash and MaxCash
The script picks a random integer between these two values when paying out a successful robbery. Setting
MinCash = 0 means there is a chance the NPC has no cash at all, adding unpredictability. For a low-risk economy, keep MaxCash below $500; for high-crime servers, you can push it higher and compensate with a steeper cop-call chance.ChanceToCallCops
ChanceToCallCops
A value from
0 to 100. At 20, roughly one in five robberies triggers a server-wide alert. At 100, every robbery is reported. At 0, alerts are disabled. Tune this alongside AlertCopsTime — a longer delay gives players more time to flee before the alert fires.PedTakesAim
PedTakesAim
When enabled, NPCs have a percentage chance to draw a weapon and fight back instead of staying passive. The weapon is set as a GTA V weapon hash string (e.g.
weapon_pistol, weapon_knife). Disable this entirely by setting Enabled = false if you prefer purely passive pedestrians.Cooldown
Cooldown
The cooldown is set in minutes. At the default of
10 minutes, a player can rob at most 6 NPCs per hour. Lower this for action-heavy servers or raise it to discourage farming.Installation
Add to server.cfg
Add sh-robNPCs to your resource list. No additional dependencies are required:
server.cfg
Tune reward and risk values
Adjust
MinCash, MaxCash, ChanceToCallCops, and the PedTakesAim block to match your server’s economy and risk level.Set the cooldown
Set
Config.Wait.Cooldown in minutes. The default is 10 minutes. Consider a longer cooldown on economy servers to prevent cash farming.