SleepyCode
Home
AboutBlogSubscriptionDocs
Cart0
SleepyCode
Cart0
  1. Home
  2. /
  3. Guides
6 min read

Guide · October 19, 2026

How to Add Items to ox_inventory (with Images and Usable Items)

Add new items to ox_inventory on ESX, QBCore or QBox: the items.lua entry, item images, giving the item in-game and making it usable with an export.

Many scripts need you to add their items to your inventory before they work: a fishing rod, drugs to sell, a gift box. In ox_inventory every item is defined in one file, and adding one takes a few lines.

1. Open items.lua

The file lives at:

resources/[ox]/ox_inventory/data/items.lua

It returns one big table where every key is an item name.

2. Add the item

Add a new entry anywhere inside the table:

lua
['fishing_rod'] = {
    label = 'Fishing Rod',
    weight = 1500,
    stack = false,
    close = true,
    description = 'A sturdy rod for the lake by Sandy Shores',
},
FieldMeaning
key (fishing_rod)The item name scripts use. Lowercase, no spaces. Must match the script's config exactly
labelThe name players see
weightWeight in grams (1500 = 1.5 kg)
stackfalse for unique items like tools or weapons
closeClose the inventory when the item is used
descriptionTooltip text

Watch the commas: a missing , after the closing } breaks the whole file and ox_inventory will not start.

3. Add the item image

Put a PNG named exactly like the item into:

resources/[ox]/ox_inventory/web/images/fishing_rod.png

A square transparent PNG around 100 × 100 px looks right in the grid. Script packs often include their images in an images or inventory_images folder. Copy them all here.

4. Restart the server

ox_inventory loads items when it starts. Restarting only ox_inventory while players are online is not recommended, so do a full server restart.

5. Give yourself the item

In-game or in the server console, as an admin:

/giveitem 1 fishing_rod 1

The arguments are player server ID, item name and count. If the command is refused, see how to give yourself admin on FiveM.

Make the item usable

An item does nothing when used until something listens for it. With ox_inventory you can point the item at an export:

lua
['gift_box'] = {
    label = 'Gift Box',
    weight = 300,
    stack = true,
    close = true,
    server = {
        export = 'my_script.useGiftBox',
    },
},

and in my_script/server.lua:

lua
exports('useGiftBox', function(event, item, inventory, slot, data)
    if event == 'usingItem' then
        local playerId = inventory.id
        exports.ox_inventory:AddItem(playerId, 'money', 500)
        return true
    end
end)

Returning true on usingItem lets ox_inventory remove one from the stack. On ESX, scripts that use ESX.RegisterUsableItem keep working through ox_inventory's bridge, so you only need the export method for your own items.

Client effects: animations and props

For eat/drink style items you can make ox_inventory play an animation and progress bar without any extra script:

lua
['burger'] = {
    label = 'Burger',
    weight = 220,
    client = {
        status = { hunger = 200000 },
        anim = 'eating',
        prop = 'burger',
        usetime = 2500,
        notification = 'You ate a delicious burger',
    },
},

Common problems

ProblemFix
Item shows as "Unknown item"Name in the script config and items.lua differ, or the server was not restarted
Missing image (question mark)PNG name does not match the item name exactly, or it is not a PNG
ox_inventory does not start after editingSyntax error in items.lua, usually a missing comma. The server console shows the line
Using the item does nothingNo export or usable item registered, or the export name has a typo

Scripts that come with their items ready

SleepyCode Fishing ships ready-made items.lua entries for all 43 of its items plus the matching images, so setup is copy-paste. Browse all FiveM scripts.

The catalogue

Every script for ESX and QBCore, in one place.

Browse scripts

On this page

  1. 011. Open items.lua
  2. 022. Add the item
  3. 033. Add the item image
  4. 044. Restart the server
  5. 055. Give yourself the item
  6. 06Make the item usable
  7. 07Client effects: animations and props
  8. 08Common problems
  9. 09Scripts that come with their items ready
Next

More guides

  • How to Make a FiveM Server in 2026 (txAdmin with ESX, QBCore or QBox)Set up your own FiveM server from scratch with txAdmin: artifacts, license key, database, ESX/QBCore/QBox recipe, port forwarding and the first scripts to add.Read →
  • How to Install the SleepyCode Vehicle Shop V1 (FiveM ESX Guide)Step-by-step installation guide for SleepyCode Vehicle Shop V1 on FiveM ESX servers - dependencies, server.cfg, config.lua options and test drives.Read →
Ready when you are

Put your server on something that holds up

150+ servers run our resources - ESX, QBCore and standalone. Once the payment clears, the package is waiting in Keymaster.

Browse the catalogueAsk on Discord ↗
  • Delivered instantly
  • Support with no expiry
  • 100+ reviews
  • Payment via Tebex

SleepyCode

FiveM Scripts

Checkout is run by Tebex Limited - they handle payment, invoicing and refunds. © 2026

Community

  • Discord
  • YouTube
  • X (Twitter)

Navigation

  • Home
  • All Scripts
  • ESX Scripts
  • QBCore Scripts
  • Free Scripts
  • About
  • Blog
  • Documentation
  • Support

Legal

  • Privacy Policy
  • Tebex Privacy Policy
  • Terms of Service
  • Impressum

© 2026 SleepyCode. Not affiliated with Rockstar Games or Take-Two Interactive.

Powered byTebex