Peds, Horses & Props
Spawn helpers extracted directly from wc_encounter's eight encounter types. Framework-agnostic — these are pure RedM native wrappers, the same on VORP or RSG.
Spawns a single ped, ground-snapped and outfit-randomized.
| Param | Type | Description |
|---|---|---|
| hash | number | A loaded model hash — see LoadModel. |
| x, y, z | number | Spawn coordinates. |
| heading | number | nil | Defaults to 0. |
| isMission | boolean | nil | Marks as mission entity — won't get cleaned up by the engine. |
| invincible | boolean | nil | Sets invincible + blocks non-temp events. |
local hash = wc:LoadAnyModel({ "a_m_m_armtownfolk_01", "a_m_m_valrancher_01" })
local ped = wc:SpawnPed(hash, pos.x, pos.y, pos.z, 90.0, true, true)
Spawns an ambient decoration horse — mission-entity and invincible by default.
| Param | Type | Description |
|---|---|---|
| x, y, z | number | Spawn coordinates. |
| heading | number | nil | Defaults to random. |
| modelList | table | nil | Pool of horse model names to try. |
Spawns a frozen, no-collision decoration prop.
Safely deletes a ped or vehicle — unfreezes and unmarks mission-entity first, so the engine doesn't refuse the delete.
Turns the player and an NPC to directly face one another — standard "start a conversation" framing.
Positions one ped relative to another using a forward/right/up offset in metres, plus a heading delta. Used for things like "place this NPC right in front of the player, facing them."
-- place the NPC just in front of the player, facing them
wc:PlacePedRelative(npcPed, PlayerPedId(), 0.1, 0.90, 0.09, 180.0)
Requests a model and waits for it to load.
| Returns | Type |
|---|---|
| hash | number | nil — nil if invalid or timed out |
Tries a list of model names in order, returns the first that loads. Useful for ped pools where any one of several models is fine.
Requests an animation dictionary and waits for it to load. Returns a boolean.
Bonus — GPS routes & dialogue camera
Two more world helpers extracted alongside the spawners:
wc:SetGPSRoute(wagon.x, wagon.y, wagon.z, 'COLOR_RED')
-- ...
wc:ClearGPSRoute()
wc:EnableDialogueCamera(npcPed)
-- ... run your dialogue ...
wc:DisableDialogueCamera()