Koja Scripts

Troubleshooting

Fixes for common koja-inventory-v2 problems: no access, missing items or images, ox scripts not working, clothing sync, trunk props, crafting and durability.

Troubleshooting

The resource does not start or the inventory is empty
  • oxmysql and koja-lib must be started before koja-inventory-v2.
  • Only one inventory can run. Make sure the real ox_inventory (or another inventory) is not started. The ox bridge is fine.
  • Read the startup banner: Database unreachable means oxmysql cannot connect.
New files or commands do not exist after an update

After an update that adds files, run refresh and then ensure koja-inventory-v2 (or restart the server). A plain ensure does not load new files listed in the manifest.

No access to /invadmin or admin commands

Add the ACE command.koja-inventory-v2 to your group in server.cfg, or give the player a group listed in Config.AdminGroups. The old ACE command.koja_grid_inventory from earlier builds no longer works.

Scripts using exports.ox_inventory fail
  • Config.Ox.enabled and Config.Ox.exports must be true.
  • Resources with dependency 'ox_inventory' need the bridge: see Migrating from ox_inventory.
  • Scripts that call exports.koja_grid_inventory must change to exports['koja-inventory-v2'].
Items have no picture

Check Config.ImagePath. With the default images/, the file must be web/build/images/<item>.png. Items without an image show a category icon.

An imported ox item has the wrong size

Sizes of imported items are guessed from weight and weapon type. Define the item in shared/items.lua with the size you want; it wins over the import.

Clothes from another script disappear or come back
  • Clothes are synced only after they stay on the character for Config.Clothing.watch.settle ms and while no menu has focus.
  • Nothing syncs in vehicles, while ragdolled or falling, and for grace ms after.
  • To sync right after your script changes clothes, call exports['koja-inventory-v2']:SyncClothing() on the client.
  • To ignore other scripts completely, turn off Read clothes from other scripts in Settings → Clothing.
Backpack or vest looks wrong on the character

The look comes from the item's ped field. Set drawables that exist on your server, or turn off Show backpack and vest in Settings → Clothing.

Trunk props show up in the cabin

Stand at the trunk of that model and run /trunkarea. Move the box onto the trunk floor and press Enter to save it for the model.

Crafting does nothing
  • Check every ingredient chip is white, not red. Ingredient aliases (Config.Crafting.aliases) let ox items like scrapmetal count.
  • Tools must not be broken.
  • Stay within a few metres of the bench until the progress bar ends; walking away cancels it.
There is no Repair option

Repair shows for weapons and tools tracked by durability. It is greyed out when the item is at 100% or you carry no fitting repair item (for weapons: weapon_kit or repairkit). Repair items are set in Config.Durability.repairs.

Settings, admin locations or runtime items are gone

They are stored in resource KVP, which belongs to the resource name. If the folder was renamed (for example from koja_grid_inventory), they start empty. Inventories in the database are not affected.