OnNpcRouteStart
Jump to navigation
Jump to search
onNpcRouteStart
Triggered after a complete scripted NPC route has been validated and started.
Availability
This event is available in server-side scripts.
Callback signature
onNpcRouteStart(npcId, pointCount, loop, speed, sourceResource)
Parameters
| Name | Type | Description |
|---|---|---|
npcId |
int |
The routed NPC identifier. |
pointCount |
int |
The number of validated route points. |
loop |
bool |
Whether the route repeats after its last point. |
speed |
number |
Route speed in metres per second. |
sourceResource |
string |
The resource that owns the route. |
Examples
Handle the event:
addEventHandler("onNpcRouteStart", root, function(npcId, pointCount, loop, speed, sourceResource)
outputDebugString("NPC " .. npcId .. " route started with " .. pointCount .. " points")
end)