Requirements#
| Framework | qbx_core, qb-core or es_extended. Used to make crates usable items. |
| Resources | ox_inventory and ox_lib. Both are listed as dependencies in the manifest. |
| Server | FiveM server with OneSync and Lua 5.4 (lua54 'yes'). Tested with qbx_core 1.24.0 and ox_inventory 2.48.0. |
| Database | None. Pending loot is kept in the resource KVP store. |
| Optional | glitch-crafting for blueprint and unlock rewards, glitch-abstraction as an inventory and usable-item fallback, glitch-criminaltablet for the pawn check, glitch-cardAlbums to read pack odds. All are detected at run time. |
Installation steps#
Put the folder in your resources directory. The folder name must be exactly
glitch-lootBox. It is case-sensitive.Open
install/items.luaand paste the entries you need intoox_inventory/data/items.lua(drop thereturn {and the closing}). Restart ox_inventory. The default pack needscache_alley,cache_streetandcache_deposit. Do not give a crate aclient.exportorserver.export, because crates are used through your framework.Open
config/crates.lua. It ships three crates that only hand out stock ox_inventory items (water, burger, bandage, lockpick, radio, armour, phone and cash). Edit or replace them.Add the resource to
server.cfg, after your framework and ox_inventory:ensure ox_lib ensure qbx_core ensure ox_inventory ensure glitch-lootBoxRestart the server and check the console. The resource prints one warning for every crate item or reward item that ox_inventory does not know.
There is no SQL to import and no permission to grant. The resource has no commands.
Item images#
Item images come from ox_inventory (the inventory:imagepath convar, or nui://ox_inventory/web/images/). If your crate or reward images are blank, see Troubleshooting.
The demo pack#
config/crates.demo.lua holds the larger set the Glitch Studios demo server runs: munitions crates, vault caches, blueprint cases, card packs, a blind box and a sneaker box. Their rewards use items from that server, so load the pack only after your inventory has them. Set config.server.cratePack = 'demo' to load it, or copy single crates into config/crates.lua.
Updating#
Back up config/ before replacing files. Replace everything else, merge any new keys into your config files, restart ox_inventory if you changed items, then restart glitch-lootBox. Pending loot sits in KVP and is not touched by an update.