Skip to content

PlayActorVoice

An actor says one of the game’s lines by its id.

line is a line id of the voice lines. The players within range metres of the actor hear it from its body (20 m when not given, at most 100), with the line’s own face and in their game’s language. The voice is voice when the line was recorded in it, else the actor’s own (SetActorVoice, else its soul’s), else a voice of its gender that has the line - the same one for the same actor every time. A line replaces the one the actor was saying. OnActorVoiceEnd at its end.

PlayActorVoice(id, line [, voice, range])
Parameter Type
id number the actor
line string the line’s id (any case)
voice string | nil a voice to say it in, when the line has it (optional)
range number metres it carries (20 when not given) (optional)

number - the line’s length in seconds; 0 when it cannot (not a living actor, no such line, an export without the voice lines)

local seconds = PlayActorVoice(guard, "goss_gossip_ob__jaka_byla_0SzB") -- "Back again, are you? ..."
SendClientMessage(pid, COLOR_WHITE, GetVoiceLineText("goss_gossip_ob__jaka_byla_0SzB"))

PlayActorBark · PlayActorConversation · StopActorVoice · OnActorVoiceEnd · GetVoiceLineText · the Actor life group of the index