> For the complete documentation index, see [llms.txt](https://riseclients-organization.gitbook.io/rise-6-scripting-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riseclients-organization.gitbook.io/rise-6-scripting-api/api-documentation/global-namespaces/network.md).

# network

This page will go over the networking API namespace.

{% hint style="danger" %}
**This API is deprecated due to unstable implementation.** Consider using [the Packet API](/rise-6-scripting-api/api-documentation/global-namespaces/packet.md) instead.
{% endhint %}

### `sendPacket(id, ...parameters): Undefined`

### `receivePacket(id, ...parameters): Undefined`

<table><thead><tr><th>Argument</th><th width="222">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>Number</code></td><td><p>Packet ID. </p><p>0x03 -> C03, 0x0F -> C0F</p></td></tr><tr><td><code>...parameters</code></td><td>Variable arguments: <code>Any</code></td><td>Parameters for instantiation of packet. Mismatch between packet constructor parameters and this variable argument <strong>will cause the script throw an exception.</strong></td></tr></tbody></table>

Those methods will either send a packet to the server, or force the client to receive a packet from the server.

{% hint style="info" %}
Some packets might be unsupported. If the packet is not supported, **the script will throw an exception**.

Every valid packet should be supported.
{% endhint %}

### `isMultiplayer(): Boolean`

This method will return if the client is connected to the server.

### `isSingleplayer(): Boolean`

This method will return if the client is playing in singlepalyer.

### `getServerIP(): String`

Returns the server IP, if the player is connected to a server. Otherwise, this returns null.

### `getServerName(): String`

Returns the server name, if the player is connected to a server. Otherwise, this returns null.

### `getServerMOTD(): String`

Returns the server MOTD (Message Of The Day, also known as the text under a server name), if the player is connected to a server.
