gta6/prompts
medical
Vaultadvancedmedical

NPC Patient Generator — Procedural Ailments for Medics

ESX/QB procedural patient generator that periodically spawns wandering NPCs with randomized ailments from server-owned spawn points and pays the medic a server-validated reward on treatment.

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

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).

🔒 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/medical/30-npc-patient-generator.lua. It implements a server timer that spawns capped, randomly-ailmented patients from server-owned coordinates, a…

🔒 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-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 loadCreatePed returns null and TaskPlayAnim no-ops without RequestModel/RequestAnimDict + their HasModelLoaded/HasAnimDictLoaded wait loops.
  • Double-claim — without a claimed flag 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 with xPlayer.addAccountMoney('bank', reward).
  • QBCore: local QBCore = exports['qb-core']:GetCoreObject(); pay with Player.Functions.AddMoney('bank', reward) and gate spawns to on-duty ambulance job.
  • QBox: use exports.qbx_core:GetPlayer(src) and the same AddMoney accessor, checking duty via Player.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.