Skip to main content
TRACK A·FRAMEWORK CONFIG·Verified June 2026 · Lua 5.4 · ox_lib 3.x
Learning with an AI assistant?
Copies this lesson plus 2026 ground rules (no lua54 'yes', Cfx.re Portal, correct callback signatures) as a ready-to-paste mentor prompt.

Create a usable item in ox_inventory (and qs-inventory)

An item in a FiveM inventory is not magic. It is one row in a Lua table that you edit by hand. Get the shape right and the inventory draws an icon, shows a tooltip, plays an animation on use, and lets you hand it out with the built-in give command. Get the shape wrong and the slot is blank, the item does not stack, or the inventory rejects it with invalid_item. By the end you will have a working water item in ox_inventory, you will give it to yourself from the server console with /giveitem, and you will be able to read the qs-inventory version and name every difference.

You'll build
A real `water` item in ox_inventory: the items.lua entry, the PNG icon, a restart to load it, and giving it to a player with the built-in /giveitem command. Then the same item the qs-inventory way, side by side.
Time
~20 minutes
You need
A local server already running ox_inventory (with ox_lib and oxmysql ensured before it), a text editor, and one PNG you can rename. If you have not installed an inventory yet, do that first, then come back.
You'll learn
The ox_inventory items.lua entry shape field by field -> where the icon file goes -> how to load a new item -> how to give it with the built-in /giveitem command -> and how the qs-inventory shape differs
BEFORE YOU START

Two inventories, one idea

Before you touch a file, fix one thing in your head. ox_inventory and qs-inventory are different resources made by different people, and they store items in different files with different field names. But the idea is identical in both: an item is a key in a Lua table, and the value is a config table that describes the item.

  • ox_inventory is Overextended's free, open-source, slot-based inventory. Items live in data/items.lua. You can read its source on GitHub.
  • qs-inventory is Quasar Store's paid, encrypted inventory (it supports ESX, QBCore, and Qbox). Where its items live depends on your framework: on QBCore it reads qb-core/shared/items.lua (you edit qb-core's item list, not a file inside qs-inventory), while on standalone or ESX it uses qs-inventory's own items file. Either way the shape is QBCore-style. There is no public source to read, only the docs.

This lesson builds the item in ox_inventory first because it is free and open, so you can verify every claim against the real source. Then it maps the same item onto qs-inventory.

Where each inventory's items live

Three common inventories, three different homes for the item list. Note that qs-inventory does not always own its own file; on QBCore it borrows qb-core's.

InventoryItems fileItem fields / keyIcon folder
ox_inventoryox_inventory/data/items.luakey = item nameox_inventory/web/images/<name>.png (filename = item name)
qb-inventoryqb-core/shared/items.luaname / label / weight / type / image / unique / useable / descriptionqb-inventory/html/images/
qs-inventoryqb-core/shared/items.lua on QBCore; qs-inventory's own items file on standalone/ESXQBCore-style flat fields (name / label / weight / type / image / unique / useable)qs-inventory/html/images/
ox_inventory always owns its file. qb-inventory reads qb-core's shared items. qs-inventory reads qb-core's shared items on QBCore, but uses its own file on standalone or ESX.

Give an item without code

Once an item exists in the items file, you do not need to write a script just to hand one out. Every major inventory ships a built-in admin command:

code
/giveitem [id] [item] [count]

Run it from the server console or in game as an admin. [id] is the target player's server id, [item] is the item key, and [count] is how many. Most inventories also expose an in-game admin menu that gives items by clicking. This built-in command is ACE-gated, so grant it to your admin group before an in-game admin can use it, for example add_ace group.admin command.giveitem allow.

That built-in command (or the admin menu) is the owner path: no code, just an item that already exists. Writing your own command resource is the developer path. You only need the developer path when you want custom logic (a capacity pre-check, a cost, a cooldown) around handing out the item. To simply give an item, reach for /giveitem first.

Keep reading the full lesson

Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.

Still ahead in this lesson
  • Build it in ox_inventory
  • How it works
  • The qs-inventory equivalent
  • Common mistakes
  • What you can do now
  • Try it yourself

The remainder of Creating items for ox and qs inventory is available to FiveM School members.