Koja Scripts

Installation

Requirements, folder name, server.cfg start order, convars, admin access and upgrading from stock ox_inventory.

Installation

This page takes you from the downloaded zip to a running inventory. If you already run ox_inventory, you replace it — players keep their items, stashes and vehicle inventories.

Requirements

ResourceRequiredWhat it is used for
FiveM server build 6116+ with OneSyncYesSame as ox_inventory
ox_lib 3.36.4+YesCallbacks, keybinds, notifications, locales
oxmysql 2.7.3+YesInventories and the koja_inv_* tables
A frameworkYesESX, Qbox, ox_core or ND — chosen with the inventory:framework convar
ox_targetNoTarget zones for shops, stashes, crafting benches, dumpsters and trunks
illenium-appearance or Koja AppearanceNoReal clothing thumbnails and saving the appearance after a clothing change

Install

  1. Put the resource in resources

    Unpack the release zip. It contains one folder, ox_inventory, with the UI already built in web/build.
    resources/
    └── [ox]/
        └── ox_inventory/
    Keep the folder name ox_inventory. Other scripts call exports.ox_inventory, so a different name breaks them.
  2. Add it to server.cfg

    Start it after its dependencies and your framework, and before the scripts that use it:
    server.cfg
    ensure oxmysql
    ensure ox_lib
    ensure es_extended            # or qbx_core / ox_core / ND_Core
    ensure ox_target              # optional, must start before ox_inventory
    ensure illenium-appearance    # optional, clothing images
    ensure ox_inventory
    
    setr inventory:framework "esx"   # esx / qbx / ox / nd
    setr inventory:slots 35          # 5 pockets + 20 base slots + 10 backpack slots
  3. Give admins access

    The admin panel opens for every player with the ace in admin.superAce (default group.admin) and for staff added in data/koja/staff.lua or the Permissions page.
    server.cfg
    add_principal identifier.license:YOUR_LICENSE group.admin
    add_ace group.admin group.admin allow
    The second line makes sure the group.admin ace check passes for members of the group. See Admin panel for roles and per-page access.
  4. Pick the language

    The language comes from ox_lib:
    server.cfg
    setr ox:locale "en"
    English and Polish ship with every string. See Translations.
  5. Restart the server

    The koja_inv_* tables are created when the resource starts (see Database). There is no SQL file to import.

Convars

All upstream convars still work. Set them in server.cfg with setr (client side ones must be replicated, so always use setr).

ConvarDefaultWhat it does
inventory:framework"esx"Framework bridge: esx, qbx, ox or nd
inventory:slots35Player slots. Koja splits them into pockets, base slots and backpack slots (see below)
inventory:weight30000Player max weight in grams, before backpacks
inventory:targetfalseUse ox_target for shops, stashes, crafting benches and evidence instead of markers. ox_target must start first
inventory:keys["F2", "K", "TAB"]Default keys: open inventory, open the other inventory (trunk, dumpster...), hotbar
inventory:police["police", "sheriff"]Jobs that can use evidence lockers and search players
inventory:networkdumpstersfalseNetworked dumpster ids (same contents for everyone)
inventory:dropslots / inventory:dropweightplayer valuesSize of ground drops
inventory:randomloottrueLoot in dumpsters and unowned vehicles. The loot tables are edited in the admin panel
inventory:screenblurtrueBlur the game behind the inventory
inventory:itemnotifytrueItem added / removed popups
inventory:imagepathnui://ox_inventory/web/imagesWhere item images are loaded from
inventory:enablestealcommandtrueRegisters /steal
inventory:loglevel, inventory:loghookrejection, inventory:trimplate, inventory:evidencegrade, inventory:validhostsupstreamAlso editable live on the admin Security page

The other upstream convars (inventory:dropprops, inventory:weaponmismatch, inventory:autoreload, inventory:giveplayerlist, inventory:vehicleloot, inventory:dumpsterloot...) keep their ox_inventory meaning.

Slot layout

With inventory:slots 35 and the default baseSlots = 25, pockets = 5 in data/koja/core.lua:

SlotsMeaning
1–5Pockets — the hotbar, used with keys 1–5
6–25Always unlocked
26–35Locked ("Need a backpack") until a backpack is worn

inventory:slots is the hard maximum. A backpack never unlocks more than that.

Coming from ox_inventory

Nothing in the database has to change: the ox_inventory table, player inventories, stashes, trunks and gloveboxes are read as before. Keep your data/items.lua, data/shops.lua, data/stashes.lua and data/crafting.lua — the format is the same, Koja only adds optional fields.

  1. Back up first

    Back up the database and your old data/*.lua files.
  2. Merge your data files

    Copy your items, shops, stashes and crafting benches into the new data/ files. Add the Koja items you want to keep from the shipped data/items.lua: clothing, clothing_hanger, backpack_small, backpack_large, armor_vest, plate_light, plate_medium, plate_heavy, tint_1 … tint_7 (see Items).
  3. Check inventory:slots

    ox_inventory defaults to 50 slots, Koja to 35. If you keep a higher value, only baseSlots (25) are always unlocked; the rest need a backpack. Raise baseSlots in data/koja/core.lua if your players should keep more free slots.
  4. Start and test

    Join, open the inventory with F2, and open /invadmin as an admin.

Check that it works

  1. Press F2. The inventory opens with your ped in the middle and the Inventory, Clothing, Settings and Useful controls tabs at the top.
  2. Your worn clothes appear in Your clothes as items (with images when an appearance resource is running).
  3. As an admin, type /invadmin. The admin panel opens on the Home page.

Next steps

  • Configuration — slots, clothing, weight, throwing, give, trade, shops and the admin defaults.
  • Admin panel — roles, staff and live editing.
  • Troubleshooting — if something above did not happen.