gta6/prompts
crafting
Vaultintermediatecrafting

Queued Offline Crafting Jobs

QBCore offline crafting where a started job progresses on a server wall-clock timer and completes even while the player is offline, with materials, the timer and the payout server-authoritative.

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
~92 loc
Claude
Claude Opus 4.x / Sonnet 4.x
Validation
syntax-validated
Updated
2026-06-25

Description

A working QBCore queued offline crafting system: a player starts a long craft that progresses on a server wall-clock timer and finishes even while they are logged off, then collects the output when they return. The server consumes the materials up front, stores a finishAt timestamp per citizenid, and only grants the output once real time has passed. This is the idle-game loop, borrowed from survival games, that crafting servers sell to reward returning players.

Prompt Template

You are writing a FiveM resource for qb-core (exports['qb-core']:GetCoreObject()).

πŸ”’ 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 lives at content/expected-outputs/crafting/12-queued-offline-crafting.lua. It implements a proximity collect prompt, a queue anim with a load wait, a server-side per-citizenid job…

πŸ”’ 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 timer β€” Claude runs the craft countdown locally; it pauses on logout and a packet can fire collect early. Keep the finishAt wall-clock, materials and payout on the server.
  • Anim before load β€” TaskPlayAnim no-ops if the dict is not loaded; always RequestAnimDict + while not HasAnimDictLoaded(dict) do Wait(0) end.
  • One-sided net event β€” defining queue:result on only one side breaks the round-trip; both client and server use RegisterNetEvent + AddEventHandler.

Corrective re-prompt: "Move the craft timer to the server as an os.time()+seconds finishAt stored per citizenid: consume materials at start, and on collect only AddItem when os.time() has passed finishAt, replying with the remaining seconds otherwise. The client never runs a countdown β€” it just asks the server to start or collect."

Framework Integration

  • ESX: swap to exports['es_extended']:getSharedObject(), key jobs by xPlayer.identifier, and use xPlayer.getInventoryItem / removeInventoryItem / addInventoryItem.
  • QBCore: as written β€” Player.Functions.GetItemByName / RemoveItem / AddItem, jobs keyed by citizenid.
  • QBox: use exports.qbx_core:GetPlayer(src) with ox_inventory exports; the finishAt wall-clock and collect logic are identical. Persist jobs to a DB table so the queue survives a server restart.

Profit Potential

$250–$3200/mo on Tebex (expected ~$900). [INFERRED] priced inside the $50-389 script band against the signal-scraper tebex_snapshot corpus (n=100, median seller $11.85K/mo); a rising async-crafting niche borrowed from survival games.

Trend Signal

β†— rising β€” inferred: async/offline crafting borrows a proven survival-game loop; rising FiveM demand, needs server-side persistence.

Sales Angle

The idle-game hook for crafting servers β€” start a long craft, log off, collect it tomorrow. Recommended Tebex price $179.

Difficulty & Ship Time

intermediate Β· ships in 4-6h.