Skip to main content
Home
Shop
Free Mods
Tools
Bundles
Full Servers
  1. Home
  2. Blog
  3. Scripts & Resources

Inventory & Weight Tuning: From items.lua to Metadata

Published on August 18, 2025·by Lars Miller(Founder & Lead Editor)·Credentials·7 min read·Updated on March 24, 2026
Scripts & Resourcesinventory weight tuning from items.lua to

A stable RP economy depends on scarcity, friction, and meaningful choices. Inventory rules (slots, weight, stack limits, metadata like durability/serials) are the levers that make…

Inventory & Weight Tuning: From items.lua to Metadata
Inventory & Weight Tuning: From items.lua to Metadata

Introduction to TL;DR : This guide gives you production‑ready

ReShade and NaturalVision Graphics Enhancement for FiveM

TL;DR: This guide gives you production‑ready weight/slot presets, item budget tables, copy‑pasteable items.lua definitions (ESX/QBCore/ox_inventory), and safe migration playbooks between popular inventories. Use it to eliminate over‑encumbrance drama, stop item bloat, and keep your economy coherent.

This guide is part of our comprehensive FiveM scripts resource, where you'll find all our script recommendations, framework comparisons, and buying guides.


Why inventory tuning matters

A stable RP economy depends on scarcity, friction, and meaningful choices. Inventory rules (slots, weight, stack limits, metadata like durability/serials) are the levers that make those choices real. If everyone can carry everything, prices collapse and loops break. Tune inventory first, then iterate your prices, payouts, and sinks. For broader economics, see our pillar: Designing a Balanced GTA RP Economy: Prices, Sinks, Progression.


Models: Slots vs. Weight vs. Hybrid

Slots-only

  • Simple cognitive model; each item = 1 slot or defined by size classes.
  • Weak at differentiating heavy vs. light stacks; exploits via many tiny high-value items.

Weight-only

  • Each item has a weight (usually grams). Players have maxWeight per container. Strong realism; needs thoughtful defaults.

Hybrid (recommended)

  • Global weight cap and slot cap. Prevents both micro‑item and mega‑item exploits. Works best for RP.

Tip: Keep numbers human‑readable. If you model in grams, use whole numbers (e.g., water = 500g) and round player caps (e.g., maxWeight = 120,000).


Default Presets (copy & adapt)

Below are battle‑tested starting points. Adjust ±10–20% after a week of in‑city telemetry.

Player Inventory (on‑person)

Server ScaleModelMax Weight (g)Slots
NotesNew/Small (≤40 pop)Hybrid80,000
30Faster onboarding; fewer early pain points.Mid (40–150)Hybrid
120,00035Balanced for general RP; good for diverse jobs.High‑Pop (150+)
Hybrid150,00032Tighten slots to curb hoarding; keep weight fair.

Vehicles (common defaults)

ContainerMax Weight (g)SlotsRationale
Glovebox10,0005Small stash, encourages planning.
Sedans Trunk80,00020Baseline.
SUV/Van Trunk120,00025Utility vehicles become meaningful.
Truck (utility)180,00028Logistics gameplay.
Motorcycle Storage8,0003Minimal pocketing.

Stashes & Special Containers

TypeMax Weight (g)SlotsNotes
House Stash (Tier 1/2/3)120k / 180k / 240k40 / 60 / 80Incentivizes housing upgrades.
Job Locker80,00020Prevent carryover exploits.
Evidence Locker240,000120Admin/LEO convenience; audit logging required.

Item Weight Budgets (by class)

Use this to assign consistent weights

Use this to assign consistent weights. Think relative friction not realism.

ClassExamples
Suggested Weight (g)Very Light
Lockpick blade, USB, SIM5–50
LightPistol ammo (10), bandage, snack
100–250Medium
Water bottle, burger, repair kit400–800
HeavyRifle ammo box (30), oxy tank, material crate
1,500–4,000Very Heavy
Weapon crate, money bag (marked)6,000–12,000

Ammo: Budget per unit for pooled stacks (e.g., 9mm = 15g each → 30 rounds ≈ 450g) or represent as boxes (e.g., 9mm box (30) = 500g).


Stack Sizes & Slot Strategy

  • Commodities (food, meds): stack 5–20 to reduce tedium.
  • Ammo: stack 30–60 for pistols; 60–120 for rifles when boxed.
  • Crafting Mats: stack 100–250; keep weight meaningful.
  • Weapons: stack = 1, unique metadata (serial, durability).

Metadata Patterns (durability, serials, attachments, quality)

Design metadata like a small schema. Keep fields minimal, typed, and validated.

Canonical Metadata Schema (recommendation)

{
  serial = "string",          -- weapon unique id
  owner = "citizenid|identifier",
  durability = 0.0,            -- 0.0–1.0; decay per use/time
  quality = 100,               -- 0–100; repairable threshold 25
  ammo = 0,                    -- integer; weapon mags
  tint = 0,                    -- integer (game tint index)
  attachments = {"flashlight", "scope"},
  expiry = 0,                  -- unix timestamp; perishable items
  notes = ""                   -- small text; avoid bloat
}

Durability & Decay

  • Weapons: decay 0.5–1.5% per magazine; jam chance under 5% below 20% quality.
  • Tools (lockpicks, drill): consume % on use; break at 0.
  • Perishables: expiry check at use; stale penalty or block.

Security & Performance

  • Validate metadata server‑side; never trust client writes.
  • Cap metadata size (e.g., under 512 bytes). Large blobs hurt save/load and network payloads.
  • Use enumerations for attachments and tints.

Code: items.lua / item definitions by framework

ESX (es_extended) example

-- esx items.lua (example) — weight in grams; negative weight means not counted in legacy modes
['water'] = { label = 'Water Bottle', weight = 500, stack = true, close = true, description = 'Stay hydrated.' },
['bandage'] = { label = 'Bandage', weight = 150, stack = true, close = true },
['lockpick'] = { label = 'Lockpick', weight = 50, stack = true, close = true },
['pistol_ammo'] = { label = 'Pistol Ammo (30)', weight = 450, stack = true, close = true, description = '9mm, box of 30.' },
['weapon_pistol'] = { label = 'Pistol', weight = 1500, stack = false, close = true, degrade = 0.01, unique = true },

For ESX variants that still use limit instead of

For ESX variants that still use limit instead of weight, set limit = -1 (unlimited) and switch economy balance via weight globally.

QBCore (shared/items.lua) example

-- qb-core shared/items.lua
['water'] = { name = 'water', label = 'Water Bottle', weight = 500, type = 'item', image = 'water.png', unique = false, useable = true, shouldClose = true, description = 'Stay hydrated.',
  combinable = nil },
['bandage'] = { name = 'bandage', label = 'Bandage', weight = 150, type = 'item', image = 'bandage.png', unique = false, useable = true, shouldClose = true },
['lockpick'] = { name = 'lockpick', label = 'Lockpick', weight = 50, type = 'item', image = 'lockpick.png', unique = false, useable = true, shouldClose = true },
['pistol_ammo'] = { name = 'pistol_ammo', label = 'Pistol Ammo (30)', weight = 450, type = 'item', image = 'pistol_ammo.png', unique = false, useable = true, shouldClose = true },
['weapon_pistol'] = { name = 'weapon_pistol', label = 'Pistol', weight = 1500, type = 'weapon', image = 'weapon_pistol.png', unique = true, useable = false, shouldClose = true,
  info = { serial = '', durability = 1.0, ammo = 12, attachments = {} } },

ox_inventory (data/items.lua) example

return {
  water = {
    label = 'Water Bottle',
    weight = 500,
    stack = true,
    client = { status = { thirst = 25000 }, anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' } },
  },
  bandage = { label = 'Bandage', weight = 150, stack = true },
  lockpick = { label = 'Lockpick', weight = 50, stack = true },
  pistol_ammo = { label = 'Pistol Ammo (30)', weight = 450, stack = true },
  weapon_pistol = {
    label = 'Pistol', weight = 1500, stack = false, allowArmed = true,
    consume = 0, -- handled by durability system
    ammo = { type = 'AMMO_PISTOL', count = 12 },
    metadata = { serial = true, durability = true, attachments = true },
  },
}

ox_inventory supports rich client/server behaviors

ox_inventory supports rich client/server behaviors in item definitions—prefer built‑ins over ad‑hoc scripts to standardize behavior.


Hybrid Enforcement Examples

QBCore container config (example)

-- qb-inventory/server/config.lua (illustrative)
Config.PlayerMaxWeight = 120000
Config.PlayerMaxSlots = 35
Config.Vehicle = {
  glovebox = { weight = 10000, slots = 5 },
  trunk = function(class)
    if class == 'sedan' then return 80000, 20 end
    if class == 'suv' or class == 'van' then return 120000, 25 end
    if class == 'truck' then return 180000, 28 end
    return 60000, 18
  end
}

ox_inventory stash setup (example)

-- ox_inventory/server/custom/stashes.lua
lib.addstash('house_tier1', 40, 120000)
lib.addstash('house_tier2', 60, 180000)
lib.addstash('house_tier3', 80, 240000)

Migration Playbooks (safe & reversible)

Principles

  1. Snapshot DB first. 2) Migrate items/metadata with idempotent scripts. 3) Run side‑by‑side in a staging server. 4) Provide rollback SQL.

    A) qb-inventory → ox_inventory

    Map fields

    • QB items.lua → ox data/items.lua (name, label, weight, stack/unique, client/server behaviors).
    • player inventory table: convert info JSON → metadata (serial, durability, ammo).

    Pseudocode (Lua/SQL mix)

    -- 1) Export QB items to a Lua table/JSON -- 2) Generate ox items.lua entries -- 3) Transform inventories for item in qb_inventory_rows do local meta = json.decode(item.info or '{}') local metadata = { > serial = meta.serial, durability = meta.durability or 1.0, ammo = meta.ammo or 0, attachments = meta.attachments or {}, } insert_into_ox_inventory(item.name, item.amount, metadata) end

    SQL example (PostgreSQL/MySQL style)

    -- Backup CREATE TABLE backup_playeritems AS SELECT * FROM playeritems;

    -- Transform example for a single item family UPDATE playeritems SET metadata = JSON_OBJECT( 'serial', JSON_EXTRACT(info, '$.serial'), 'durability', COALESCE(JSON_EXTRACT(info, '$.durability'), 1.0), 'ammo', COALESCE(JSON_EXTRACT(info, '$.ammo'), 0), 'attachments', COALESCE(JSON_EXTRACT(info, '$.attachments'), JSON_ARRAY()) ) WHERE name IN ('weapon_pistol','weapon_pistol_mk2');

    Gotchas Unique items : enforce stack = false ;

    Gotchas

    • Unique items: enforce stack = false; ensure duplicates don’t merge.
    • Ammo systems: reconcile boxed vs. loose ammo conventions.
    • Images/icons: re‑path item images to match ox’s naming.

    B) ESX (limit‑based) → weight model

    1. Set global useWeight = true in config (varies by fork).
    2. Replace per‑item limit with weight (g). For items formerly limit = -1, assign realistic weights.
    3. Migrate stash/vehicle caps accordingly.

    Scripted pass

    for name, item in pairs(Items) do if item.limit and not item.weight then item.weight = estimateWeightFromClass(name) item.limit = nil end end

    C) qs-inventory / lj-inventory → QBCore/ox

    • Field mapping is similar to QB: info → metadata.
    • Watch for custom keys (quality, image, createdAt). Normalize to the canonical schema.

    Balancing Workflow (1‑week sprint)

    1. Day 0: Implement presets; migrate items to budget table.
    2. Day 1–2: Capture telemetry: average carry weight, slots used, item distribution by job.
    3. Day 3: Tighten outliers (+5–10% weight on top 5 hoarded items).
    4. Day 4–5: Vehicle roles: buff utility trunks; nerf glovebox abuse.
    5. Day 6: Perishables: add expiry for high‑margin consumables.
    6. Day 7: Publish patch notes; set a two‑week review.

    Minimum Telemetry

    • % time encumbered, avg slots used, top 20 items by count and by total weight, stash utilization percentiles.

    QA Checklist (ship‑ready)

    • All items have weight, stack, and clear labels.
    • Weapons are unique/non‑stack and include serial, durability.
    • Containers enforce both weight and slots (where supported).
    • Vehicle classes map to sensible capacities.
    • Stashes tiered with progression.
    • Migrations backed up; rollback tested.
    • Metadata size bounded; validated server‑side.

    Downloadable Templates (inline)

    Weight Budget CSV (copy to Google Sheets)

    name,label,class,weight_g,stack,stack_size water,Water Bottle,consumable,500,true,10 bandage,Bandage,medical,150,true,5 lockpick,Lockpick,tool,50,true,10 pistol_ammo,Pistol Ammo (30),ammo,450,true,5 weapon_pistol,Pistol,weapon,1500,false,1

    Vehicle Capacity Table (CSV)

    container,weight_g,slots Glovebox,10000,5 Sedan Trunk,80000,20 SUV/Van Trunk,120000,25 Truck Trunk,180000,28 Motorcycle,8000,3


    Common Pitfalls & Fixes

    • Players always encumbered → Reduce top‑3 ubiquitous item weights by 15%; increase player cap by 10%.
    • Endless hoarding of micro‑items → Introduce slot cap; set minimum item weight (e.g., 25g).
    • Economy inflation via stockpiling → Add perishables expiry, crafting input weight friction, or stash fees.
    • DB bloat → Prune metadata keys; avoid large notes fields.

    Next steps

    • Roll out the hybrid presets above, then iterate with telemetry.
    • Align inventory friction with payouts and prices—see our economy post for sinks and progression models that pair well with these settings.

    Have questions about a specific framework fork or a

    Have questions about a specific framework fork or a custom inventory? Drop the details and I’ll tailor the exact configs.

Frequently Asked Questions

You recommend a hybrid weight and slot system. What are the drawbacks of using only weight or only slots for inventory management?

A slots-only system, where each item occupies a slot or a defined size class, struggles to differentiate between heavy and light items. This can lead to exploits where players carry numerous small, high-value items. A weight-only system, where each item has a weight and players have a maximum weight capacity, is more realistic but requires careful configuration of default weights. A hybrid system, combining global weight and slot caps, prevents both micro-item exploits (many small items) and mega-item exploits (a few very heavy items), making it a more balanced choice for roleplay servers.

How should I adjust the provided default weight and slot presets for my FiveM server?

The default presets provided are battle-tested starting points. After implementing them, monitor in-city telemetry for about a week. Observe player behavior, resource availability, and economic indicators. Based on this data, adjust the values by ±10–20% to fine-tune the balance to your specific server's needs. Consider factors like the availability of items, the rewards for different activities, and the desired level of scarcity.

If I'm using ESX, QBCore, or ox_inventory, how do I use the `items.lua` definitions provided?

The guide provides copy-pasteable `items.lua` definitions specifically designed for ESX, QBCore, and ox_inventory frameworks. Locate your existing `items.lua` file within your inventory script's directory. Carefully integrate the provided definitions, paying close attention to syntax and ensuring you don't overwrite or duplicate existing item definitions unintentionally. Remember to restart your server or inventory script after making changes for them to take effect. Always back up your original `items.lua` file before making modifications.

What makes inventory tuning important for a balanced roleplay economy in FiveM?

Inventory tuning, including managing slots, weight, stack limits, and item metadata, is crucial for creating a stable RP economy. These rules enforce scarcity, introduce friction, and force players to make meaningful choices about what they carry. If players can carry unlimited quantities of everything, it leads to price collapses and breaks economic loops. Tuning the inventory system is a foundational step before adjusting prices, payouts, and economic sinks.

Previous Article

How to Translate FiveM Scripts with AI: The Complete 2026 Workflow

Next Article

How to Stream Custom Clothing in FiveM

More on This Topic

QBox Framework Guide: Migrate from QBCore and Boost Performance (2026)The History of FiveM: From Mod Project to Official PlatformFiveM Server Management: The Complete Guide from Setup to ScaleBreaking Free from Tebex: Complete Guide to FiveM Server MonetizationFiveM: Switching from Patreon to FiveM-Portal

Turn this guide into a production-ready roleplay stack

The best job and roleplay setups depend on more than one script. Use the connected hubs below to compare install-ready products, bundles, and framework fit before you buy.

Category hub

Browse install-ready job scripts

Compare police, mechanic, drug, civilian, and economy systems in the main jobs hub before you commit to a single resource.

Open job scripts

Framework hub

Browse QBCore-ready scripts

Move into the QBCore landing page to compare verified scripts, framework fit, and install-ready products built for modern FiveM servers.

Open QBCore hub

Premium catalog

Browse premium FiveM scripts

Move from research into the main shop to compare real products, framework labels, screenshots, and production-ready quality signals.

Open premium shop

Launch faster

Compare curated bundles

Bundles shorten the path from planning to launch by grouping the highest-leverage scripts into a cleaner commercial starting point.

View bundles

Disclosure: Some links below are affiliate links to FiveMX products. We may earn a commission at no extra cost to you.

Related Articles

Best FiveM Inventory Scripts 2026: Complete Comparison Guide

Best FiveM Inventory Scripts 2026: Complete Comparison Guide

The best FiveM inventory scripts in 2026 are ox_inventory as the free open-source default, qs-inventory as the polished premium alternative around 35 to 50 USD, qb-inventory as…

February 24, 2026
ESX Weight Inventory: How to Fix Common Issues

ESX Weight Inventory: How to Fix Common Issues

Don’t let the new ESX weight update freeze your inventory—just grab the newest ESX version, add the latest esx‑inventoryhud, restart your server, and your items will work again in no time!

February 5, 2024
From mysql-async to oxmysql: Safe Migration & Query Patterns

From mysql-async to oxmysql: Safe Migration & Query Patterns

1. Full backup: mysqldump --single-transaction yourdb > backup.sql. 2. Staging env mirroring production schema + data subset. 3.

August 16, 2025
Secure CheckoutInstant AccessMoney-Back GuaranteeLifetime Updates
FiveMX

Premium FiveM scripts and mods for serious server owners.

Shop

  • Shop
  • QBCore Scripts
  • ESX Scripts
  • FiveM Scripts
  • Free Mods
  • Best Scripts & Mods

Help

  • About
  • FAQ
  • Support
  • Contact
  • Account
  • Affiliate Program

Legal

  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Cookie Policy
  • GDPR Compliance
  • DMCA
  • Imprint
  • Editorial Policy
© 2026 FiveMX. All rights reserved.·support@fivemx.com

FiveMX is not affiliated with Rockstar Games, Take-Two Interactive, or CFX.re. All trademarks are property of their respective owners.

Flash Sale — Up to 19% off!Flash Sale — 19% off!Shop Now