🤠 Wild Country Libs
Client API

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.

SpawnPed(hash, x, y, z, heading?, isMission?, invincible?)client

Spawns a single ped, ground-snapped and outfit-randomized.

ParamTypeDescription
hashnumberA loaded model hash — see LoadModel.
x, y, znumberSpawn coordinates.
headingnumber | nilDefaults to 0.
isMissionboolean | nilMarks as mission entity — won't get cleaned up by the engine.
invincibleboolean | nilSets invincible + blocks non-temp events.
example
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)
SpawnHorse(x, y, z, heading?, modelList?)client

Spawns an ambient decoration horse — mission-entity and invincible by default.

ParamTypeDescription
x, y, znumberSpawn coordinates.
headingnumber | nilDefaults to random.
modelListtable | nilPool of horse model names to try.
SpawnProp(modelName, x, y, z, heading?)client

Spawns a frozen, no-collision decoration prop.

DeletePed / DeleteVehicle(entity)client

Safely deletes a ped or vehicle — unfreezes and unmarks mission-entity first, so the engine doesn't refuse the delete.

FaceEachOther(npcPed)client

Turns the player and an NPC to directly face one another — standard "start a conversation" framing.

PlacePedRelative(childPed, parentPed, offX, offY, offZ, rotZ)client

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

example — reward handover positioning
-- place the NPC just in front of the player, facing them
wc:PlacePedRelative(npcPed, PlayerPedId(), 0.1, 0.90, 0.09, 180.0)
LoadModel(name, timeoutMs?)client

Requests a model and waits for it to load.

ReturnsType
hashnumber | nil — nil if invalid or timed out
LoadAnyModel(pool, timeoutMs?)client

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.

LoadAnimDictSafe(dict, ms?)client

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:

GPS route to a destination
wc:SetGPSRoute(wagon.x, wagon.y, wagon.z, 'COLOR_RED')
-- ...
wc:ClearGPSRoute()
scripted dialogue camera
wc:EnableDialogueCamera(npcPed)
-- ... run your dialogue ...
wc:DisableDialogueCamera()