# network

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


---

# Agent Instructions: 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:

```
GET https://riseclients-organization.gitbook.io/rise-6-scripting-api/api-documentation/global-namespaces/network.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
