Skip to content

Exports

Client exports and events for integrations.

Everything below is part of the public surface — safe to call from another resource. All client exports live on the 0r-radio resource.

Client exports#

isRadioOpen#

Returns whether the radio UI is currently open.

lua
local open = exports['0r-radio']:isRadioOpen()

Returns#

TypeDescription
booleanRadio UI visibility state

hasRadio#

Returns whether the player currently has a radio item.

lua
local has = exports['0r-radio']:hasRadio()

Returns#

TypeDescription
booleanWhether the player has a radio item

isInJammerRange#

Returns whether the player is inside an active jammer's range.

lua
local jammed = exports['0r-radio']:isInJammerRange()

Returns#

TypeDescription
booleanJammer range state

getChannel#

Returns the player's current radio channel.

lua
local channel = exports['0r-radio']:getChannel()

Returns#

TypeDescription
numberCurrent channel ID, or 0 if not connected

toggleRadio#

Opens or closes the radio UI.

lua
exports['0r-radio']:toggleRadio()

canJoinChannel#

Checks whether the player can join a channel without actually joining. Uses the same gate as joinChannel — frequency bounds, jammer state, job/duty rules, and password for custom channels. Use this when you want to know why someone cannot join without firing a notification.

lua
local ok, reason = exports['0r-radio']:canJoinChannel(150, 'optional-password')

Parameters#

NameTypeDescription
channelnumberTarget channel / frequency ID
passwordstring?Optional channel password

Returns#

TypeDescription
booleanWhether the player can join
string?Failure reason when the first value is false

joinChannel#

Joins a radio channel. Returns true on success; on failure returns false and shows a notification.

lua
local success = exports['0r-radio']:joinChannel(150, 'optional-password')

Parameters#

NameTypeDescription
channelnumberTarget channel / frequency ID
passwordstring?Optional channel password

Returns#

TypeDescription
booleanWhether the join succeeded

leaveChannel#

Leaves the current radio channel.

lua
exports['0r-radio']:leaveChannel()

createChannel#

Creates a custom channel. The frequency must be above frequency.publicChannels in config.

lua
local success = exports['0r-radio']:createChannel(420, 'mypassword')

Parameters#

NameTypeDescription
channelnumberCustom channel ID
passwordstringChannel password

Returns#

TypeDescription
booleanWhether the channel was created

Useable events#

Client

EventPurpose
0r-radio:client:useRadioOpen radio UI (from usable item)