SetNpcPaused: Difference between revisions
Jump to navigation
Jump to search
Update Lua API reference |
Complete Lua function catalog |
||
| Line 32: | Line 32: | ||
* Pausing preserves the assigned route and current route index. | * Pausing preserves the assigned route and current route index. | ||
[[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:55, 15 August 2026
setNpcPaused
Pauses or resumes route movement for a resource-owned NPC.
Syntax
bool setNpcPaused(int npcId, bool paused)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
npcId |
int |
yes | The server-assigned NPC identifier returned by spawnNpc or getNpcs.
|
paused |
bool |
yes | True to pause movement or false to resume it. |
Returns
Returns true when the pause state is accepted; otherwise returns false.
Examples
Pause an NPC during dialogue:
setNpcPaused(npcId, true)
-- Resume after the dialogue.
setNpcPaused(npcId, false)
Notes
- Available only in server-side resource scripts.
- Pausing preserves the assigned route and current route index.