OnNpcRouteStart

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:49, 15 August 2026 by QCherry (talk | contribs) (Update Lua event reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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)