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.
local open = exports['0r-radio']:isRadioOpen()
Returns#
| Type | Description |
|---|---|
| boolean | Radio UI visibility state |
hasRadio#
Returns whether the player currently has a radio item.
local has = exports['0r-radio']:hasRadio()
Returns#
| Type | Description |
|---|---|
| boolean | Whether the player has a radio item |
isInJammerRange#
Returns whether the player is inside an active jammer's range.
local jammed = exports['0r-radio']:isInJammerRange()
Returns#
| Type | Description |
|---|---|
| boolean | Jammer range state |
getChannel#
Returns the player's current radio channel.
local channel = exports['0r-radio']:getChannel()
Returns#
| Type | Description |
|---|---|
| number | Current channel ID, or 0 if not connected |
toggleRadio#
Opens or closes the radio UI.
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.
local ok, reason = exports['0r-radio']:canJoinChannel(150, 'optional-password')
Parameters#
| Name | Type | Description |
|---|---|---|
| channel | number | Target channel / frequency ID |
| password | string? | Optional channel password |
Returns#
| Type | Description |
|---|---|
| boolean | Whether 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.
local success = exports['0r-radio']:joinChannel(150, 'optional-password')
Parameters#
| Name | Type | Description |
|---|---|---|
| channel | number | Target channel / frequency ID |
| password | string? | Optional channel password |
Returns#
| Type | Description |
|---|---|
| boolean | Whether the join succeeded |
leaveChannel#
Leaves the current radio channel.
exports['0r-radio']:leaveChannel()
createChannel#
Creates a custom channel. The frequency must be above frequency.publicChannels in config.
local success = exports['0r-radio']:createChannel(420, 'mypassword')
Parameters#
| Name | Type | Description |
|---|---|---|
| channel | number | Custom channel ID |
| password | string | Channel password |
Returns#
| Type | Description |
|---|---|
| boolean | Whether the channel was created |
Useable events#
Client
| Event | Purpose |
|---|---|
0r-radio:client:useRadio | Open radio UI (from usable item) |