ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPedVoice

Function

setPedVoice

ServerPedsIdentical to MTA:SA

Stores a voice bank type and name for a ped (e.g. type "PED_TYPE_GEN" and name "VOICE_GEN_BBDYG1"). The value is for scripts and comes back from getPedVoice; the Definitive Edition game does not change the ped's lines based on it yet. Custom lines can be played with playPedVoiceLine and a client script.

Syntax

bool setPedVoice(ped ped, string voiceType, string voiceName)

Arguments

pedped
A player or an NPC.
voiceTypestring
Voice bank type, e.g. "PED_TYPE_GEN".
voiceNamestring
Voice bank name, e.g. "VOICE_GEN_BBDYG1".

Returns

true on success.

Example

setPedVoice(npc, "PED_TYPE_GEN", "VOICE_GEN_BBDYG1")

Notes

State for scripts. The server stores the voice, but the game does not change the ped's lines based on it yet.

See also