Skip to content

OnActorArrive

An actor reached its MoveActor target.

It stands there until the next MoveActor. Chain the legs of a route here.

function OnActorArrive(id)
-- ...
end
Parameter Type
id number the actor

nothing

-- a patrol between two points, for ever
local route, leg = {{1280, 1100, -1}, {1300, 1100, -1}}, {}
function OnActorArrive(id)
leg[id] = (leg[id] or 1) % #route + 1
local p = route[leg[id]]
MoveActor(id, p[1], p[2], p[3], 1.5)
end

MoveActor · StopActor · IsActorMoving · the NPC actors group of the index