data/items.lua.
Weapons in
data/weapons.lua (grenades, snowballs, BZ gas, etc.) throw via the engine’s native weapon system. The throwable tag on those entries is purely for the filter chip and stack behaviour. The throwing system documented here is for regular items in data/items.lua.How throwing works
- A throwable item gets a Throw entry added to its right-click context menu.
- When the player triggers Throw, the configured prop model is attached to their right hand.
- Hold RMB to enter the aiming pose, release LMB to throw, or press X to cancel.
- The projectile arcs through the air, can smash any of the 6 vehicle windows on direct hit, and ragdolls nearby NPCs on impact.
- Once it stops moving, the item is registered server-side and any nearby player can pick it up (via ox_target if present, otherwise a fallback marker prompt).
- Landed pickups auto-despawn after 5 minutes if untouched.
The item fields
Add the following fields to any item definition indata/items.lua.
Adding a throwable item
1
Add the fields to the item entry
Open
data/items.lua and add throwable, throwModel, and throwOffset to the item.data/items.lua
2
(Optional) Allow throwing several at once
For stackable items where it makes sense to throw a handful in one go (cash piles, marbles, food scraps), add
throwMultiple = true. The player gets a small input dialog asking how many to throw.data/items.lua
3
Restart the resource
ensure ox_inventory. The new item is now throwable. Spawn one with /giveitem 1 molotov_bottle 1 to test.Finding good throwOffset values
The offset determines how the prop sits in the player’s right hand. A bad offset means the prop clips into the wrist or floats away from the hand.
Two quick ways to find usable values:
- Reuse an existing offset. If your prop model is already used by another throwable item (or any item’s
client.prop), copy that entry’sposandrotvectors. - Use a prop-attachment tool. Tools like Codewalker or in-game attachment editors let you drag the prop on a ped bone in real time. Pick the right-hand bone, position the prop, then copy the resulting position and rotation vectors into
throwOffset.
Worked example - throwable cash pile
A dirty-money stack that lets the player throw any amount in one motion:data/items.lua
Tips
- Match the prop to the item. A bandage throwing as a paper bag is jarring. The closer the prop model is to the item’s actual look, the more believable the throw.
- Tag it
'throwable'. It costs nothing and lets players filter their inventory down to throwables at a glance. - Use
throwMultiplesparingly. It adds an input prompt, so reserve it for items where throwing several at once is genuinely useful (cash, marbles, food fights). For most items, single-throw is cleaner. - Test the impact behaviour. Throwables smash any vehicle window on direct hit and ragdoll the nearest NPC within 2m of the landing spot. That can be exactly what you want, or unwanted - keep it in mind when tagging items as throwable.