ClearNpcRoute
clearNpcRoute
Stops and removes a resource-owned NPC's active route.
Syntax
bool clearNpcRoute(int npcId)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
int |
yes | The server-assigned NPC identifier returned by spawnNpc or getNpcs.
|
Returns
Returns true when the route is cleared; otherwise returns false.
Examples
Stop a patrol at its current position:
clearNpcRoute(npcId)
Notes
- Available only in server-side resource scripts.
- The NPC remains spawned and can receive another route later.