Tutorial

RW VOICELINE

Exports for creating voice lines, dialogs, and announcements with optional colors and formatting.

DoVoiceLine

Plays a voice line or announcement for a player or globally. Supports color codes and line breaks.

exports.rw_voiceline:DoVoiceLine(speaker, message, duration)
TriggerClientEvent( "rw_voiceline", playerid, message, duration)
NameTypeDescription
speakerstringName of the person or entity “speaking” the line.
messagestringText to display in the voice line. Supports formattin - /#[hex] — Set text color (e.g., /#22c55e for green). - /# — Reset color to default. - /n — Add a new line.
durationnumberDuration (in milliseconds) the voice line should display.

Example

-- Server-side trigger
exports.rw_voiceline:DoVoiceLine(
    "Lester",
    "Hey, kid. Heard you’re lookin’ to make some /#22c55e real money /#. Not that small-time stuff.",
    5000
)
 
-- Equivalent client event
TriggerClientEvent(
    "rw_voiceline",
    playerid,
    "Hey, kid. Heard you’re lookin’ to make some /#22c55e real money /#. Not that small-time stuff",
    5000
)