gta6/prompts
crafting
Vaultadvancedcrafting

Weight & Slot Inventory Core

ESX/QBCore capacity engine where every item carries weight and slot size, enforcing max-weight, slot count, metadata-aware stacking and overflow rejection server-side.

NON-TESTÉ — the reference Lua is syntax-validated, not run in a live FiveM server. Adapt and test on your own dev server before shipping.
Est. Lua
~95 loc
Claude
Claude Opus 4.x / Sonnet 4.x
Validation
syntax-validated
Updated
2026-06-25

Description

A capacity engine for ESX/QBCore servers where every item declares a weight and a slot footprint, and the server enforces a max-weight and max-slot ceiling on every add. It is the foundation a crafting/survival economy stands on — without a trustworthy capacity layer, every downstream loot, craft and trade feature can be cheated.

Prompt Template

You are writing a FiveM resource for esextended (stable, exports getSharedObject).

🔒 Eyes-only — locked prompt body

The full prompt template and its reference Lua are part of a one-time pack. Pick your depth — both are lifetime access, no subscription, ever.

Core$49one-time
  • 60 prompts + syntax-validated reference Lua
  • Lifetime access — pay once
Most Popular · Best Value
Vault$199one-time
  • All 510 prompts — the full library
  • Per-prompt profit/trend intelligence (CSV + playbook)
  • Lifetime free updates — new niches as the market moves
Get the Vault — $199

$49 for 60 · $199 for all 510 + intelligence — one-time, no subscription.

Expected Output

The reference Lua at content/expected-outputs/crafting/01-weight-slot-inventory-core.lua implements a shared ItemDefs registry, a client render/add/close NUI flow, and a server that probes a copy of…

🔒 Eyes-only — locked prompt body

The full prompt template and its reference Lua are part of a one-time pack. Pick your depth — both are lifetime access, no subscription, ever.

Core$49one-time
  • 60 prompts + syntax-validated reference Lua
  • Lifetime access — pay once
Most Popular · Best Value
Vault$199one-time
  • All 510 prompts — the full library
  • Per-prompt profit/trend intelligence (CSV + playbook)
  • Lifetime free updates — new niches as the market moves
Get the Vault — $199

$49 for 60 · $199 for all 510 + intelligence — one-time, no subscription.

Known Failure Modes & Corrective Prompt

  • Client-trusted totals — Claude may sum weight in the NUI and send it; a cheat client then lies. Force computeTotals to run only in the server section.
  • Stack overflow into one slot — without math.ceil(count / maxStack) the slot count is wrong and the cap never fires.
  • Half-applied add — mutating store[item] before the capacity check leaves a partial state on rejection. Require a probe copy.

Corrective re-prompt: "Move all weight and slot computation into the server section only, compute used slots as the sum of math.ceil(count/maxStack) per item, and validate against a probe copy of the store so a rejected add never mutates the live inventory."

Framework Integration

  • ESX: exports['es_extended']:getSharedObject(); key the store by xPlayer.identifier.
  • QBCore: exports['qb-core']:GetCoreObject(); resolve the player with QBCore.Functions.GetPlayer(source) and key by Player.PlayerData.citizenid.
  • QBox: use exports.qbx_core:GetPlayer(source) and the ox_lib item metadata shape if you bridge to ox_inventory.

Profit Potential

$80–$1200/mo on Tebex (expected ~$300). [INFERRED] priced inside the $50-389 standalone-script band against the signal-scraper corpus (tebex_snapshot n=100, median seller $11.85K/mo) for a saturated inventory niche.

Trend Signal

saturated — corpus: ox_inventory (ox_* family, sibling of ox_mdt/ox_doorlock/ox_fuel) ships weight+slot natively and is free/dominant — paid base inventories compete against a free standard.

Sales Angle

Sell to teams who want to own their inventory logic instead of forking the free standard — a small, readable, framework-agnostic capacity core. Recommended Tebex price: $59.

Difficulty & Ship Time

advanced · ships in 1 day.