Skip to content

function spawnNpc (client-side)

Available since version: 0.1.1

Note

If you try to spawn the local player by passing heroId as npcId, the instance argument gets ignored.

This function will add NPC to the current world.

Declaration

bool spawnNpc(int npcId, string instance = "PC_HERO")

Parameters

  • int npcId: the npc id.
  • string instance: the instance of the NPC.

Returns bool

true when NPC was successfully spawned, otherwise false.