Installation
Requirements, replacing ox_lib, ox_inventory and ox_target with nx_hud, moving your inventory data and item images, and first-start checks.
This page covers what nx_hud needs beyond the
generic installation guide.
Because nx_hud takes the place of ox_lib, ox_inventory and ox_target,
installing it means removing those three. Read the whole page before you
start.
Requirements
- FXServer artifact 7290 or newer, with OneSync on.
- For the inventory: ESX or Qbox. The HUD, the ox_lib layer and targeting also work on QBCore or with no framework.
Database access for the inventory. It uses ox_inventory's own tables, so an existing server keeps its data.
Needed for the inventory, which attaches to one of them. The HUD reads hunger, thirst, stress and money from ESX, QBCore or Qbox.
Optional. A service light in the vehicle HUD when the car is due for a service or has a failed part. Nothing to set up.
ox_lib, ox_inventory, ox_target, qtarget and qb-target come off the server. The steps below show how.
What it replaces
| Resource | What nx_hud answers as |
|---|---|
ox_lib | ox_lib 3.36.4 |
ox_inventory | ox_inventory 2.48 |
ox_target | ox_target 1.18.1 |
qtarget | the same API as ox_target |
qb-target | qb-target 5.5.0 |
Scripts that use @ox_lib/init.lua, exports.ox_inventory,
exports.ox_target, exports.qtarget or exports['qb-target'], or list
those resources as a dependency, find nx_hud in their place. The APIs
are documented by Overextended:
ox_lib,
ox_inventory and
ox_target.
Install
- Back up your database: the
ox_inventorytable and your framework's player and vehicle tables. - Put the
nx_hudfolder in yourresourcesfolder. - In your server config, put
ensure nx_hudwhereensure ox_libwas, before your framework. Delete theensure ox_lib,ensure ox_inventory,ensure ox_target,ensure qtargetandensure qb-targetlines. - Move the
ox_lib,ox_target,qtargetandqb-targetfolders out ofresources, including copies inside[category]folders. Leave theox_inventoryfolder where it is for now: the next steps read your data from it. - If your config grants ACE permissions to
resource.ox_lib, grant the same ones toresource.nx_hud. - Restart the whole server, with nobody connected. The console says the
inventory is off because a folder named
ox_inventoryis still installed. That is expected at this step. - In the server console, run
nxinv migrate check from=<full path to your ox_inventory folder>. It should end withPREFLIGHT: GO. - Run
nxinv migrate apply from=<the same path>. It copies your items, shops, stashes, crafting and other data intonx_hud/data/, and the images your items use intonx_hud/web/images/. It should end withvalidated. - Move the
ox_inventoryfolder out ofresourcesand keep it as a backup. Yourinventory:*convars keep working. - Restart the whole server.
# server.cfg: the start of the list
ensure oxmysql
ensure nx_hud # where ensure ox_lib was
# your framework core (es_extended or qbx_core) and the rest go hereFor step 5: Qbox's permissions.cfg usually grants these four to
resource.ox_lib. Grant them to nx_hud instead:
add_ace resource.nx_hud command.add_ace allow
add_ace resource.nx_hud command.remove_ace allow
add_ace resource.nx_hud command.add_principal allow
add_ace resource.nx_hud command.remove_principal allowAlways restart the whole server after changing nx_hud. Never run
restart nx_hud with players online: every script that depends on
ox_lib stops with it. Never start ox_lib, ox_inventory, ox_target,
qtarget or qb-target next to it.
A server that never ran ox_inventory
Skip steps 7 to 9. data/ ships with a starter set: a few items and
weapons, four shops (a corner store, Ammu-Nation, a police armoury and a
vending machine), one crafting bench and a weapon licence. Replace them
with your own (see
Customization).
Item images
web/images/ ships empty. nxinv migrate apply fills it with the images
your items use. To add one yourself, put a PNG named after the item in
nx_hud/web/images/, for example water.png.
nx_hud points the inventory:imagepath convar at its own image folder,
so scripts that build image links from that convar find the pictures.
The migrate tool copies only the images your items reference, so the
resource stays under the number of files a client can download on
connect. NxInventory.fileBudget sets that limit, and the all and
force options of nxinv migrate apply override it. See
Commands.
Targeting
- Scripts written for ox_target, qtarget or qb-target need no changes.
The target key is Left Alt, as in ox_target, and the
ox_target:*convars still work. - If a folder named ox_target, qtarget or qb-target is still in
resources,nx_hudturns targeting off and says so in the console. The same happens when another resource declaresprovidefor one of those names. Move the folder out and restart the server. - Settings are in
config/target.lua, including whether idle target dots show (dots.enabled). Each player picks only the look in F7: Tether (the default) or Bloom.
First configuration
Check these before the first start:
config/hud.lua:Config.framework,Config.fuelandConfig.seatbeltdetect your scripts on'auto'. Name one if detection picks the wrong script.config/compat.lua:radialKeyis G by default.config/settings.lua: the F7 settings every player starts with, such as km/h instead of mph or a lighter glass. Players can still change their own.inventory:framework:nx_hudsets it when it is empty, from the framework it finds (qbx_core, thenes_extended). Set it yourself inserver.cfgif you run both.
Everything under config/, data/ and the locale folders is plain text
in the release. See Customization for
the full list of files you can edit.
Troubleshooting
| Symptom | Check |
|---|---|
| The inventory does not open, and the console says it is off | nxinv status in the server console. A folder named ox_inventory in resources, or another resource that provides ox_inventory, keeps the inventory off. |
| Money or items do not follow the framework | nxinv bridge shows the selected framework bridge and whether it is attached. |
| Targeting does nothing | nxtarget status in the server console. A leftover ox_target, qtarget or qb-target folder turns it off. |
| Hunger, thirst, fuel or the seatbelt read wrong | /hud bridge in F8 prints which framework, fuel and seatbelt adapters answer. |
| Item pictures are missing | Check that nx_hud/web/images/ has a file named after the item. |
Credits
The target menu icons are from Font Awesome Free 6.7.2 by Fonticons, Inc. (fontawesome.com), licensed under CC BY 4.0.
HUD
A Liquid Glass HUD with an island, ring gauges, vehicle clusters and a windscreen HUD. It also takes the place of ox_lib, ox_inventory and ox_target. The HUD runs on ESX, QBCore, QBox and standalone; the inventory needs ESX or QBox.
Configuration
Every option in config/hud.lua, config/compat.lua, config/inventory.lua, config/target.lua and config/settings.lua for nx_hud, plus the ox convars it reads.