Skip to main content
TRACK B·PRODUCTION ENGINEERING·Verified June 2026 · Lua 5.4 · ox_lib 3.x
Learning with an AI assistant?
Copies this lesson plus 2026 ground rules (no lua54 'yes', Cfx.re Portal, correct callback signatures) as a ready-to-paste mentor prompt.

Voice scripting: proximity, channels, and radio

The setup lesson got voice working as config. This lesson integrates with pma-voice through the API it owns. You will read proximity from a state bag and join radio through setRadioChannel, then study the lower-level Mumble natives for understanding only.

You'll build
A pma-voice integration that reads current proximity state and joins/leaves a radio through supported exports.
Time
~24 minutes
You need
A running server with a voice resource active (pma-voice is the common modern choice) or the built-in mumble system, plus a second player to test with. If voice is not installed yet, do the Voice setup and troubleshooting lesson first.
You'll learn
pma-voice state and exports -> why direct Mumble overrides conflict -> server channel checks -> the native concepts underneath
BEFORE YOU START

The two ways voice travels

Before any code, hold these two models in your head. They are different systems, and almost every voice bug comes from confusing them.

  • Proximity. Your voice is positional. With pma-voice, configured modes and its cycle control own the distance; LocalPlayer.state.proximity reports the current mode, distance, and name.
  • Radio. pma-voice layers a push-to-talk radio channel over ordinary proximity. Join with exports['pma-voice']:setRadioChannel(channel) and leave with channel 0. Do not replace pma-voice routing with MumbleSetVoiceChannel.

The mental model to lock in: proximity is a radius, a channel is a room. A radio command does not change anyone's proximity radius. It moves the speaker into a shared room and back out again. Keep those two ideas separate and the natives below stop being a soup of similar names.

Keep reading the full lesson

Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.

Still ahead in this lesson
  • Build it
  • How it works
  • Common mistakes
  • What you can do now
  • Try it yourself

The remainder of Voice scripting: proximity, channels, radio is available to FiveM School members.