ClearNpcRoute

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:52, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.