01
Before installing: frameworks and dependencies
ox_inventory replaces your framework's inventory, items and weapons: weapons become items, ESX "loadouts" no longer exist, and every action (moving, buying, giving) is checked by the server. Supported frameworks, according to the official README:
- ESX Legacy, version 1.6.0 or later;
- Qbox, which uses it as its inventory: its official txAdmin recipe installs it by default;
- ox_core and ND Core.
QBCore is not on the list. It keeps its own inventory (qb-inventory), and the ox_inventory documentation recommends Qbox instead. For an unsupported framework, you have to write the link (the "bridge") between the two yourself: this is developer work, with no official help. Choosing a framework is covered in ESX, QBCore or Qbox.
Dependencies:
- oxmysql, for the database (see oxmysql);
- ox_lib, Overextended's library;
- ox_target, optional, to open shops and stashes by aiming at an object or a character;
- OneSync and a recent server version: the ox_inventory manifest requires them and refuses to start without them (see OneSync and FiveM artifacts).
ox_inventory also checks the oxmysql and ox_lib versions: a version that is too old blocks startup with a clear message. Update all three together.
02
Install and start in the right order
- Download
ox_inventory.zip from the "Releases" page of the overextended/ox_inventory GitHub repository. Do not take the source code (the "Code" button or the "Source code" archives): the interface is not built in it, and the server shows "UI has not been built".
- Unpack the archive into
resources: the folder must be named ox_inventory and contain the fxmanifest.lua directly.
- Add the settings and start lines to
server.cfg, in this order, then restart the server.
setr inventory:framework "esx" # "qbx" for Qbox
setr inventory:slots 50
setr inventory:weight 30000 # in grams
setr inventory:target false # true with ox_target
ensure oxmysql
ensure ox_lib
ensure es_extended # qbx_core for Qbox
ensure ox_target # optional
ensure ox_inventory
The setr inventory:… settings go before the ensure lines. ox_inventory starts right after the framework and before any script that uses its functions (shops, jobs, phone): otherwise those scripts show "No such export". How the file works is explained in FiveM's server.cfg.
No SQL file to import: on first start, ox_inventory creates its ox_inventory table and adds the columns it needs to the player and vehicle tables.
Other useful settings: inventory:keys sets the keys (F2, K and TAB by default, for the inventory, the secondary inventory and the hotbar); inventory:police lists the jobs with access to the armoury and evidence lockers. The framework can override a player's maximum weight. The full list of settings is in the official ox_inventory documentation.
03
Items, shops, stashes and images
Content is set in the resource's data folder:
items.lua: the item list. The key is the item's technical name, the one scripts use; label is the displayed name, weight the weight in grams;
shops.lua: shops (name, map icon, items and prices, locations, allowed jobs);
stashes.lua: fixed stashes, such as police lockers (slots, weight, jobs, personal or shared stash);
- as well as
weapons.lua (weapons, ammo, attachments), crafting.lua (crafting), vehicles.lua (glovebox and trunk slots and weight by vehicle class), licenses.lua and evidence.lua.
['sandwich'] = {
label = 'Sandwich',
weight = 200,
stack = true,
close = true,
description = 'A ham and butter sandwich',
},
With ESX, usable items keep working with ESX.RegisterUsableItem; with Qbox, with exports.qbx_core:CreateUseableItem. Stashes created by other scripts (houses, businesses) go through ox_inventory's RegisterStash function.
Images. By default each item shows the image web/images/<name>.png, where <name> is its technical name: for sandwich, web/images/sandwich.png. You can also pick an item's image with client = { image = 'file.png' }, and the inventory:imagepath setting changes the folder or address they are loaded from. Keep the PNG files light, and restart the server to load them.
Many scripts provide their item list in ox_inventory format: copy it into items.lua and their images into web/images (see installing a FiveM script).
04
Migrating from another inventory
Switching to ox_inventory changes the database. Do it outside playing hours, in this order:
- Back up the database (full export with
mysqldump or phpMyAdmin) and the resources folder. If you can, try it on a copy of the server first.
- Remove incompatible resources. For ESX, the documentation lists the standard shops and stashes (
esx_shops, esx_weaponshop, the esx_policejob stashes) and resources that change or display the ESX inventory (esx_trunkinventory, esx_inventoryhud). Remove the old inventory too.
- Convert the data (ESX). Start the server, then type in the server console, not in game:
convertinventory esx
convertinventory esxproperty
The second line, optional, carries over property stashes. Wait for the completion message, then restart the server: the documentation insists on this restart after items are migrated.
From QBCore, the current version of ox_inventory provides no conversion: the command only accepts esx and esxproperty. Moving from QBCore to Qbox is a separate project, to prepare with the Qbox documentation and a backup.
Finally, check your other scripts. With ESX, those that read the inventory through the old functions (such as xPlayer.getInventoryItem) still work, but the documentation considers them deprecated and recommends ox_inventory's functions.
05
Common errors
- "UI has not been built": the source code is installed. Replace the folder with the one from
ox_inventory.zip, keeping your data files and images.
- "No such export" in ox_inventory: ox_inventory or one of its dependencies (often ox_lib) failed to start, or the script calling it starts before it. Read the first errors in the console and check the
ensure order.
- "ox_inventory requires the ox_lib resource": ox_lib is missing or starts after ox_inventory.
- An item cannot be found in game: it is not declared in
items.lua, or its name differs from the one the script uses. Restart the server after adding items.
- A missing image: the file does not have exactly the item's name, or is not a
.png.
- Empty stashes after a restart: inventories are saved every 5 minutes, and a hard stop saves nothing. txAdmin scheduled restarts save before shutting down, the
saveinv command saves everything on demand, and everything is saved when the last player disconnects.
- Stashes disappearing on their own: by default, stashes unchanged for six months are deleted at startup (
inventory:clearstashes "6 MONTH"). To keep them, write set inventory:clearstashes "".
For testing, /additem followed by the player's number, the item name and a quantity gives an item; the command is restricted to group.admin. Other messages are explained in FiveM server errors, and scheduled restarts in txAdmin.
06
On CloudFive
On our FiveM hosting plans, from €2.50 per month:
- ESX, QBCore or Qbox in one click, with MariaDB databases for oxmysql;
- backups from the customer area manager.cloudfive.fr, to take before any inventory migration;
- files (
items.lua, images, server.cfg) are edited from the customer area or over SFTP;
- txAdmin included, with the console to type
convertinventory or saveinv and scheduled restarts that save inventories;
- the artifacts version installed and the available versions are shown, with a button to roll back to the previous one (a backup is made first).
The server is ready in about 30 seconds, in France, on AMD Ryzen 9 9950X with DDR5 memory and NVMe storage, on our own network (AS218808), with Anti-DDoS Premium included and a FiveM-specific profile. A shared Patreon key is provided at no extra cost, limited to 48 players. Monthly, no commitment, with French-speaking support 7 days a week by ticket, on Discord and by phone.
07
Frequently asked questions
What are the dependencies of ox_inventory?
oxmysql and ox_lib are required, and OneSync must be enabled. ox_target is optional: it lets players open shops and stashes by aiming. Start oxmysql, ox_lib, the framework, ox_target, then ox_inventory, in that order.
Does ox_inventory work with QBCore?
QBCore is not one of the frameworks supported by ox_inventory, which lists ESX Legacy, Qbox, ox_core and ND Core. Its documentation recommends Qbox, a QBCore offshoot that already uses ox_inventory. Otherwise, you have to write the link between the two yourself, with no official help.
Why does ox_inventory show "UI has not been built"?
Because the source code was downloaded instead of the built release. Download ox_inventory.zip from the Releases page of the GitHub repository, replace the folder while keeping your data files and images, then restart the server.
Where do I add an item in ox_inventory?
In the resource's data/items.lua file: the technical name as the key, then label, weight in grams and the other options. Its image goes in web/images, as a .png with the same name. Then restart the server.
How do I switch an ESX server to ox_inventory?
Back up the database, remove the old inventory and incompatible resources such as esx_shops, then start the server and type convertinventory esx in the server console. Restart once the conversion is finished, and test your scripts before opening to players.