Skip to main content
An external NPC is a dashboard character whose ped is spawned, moved and deleted by your resource. HumaLike attaches the identity to your entity and never spawns, positions, freezes or deletes it. To take over the AI of an NPC HumaLike itself spawned, see Runtime control. All exports on this page return one result table: { apiVersion = 1, ok = true, value = ... } or { apiVersion = 1, ok = false, error = code }. They must be called from a resource other than humalike, or they fail with external_resource_required.

Create the character

In the dashboard, create the NPC with type External and the ped model your script will spawn. No placement is required. Mobility actions may be enabled. The NPC stays offline until a resource binds an entity to it.

Bind an entity

The entity must exist, be a non-player ped, use the NPC’s configured model and carry no other HumaLike identity. One binding per NPC and per entity. Repeating the same bind from the same resource returns the existing binding. Unbind removes HumaLike state and leaves the ped untouched.

Lifecycle

  • Your bindings are detached when your resource stops.
  • A binding is dropped when the entity disappears, changes model or routing bucket, or when the NPC’s type changes in the dashboard.
  • HumaLike emits the server event humalike:npc:ready with { apiVersion, generation } after the first roster sync of each runtime generation. A resource that starts later misses it.
Bind on your own start and again on every ready event. A bind attempted before the first roster sync fails with npc_not_found and succeeds on the event:

Despawn a static NPC

Removes a static NPC’s ped from the runtime without changing its definition. Only the despawning resource can respawn it, and its despawns are restored when it stops.

Next