ClearNpcRoute: Difference between revisions
Jump to navigation
Jump to search
Update Lua API reference |
Complete Lua function catalog |
||
| Line 28: | Line 28: | ||
* The NPC remains spawned and can receive another route later. | * The NPC remains spawned and can receive another route later. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
[[Category:NPC Functions]] | [[Category:NPC Functions]] | ||
Latest revision as of 09:52, 15 August 2026
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.