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

Function

playPedVoiceLine

ServerPedsTrilogy Hub only

Sends every player the onClientPedVoice event with the ped and the line name. The function itself does not play any sound: a client script plays the line, e.g. with playSound3D from a resource sound file attached to the ped. This lets you build custom NPC dialogue heard by everyone nearby.

Syntax

bool playPedVoiceLine(ped ped, string voiceLine)

Arguments

pedped
The ped that "speaks".
voiceLinestring
Line name (anything, e.g. a sound file name).

Returns

true once sent.

Example

playPedVoiceLine(shopkeeper, "witaj.mp3")

See also