Overview
A FiveM script that allows players to rob NPCs at gunpoint. Supports both QBCore and Qbox frameworks with qb-inventory and ox_inventory.
Features
- Rob any NPC by aiming a weapon at them
- NPCs put their hands up when threatened
- Configurable cooldown between robberies
- Police requirement system
- Randomized loot rewards with configurable chances
- Progress bar during robbery
- NPCs flee after being robbed
Installation
1
Download & Place
Download and place in your resources folder
2
Add to server.cfg
ensure sg-robnpc3
Configure
Configure config.lua to your liking
Framework Setup
For QBCore
In fxmanifest.lua:
- Keep
'@qb-core/client/main.lua'uncommented inclient_scripts - Comment out
'@qbx_core/modules/lib.lua'inshared_scripts
For Qbox
In fxmanifest.lua:
- Comment out
'@qb-core/client/main.lua'inclient_scripts - Uncomment
'@ox_lib/init.lua'inshared_scripts - Uncomment
'@qbx_core/modules/lib.lua'inshared_scripts
Inventory Support
The script auto-detects your inventory system. You can also manually set it in config.lua:
Config.Inventory = 'auto' -- Auto-detect (default)
Config.Inventory = 'ox_inventory' -- Force ox_inventory
Config.Inventory = 'qb-inventory' -- Force qb-inventoryConfiguration
Config.Framework = 'auto' -- 'auto', 'qbcore', or 'qbox'
Config.Inventory = 'auto' -- 'auto', 'qb-inventory', or 'ox_inventory'
Config.CooldownTime = 60 -- Seconds between robberies
Config.RobDistance = 3.0 -- Distance to initiate robbery
Config.RequiredPolice = 0 -- Minimum police onlineRewards
Configure loot in Config.Rewards:
Config.Rewards = {
{item = "cash", min = 100, max = 500, chance = 100},
{item = "goldbar", min = 1, max = 2, chance = 20},
-- Add more items...
}Usage
- Equip any weapon
- Aim at an NPC within range
- NPC will put their hands up
- Press E to start robbing
- Wait for the progress bar to complete
Dependencies
- QBCore or Qbox framework
qb-inventoryorox_inventoryox_lib(If using QBox)
Credits
Author: sgMAGLERA