data/looting.lua lets you put rules on that: keep certain items out of a robber’s hands entirely, and cap how much of something they can walk away with.
Nothing changes until you add rules. The file ships with an empty list.
What the rules apply to
Exactly one thing: a player dragging an item out of another player’s open inventory. That matters more than it sounds. Everything else that moves items uses the ox_inventory exports, which never pass through this check, so all of the following keep working untouched:- Admin menus taking or giving items
- Evidence lockers and confiscate on arrest
- Death drop scripts clearing an inventory
- Shops, crafting, and any job script that adds or removes items
The file
data/looting.lua
Rule fields
whenVictim and exempt use the same group format as stashes and shops:
Where more than one rule covers the same item, the most restrictive one wins. Rule order in the file never matters, so you cannot break a rule by adding another one above it.
How limits are counted
This is the part worth understanding before you set a number. A limit belongs to the victim, not to the robbery. When someone takes 4,000 off a player with a 10,000 cap, that player has 6,000 left in the pot, and it stays that way for the rest of the window no matter who does the next robbery. That closes the two obvious ways round a cap:- Robbing the same person again a minute later draws from the same 6,000
- Three people robbing together share one pot, they do not get 10,000 each
window is how long that lasts, in minutes. Being revived does not reset it, or downing someone twice would hand out a fresh allowance.
Things it cannot do
- Only inventory items. If your server keeps cash as a framework account rather than an item, it never passes through the inventory and a limit cannot reach it.
- Not a replacement for a robbery script. These are rules about what can be taken, not about how the robbery is performed.
Messages
Refused actions tell the player why, usingcannot_loot_item and cannot_loot_amount from your locale file. Both are translated in every shipped language.