> For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.0resmon.org/0resmon/0resmon-1/0r-resources/0r-radio-v3/exports.md).

# Exports

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

| Type    | Description               |
| ------- | ------------------------- |
| boolean | Radio UI visibility state |

***

### hasRadio

Returns whether the player currently has a radio item.

```lua
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.

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

#### Returns

| Type    | Description        |
| ------- | ------------------ |
| boolean | Jammer range state |

***

### getChannel

Returns the player's current radio channel.

```lua
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.

```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

| 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.

```lua
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.

```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

| 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) |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.0resmon.org/0resmon/0resmon-1/0r-resources/0r-radio-v3/exports.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
