OnActorActivity
An actor’s activity or pair began, ended or never got under way.
state is "start" once the actor is in place and the activity’s loop plays (seated, kneeling, the pair talking), "end"
when it got up (StopActorUse, a MoveActor) and "cancel" when it never got there (its walk ended short of the place, a
pair’s partner did not come within 30 s). An activity the server cut off - a death, a mount, a fight, the actor removed, another
activity - ends without the callback.
Syntax
Section titled “Syntax”function OnActorActivity(id, activity, state) -- ...end| Parameter | Type | |
|---|---|---|
id |
number | the actor |
activity |
string | the activity’s name, or the pair’s |
state |
string | "start", "end" or "cancel" |
Returns
Section titled “Returns”nothing
Example
Section titled “Example”-- the smith works until noon, then sits downfunction OnActorActivity(id, activity, state) if id == smith and state == "end" then SetActorUse(id, "smartObject[Bench/bench_1place_low12]") endendSee also
Section titled “See also”SetActorUse · SetActorUseAt · PlayActorPairAnim · StopActorUse · the Actor life group of the index
