Skip to content

SetActorHostile

Sets an actor on a player - or stands it down.

true makes the player the actor’s opponent: their game may lock on to the actor’s body, and the actor faces them, walks after them ([actors] chase_speed, up to chase_range) and swings every [actors] swing_interval seconds within [actors] reach, with the weapon of its preset or its fists; a blow that lands comes to the mode as OnActorAttack. A player’s blow on the actor does the same by itself when [actors] fight_back is on. false stands it down - so do the opponent’s death or leaving, another world, chase_range, MoveActor and the actor’s own death.

SetActorHostile(pid, id, hostile)
Parameter Type
pid number the player
id number the actor
hostile boolean true = the actor fights the player; false = peace

boolean - false for anything but a living actor or a player not in the world

-- the arena's champion squares up before the first blow
local champion = CreateActor("test_cuman_ai", ax, ay, az, 180, "The Champion")
SetActorHostile(pid, champion, true)

CreateActor · OnActorAttack · OnActorDamage · StopActor · the NPC actors group of the index