> ## Documentation Index
> Fetch the complete documentation index at: https://docsuncv2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# raknet.send

Sends a packet of your own onto the network, as if the client sent it.

```luau theme={null}
raknet.send(data: buffer | string | {number}, priority: number, reliability: number, orderingChannel: number): ()
```

RakNet is the network connection between your client and the Roblox server over the internet. <br />Pretty much the same as `RemoteEvent`s and `RemoteFunction`s - they send their data the same way. This function just builds the packet yourself instead of going through a remote.

`data` is the payload, in any of the same three forms a `RakNetMessage` exposes. `priority`, `reliability`, and `orderingChannel` are RakNet's standard send numbers; copy them from the packet you are replaying instead of guessing.

## Parameters

| Parameter         | Type                           | Description                                |
| ----------------- | ------------------------------ | ------------------------------------------ |
| `data`            | `buffer \| string \| {number}` | The packet payload.                        |
| `priority`        | `number`                       | RakNet send priority.                      |
| `reliability`     | `number`                       | RakNet reliability mode.                   |
| `orderingChannel` | `number`                       | Ordering channel used for ordered traffic. |

## Returns

<code title="the function does not return a value.">void</code>

## Example

Send a payload built from a byte array.

<CodeGroup>
  ```luau Example 1 theme={null}
  <<<<<<< HEAD
  raknet.send(bitBuffer, 1, 0)
  =======
  -- raknet.send(data: buffer | string | {number}, priority: number, reliability: number, orderingChannel: number): ()
  >>>>>>> 50e30f53759b0538759af25c9b271514aa2c9290
  ```

  ```luau Example 2 theme={null}
  local payload = {0x01, 0x02, 0x03, 0x04}

  raknet.send(payload, 0, 0, 0)
  ```
</CodeGroup>

<Tip>
  Lower-level protocol sending can easily trigger server bans if incorrect values are sent.
</Tip>
