Skip to Content

Exports

Client Side Exports

Radio

isRadioOpen

Check whether the radio UI is currently open.

exports['prism_radio']:isRadioOpen()

Returns

  • booleantrue if the radio UI is open, otherwise false

isConnected

Check whether the player is currently connected to a radio frequency.

exports['prism_radio']:isConnected()

Returns

  • booleantrue if connected to a frequency, otherwise false

getCurrentFrequency

Get the current radio frequency the player is connected to.

exports['prism_radio']:getCurrentFrequency()

Returns

  • number | nil — The current frequency, or nil if not connected

disconnectRadio

Disconnect from the current radio channel if connected.

exports['prism_radio']:disconnectRadio()

connectRadio

Connect to a radio channel, with optional password and nickname override.

exports['prism_radio']:connectRadio(frequency, password, name)

Parameters

  • frequency (number | string) — The channel to connect to (can be a number or string)
  • password (string | nil) — Password for the channel if it is protected (you must handle collecting this from the user, e.g. via an ox_lib input)
  • name (string | nil) — Nickname to connect with; if nil, the character name is used as usual

openRadio

Open the radio UI.

exports['prism_radio']:openRadio()

closeRadio

Close the radio UI.

exports['prism_radio']:closeRadio()

Automatically re-enables the radio if it was previously disabled.


toggleRadio

Toggle the radio UI state.

exports['prism_radio']:toggleRadio()

setRadioEnabled

Enable or disable the radio entirely.

exports['prism_radio']:setRadioEnabled(enabled)

Parameters

  • enabled (boolean) — Whether the radio should be enabled

If set to false while the radio is open, it will be closed automatically.


Radio & HUD

getHudMembers

Get the list of members currently displayed in the radio HUD.

exports['prism_radio']:getHudMembers()

Returns

  • { name: string; isSpeaking: boolean }[] — An array containing the current HUD members

isHudVisible

Check whether the radio HUD is currently visible.

exports['prism_radio']:isHudVisible()

Returns

  • booleantrue if the HUD is visible, otherwise false

getRadioNickname

Get current nickname of player set on radio

exports['prism_radio']:getRadioNickname()

Returns

  • string?string if player is on radio & has a custom nickname, otherwise nil

Events & State

Client Events

prism_radio:nicknameUpdated

Triggered when the local player’s radio nickname changes.

AddEventHandler('prism_radio:nicknameUpdated', function(radioNickname) -- radioNickname: string | nil end)

Parameters

  • radioNickname (string | nil) — The new nickname if the player has set one, otherwise nil

Server Events

prism_radio:nicknameUpdated

Triggered when a player’s radio nickname changes on the server.

AddEventHandler('prism_radio:nicknameUpdated', function(playerId, radioNickname) -- playerId: number -- radioNickname: string | nil end)

Parameters

  • playerId (number) — The player’s server ID
  • radioNickname (string | nil) — The new nickname if the player has set one, otherwise nil

State Bags

LocalPlayer.state.radioNickname

Holds the local player’s current radio nickname.

local nickname = LocalPlayer.state.radioNickname -- string | nil

Type

  • string | nilstring if the player has a custom nickname, otherwise nil

Player(serverId).state.radioNickname

Holds another player’s current radio nickname.

local nickname = Player(serverId).state.radioNickname -- string | nil

Type

  • string | nilstring if the player has a custom nickname, otherwise nil
Last updated on