---
title: "RemoteFunction"
description: "Request/response communication between creator LocalScripts and ServerScripts."
canonical: "https://docs.glorpia.com/instances/remotefunction"
markdown: "https://docs.glorpia.com/instances/remotefunction.md"
---
# RemoteFunction

Request/response communication between creator LocalScripts and ServerScripts.

**Category:** Instances

## Members

| Name | Type | Description |
| --- | --- | --- |
| `MaxRequestsPerMinute` | number | Maximum requests accepted per minute per Player. 0 disables the limit. |
| `Reliability` | Enum.NetworkReliability | Reliable keeps ordered delivery. Unreliable may discard an older pending packet when superseded by a newer packet for the same remote and target. |
| `Payload` | Enum.RemotePayload | Default permits every supported remote value type. Custom enforces AllowedPayloadTypes. |
| `AllowedPayloadTypes` | array | Saved list of payload types allowed when Payload is Custom. Studio displays this list as checkboxes. |
| `Timeout` | number | Hard native request timeout in seconds. The default is 30 seconds. A request that does not receive a response before the deadline raises a timeout error. |
| `NetworkPriority` | Enum.NetworkPriority | Ranks queued remote traffic as High, Medium, Default, or Low. |
| `InvokeServer(...)` | LocalScript | Calls the server callback and yields until its return values arrive. |
| `OnServerInvoke` | ServerScript callback | Assign a function that receives the sending Player followed by the invocation arguments. |
| `InvokeClient(player, ...)` | ServerScript | Calls one client's callback and yields until its return values arrive. |
| `OnClientInvoke` | LocalScript callback | Assign a function that handles an invocation from the server. |

## Example: client asks the server

```luau
-- ServerScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local getRound = ReplicatedStorage:WaitForChild("GetRound")

getRound.OnServerInvoke = function(player)
    return 3, "Playing"
end
```

```luau
-- LocalScript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local getRound = ReplicatedStorage:WaitForChild("GetRound")

local round, state = getRound:InvokeServer()
print(round, state)
```

## Network configuration

```luau
-- ServerScript runtime configuration
getRound.MaxRequestsPerMinute = 30
getRound.Reliability = Enum.NetworkReliability.Reliable
getRound.Payload = Enum.RemotePayload.Custom
getRound.AllowedPayloadTypes = { "Number", "String", "Player" }
getRound.Timeout = 5
getRound.NetworkPriority = Enum.NetworkPriority.Medium
```

When `Payload` is `Custom`, Studio shows checkboxes for Nil, Boolean, Number, String, Vector3, Color3, Instance, Player, and Table. The checked values are saved as an array.

> **Note:** For `Reliability = Enum.NetworkReliability.Unreliable`, an invocation or response can be discarded when superseded before transmission. If that happens, the caller remains protected by `Timeout`.

## Arguments and returns

RemoteFunction arguments and return values support `nil`, booleans, numbers, strings, `Vector3`, `Color3`/`Colour3`, Instances, Players and nested tables containing supported values. Custom payload rules are enforced on both send and receive.

> **Note:** Only one callback is assigned to `OnServerInvoke` or `OnClientInvoke`. Use a RemoteEvent when a return value is not needed.

## Related

- [RemoteEvent](https://docs.glorpia.com/instances/remoteevent.md) — One-way client/server messages.
- [ReplicatedStorage](https://docs.glorpia.com/services/replicatedstorage.md) — Shared hierarchy where remotes can be visible to both sides.
- [LocalScript](https://docs.glorpia.com/instances/localscript.md) — Creator client scripts.
- [ServerScript](https://docs.glorpia.com/instances/serverscript.md) — Creator authoritative server scripts.
