Description
An advanced NPC patient generator for ESX or QB: on a server timer it spawns wandering NPCs with randomized ailments (fracture, laceration, cardiac, burn, concussion) at server-owned spawn points, broadcasts them to clients, and pays the treating medic a validated, per-ailment reward exactly once. Servers buy it because it solves the dead-shift problem — medics always have patients even when no players are hurt, a compounding, defensible feature.
Prompt Template
You are writing a FiveM resource for esextended (stable, exports getSharedObject).
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.
- 60 prompts + syntax-validated reference Lua
- Lifetime access — pay once
- All 510 prompts — the full library
- Per-prompt profit/trend intelligence (CSV + playbook)
- Lifetime free updates — new niches as the market moves
$49 for 60 · $199 for all 510 + intelligence — one-time, no subscription.
Expected Output
The reference Lua lives at content/expected-outputs/medical/30-npc-patient-generator.lua. It implements a server timer that spawns capped, randomly-ailmented patients from server-owned coordinates, a…
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.
- 60 prompts + syntax-validated reference Lua
- Lifetime access — pay once
- All 510 prompts — the full library
- Per-prompt profit/trend intelligence (CSV + playbook)
- Lifetime free updates — new niches as the market moves
$49 for 60 · $199 for all 510 + intelligence — one-time, no subscription.
Known Failure Modes & Corrective Prompt
- Client-invented patients — Claude lets the client define and pay for patients; keep the registry, ailment and reward server-side keyed by id, claimed once.
- Spawn/anim before load —
CreatePedreturns null andTaskPlayAnimno-ops withoutRequestModel/RequestAnimDict+ theirHasModelLoaded/HasAnimDictLoadedwait loops. - Double-claim — without a
claimedflag two medics both collect; mark the patient claimed in the server handler before paying, then broadcast the clear.
Corrective re-prompt: "Move the patient registry and the REWARD table into server.lua keyed by an incrementing id, and in npcpat:treat reject the call unless the patient exists and claimed is false — set claimed before addAccountMoney and then TriggerClientEvent('npcpat:cleared', -1, id) so every client deletes the ped."
Framework Integration
- ESX:
local ESX = exports['es_extended']:getSharedObject(); pay withxPlayer.addAccountMoney('bank', reward). - QBCore:
local QBCore = exports['qb-core']:GetCoreObject(); pay withPlayer.Functions.AddMoney('bank', reward)and gate spawns to on-dutyambulancejob. - QBox: use
exports.qbx_core:GetPlayer(src)and the same AddMoney accessor, checking duty viaPlayer.PlayerData.job.onduty.
Profit Potential
$250–$3500/mo on Tebex (expected ~$900). [INFERRED] within the $50-389 script band against the signal-scraper tebex_snapshot corpus (n=100, median seller $11.85K/mo), sized for a rising, high-defensibility niche.
Trend Signal
↗ rising — strategy: NPC patient generator (gives medics work when no players are hurt) is a novel, compounding moat per matrix; high defensibility.
Sales Angle
Position as the system that keeps medics employed on low-population servers — it solves the dead-shift problem and compounds value as the headline of a premium EMS overhaul. Recommended Tebex price $249.
Difficulty & Ship Time
advanced · ships in 1-2 days.