# RemoteFunction

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/RemoteFunction/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/RemoteFunction

An object which facilitates synchronous, two-way communication across the client-server boundary. Scripts invoking a [`RemoteFunction`](https://rapi.sleaze.dev/classes/RemoteFunction.md) yield until they receive a response from the recipient.

## Methods

### InvokeClient

```luau
RemoteFunction:InvokeClient(player: Player, ...: any): ...any
```

- Tags: Yields, Capabilities: RemoteEvent

Invokes the [`RemoteFunction`](https://rapi.sleaze.dev/classes/RemoteFunction.md) which in turn calls the [`OnClientInvoke`](https://rapi.sleaze.dev/classes/RemoteFunction.md) callback.

Parameters:

- `player`: The [`Player`](https://rapi.sleaze.dev/classes/Player.md) associated with the client to invoke.
- `arguments`: Values to pass to the [`OnClientInvoke`](https://rapi.sleaze.dev/classes/RemoteFunction.md) callback.

Returns: Values returned from the [`OnClientInvoke`](https://rapi.sleaze.dev/classes/RemoteFunction.md) callback.

### InvokeServer

```luau
RemoteFunction:InvokeServer(...: any): ...any
```

- Tags: Yields, Capabilities: RemoteEvent

Invokes the [`RemoteFunction`](https://rapi.sleaze.dev/classes/RemoteFunction.md) which in turn calls the [`OnServerInvoke`](https://rapi.sleaze.dev/classes/RemoteFunction.md) callback.

Parameters:

- `arguments`: Values to pass to the [`OnServerInvoke`](https://rapi.sleaze.dev/classes/RemoteFunction.md) callback.

Returns: Values returned from the [`OnServerInvoke`](https://rapi.sleaze.dev/classes/RemoteFunction.md) callback.

## Events

### RemoteOnInvokeClient

```luau
RemoteFunction.RemoteOnInvokeClient: RBXScriptSignal<(id: number, ...: any)>
```

- Tags: Hidden, Capabilities: RemoteEvent

### RemoteOnInvokeError

```luau
RemoteFunction.RemoteOnInvokeError: RBXScriptSignal<(id: number, arguments: string)>
```

- Tags: Hidden, Capabilities: RemoteEvent

### RemoteOnInvokeServer

```luau
RemoteFunction.RemoteOnInvokeServer: RBXScriptSignal<(id: number, player: Player, ...: any)>
```

- Tags: Hidden, Capabilities: RemoteEvent

### RemoteOnInvokeSuccess

```luau
RemoteFunction.RemoteOnInvokeSuccess: RBXScriptSignal<(id: number, ...: any)>
```

- Tags: Hidden, Capabilities: RemoteEvent

## Callbacks

### OnClientInvoke

```luau
RemoteFunction.OnClientInvoke: (...: any) -> ...any
```

- Tags: Capabilities: RemoteEvent

Callback for when the [`RemoteFunction`](https://rapi.sleaze.dev/classes/RemoteFunction.md) is invoked with [`InvokeClient()`](https://rapi.sleaze.dev/classes/RemoteFunction.md).

Parameters:

- `arguments`: The parameters sent through [`InvokeClient()`](https://rapi.sleaze.dev/classes/RemoteFunction.md).

Returns: Values returned by the callback function.

### OnServerInvoke

```luau
RemoteFunction.OnServerInvoke: (player: Player, ...: any) -> ...any
```

- Tags: Capabilities: RemoteEvent

Callback for when the [`RemoteFunction`](https://rapi.sleaze.dev/classes/RemoteFunction.md) is invoked with [`InvokeServer()`](https://rapi.sleaze.dev/classes/RemoteFunction.md).

Parameters:

- `player`: The [`Player`](https://rapi.sleaze.dev/classes/Player.md) associated with the client that the [`InvokeServer()`](https://rapi.sleaze.dev/classes/RemoteFunction.md) call originates from.
- `arguments`: The parameters sent through [`InvokeServer()`](https://rapi.sleaze.dev/classes/RemoteFunction.md).

Returns: Values returned by the callback function.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
