RR-Speech — NPC Voice Line API
Give your NPCs a voice using GTA's own built-in lines — no audio files, no AI, no TTS. A tiny, dependency-free API that lets any of your scripts make peds talk, shout, or mutter ambient chatter on demand.
Make any NPC talk with one line of code — using GTA V's built-in voice lines.
rr-speech is a tiny, standalone helper that lets any resource trigger the game's native ambient speech ("speeches") on a ped. No audio files, no TTS, no external services — it plays the voice lines that already ship with GTA V, using whatever voice the ped's model already has. Perfect for guards, gang members, hostages, dealers, cops, shopkeepers, or any ambient NPC that should react out loud.
- ✅ Zero dependencies — pure native, no ox_lib / framework required.
- ✅ Framework-agnostic — works on any FiveM server (qb, qbx, ESX, standalone).
- ✅ Server-friendly — 100% client-side, no networking, no server load.
- ✅ Drop-in — three simple exports, ready in seconds.
- ✅ No streamed assets — nothing to download in-game.
Installation
- Drop the
rr-speechfolder into yourresourcesdirectory. - Add
ensure rr-speechto yourserver.cfg. - Start (or restart) your server. That's it.
There is nothing to configure to get started, and no database.
Usage
Call the exports from any other resource (client-side):
-- Say one line right now
exports['rr-speech']:Say(ped, 'threaten')
-- Say a line with options
exports['rr-speech']:Say(ped, 'scared_shout', { param = 'SPEECH_PARAMS_FORCE_SHOUTED', chance = 80 })
-- Register a ped for periodic idle chatter
exports['rr-speech']:Ambient(ped, 'idle')
-- Stop a ped's ambient chatter
exports['rr-speech']:StopAmbient(ped)
Exports
| Export | Signature | Returns |
|---|---|---|
Say | Say(ped, category, opts?) | the speech name played, or nil if skipped |
Ambient | Ambient(ped, category, opts?) | — (idempotent; call again to update settings) |
StopAmbient | StopAmbient(ped) | — |
opts table (all optional)
| Field | Applies to | Description |
|---|---|---|
param | Say / Ambient | Speech param string (else the category default) |
voice | Say / Ambient | Force a specific voice name |
cooldown | Say | Per-ped anti-spam gap in ms (default Config.SayCooldown) |
force | Say | Ignore the cooldown |
chance | Say / Ambient | 0–100 % chance to actually speak |
minGap / maxGap | Ambient | Min/max ms between a ped's ambient lines |
Tip:
categorycan also be a raw speech name straight from the FiveM speeches catalog — if it isn't a known category it's played as a literal line.
Categories
Categories are defined in config.lua. Each is a list of speech names; one is picked at random per call. Out of the box:
| Category | Mood | Category | Mood |
|---|---|---|---|
greet | says hi | war_cry | battle scream |
thanks | thanks you | scared | nervous |
bye | says goodbye | scared_shout | panicked |
idle | random muttering | beg | begging |
insult | curses at you | drug_deal | low-key dealer talk |
threaten | threatens you | cop_order | "you're under arrest" |
cop_pursuit | chase shouts |
Adding your own lines — just append speech names to any list in Config.Lines, or add a new category. No code changes needed.
A speech only plays if the ped's voice model supports it (e.g.
cop_orderneeds a cop-voiced ped). Each list is anchored with generic lines that work on almost any ped, so you'll always hear something.
Configuration (config.lua)
| Setting | Purpose |
|---|---|
Config.Debug | When true, prints a load banner and registers the /speechtest command. Ship with this false. |
Config.SayCooldown | Default ms between Say calls for the same ped |
Config.Ambient.* | Tick rate, min/max gap, hearing distance, and % chance for ambient chatter |
Config.Lines | The voice-line categories |
Config.Params | Default speech param per category (normal vs. shouted) |
Debug / testing
Set Config.Debug = true to enable the /speechtest <category> command, which makes the nearest ped talk and reports which line fired. Leave it false on a live server so the command is never exposed to players.
Compatibility
- FiveM (any build). Client-side only.
- No framework, no ox_lib, no database, no dependencies.
Credits
© Gas Team Developers. All rights reserved.
