Remote
A wrapper around RemoteEvent, UnreliableRemoteEvent, and RemoteFunction
that combines their interfaces into a single object. Instances are created
and retrieved via GetRemote.
Functions
OnEvent
Remote:OnEvent(callback: function,--
The callback to invoke when the event fires
rateLimitInterval: number?--
If provided, rate-limits the callback to this interval in seconds
) → RBXScriptConnection
Connects the provided callback to the remote's event. Context is determined
automatically. If a rateLimitInterval is provided, events fired within
that duration will be queued and only the latest arguments processed. This
can prevent remote spam, but may cause events to be dropped if set too high.
OnServerEvent and OnClientEvent are aliases for this method.
OnUnreliableEvent
Remote:OnUnreliableEvent(callback: function,--
The callback to invoke when the event fires
rateLimitInterval: number?--
If provided, rate-limits the callback to this interval in seconds
) → RBXScriptConnection
Connects the provided callback to the remote's unreliable event. Context is
determined automatically. If a rateLimitInterval is provided, events fired
within that duration will be queued and only the latest arguments processed.
This can prevent remote spam, but may cause events to be dropped if set too
high.
OnServerUnreliableEvent and OnClientUnreliableEvent are aliases for this method.
FireClient
This item only works when running on the server. ServerRemote:FireClient(...: any--
The arguments to pass to the client
) → ()Fires the remote's event to the given player. Identical to RemoteEvent:FireClient().
FireClientUnreliable
This item only works when running on the server. ServerRemote:FireClientUnreliable(...: any--
The arguments to pass to the client
) → ()
Fires the remote's event to the given player using an unreliable connection.
Identical to UnreliableRemoteEvent:FireClient().
Also accessible as FireClientFast.
FireClientList
This item only works when running on the server. ServerRemote:FireClientList(...: any--
The arguments to pass to the clients
) → ()Fires the remote's event to each player in the provided list.
FireClientListUnreliable
This item only works when running on the server. ServerRemote:FireClientListUnreliable(...: any--
The arguments to pass to the clients
) → ()Fires the remote's event to each player in the provided list using an unreliable connection.
Also accessible as FireClientListFast.
FireAllClients
This item only works when running on the server. ServerRemote:FireAllClients(...: any--
The arguments to pass to the clients
) → ()Fires the remote's event to all players. Identical to RemoteEvent:FireAllClients().
FireAllClientsUnreliable
This item only works when running on the server. ServerRemote:FireAllClientsUnreliable(...: any--
The arguments to pass to the clients
) → ()
Fires the remote's event to all players using an unreliable connection.
Identical to UnreliableRemoteEvent:FireAllClients().
Also accessible as FireAllClientsFast.
FireAllExcept
This item only works when running on the server. ServerRemote:FireAllExcept(...: any--
The arguments to pass to the clients
) → ()Fires the remote's event to all players except the given player or list of players.
Also accessible as FireAllClientsExcept.
FireAllExceptUnreliable
This item only works when running on the server. ServerRemote:FireAllExceptUnreliable(...: any--
The arguments to pass to the clients
) → ()Fires the remote's event to all players except the given player or list of players using an unreliable connection.
Also accessible as FireAllExceptFast, FireAllClientsExceptUnreliable, and FireAllClientsExceptFast.
FireServer
This item only works when running on the client. ClientRemote:FireServer(...: any--
The arguments to pass to the server
) → ()Fires the remote's event to the server. Identical to RemoteEvent:FireServer().
FireServerUnreliable
This item only works when running on the client. ClientRemote:FireServerUnreliable(...: any--
The arguments to pass to the server
) → ()
Fires the remote's event to the server using an unreliable connection.
Identical to UnreliableRemoteEvent:FireServer().
Also accessible as FireServerFast.
Fire
Remote:Fire(...: any--
The arguments to pass
) → ()
Fires the remote's event, automatically routing by context: uses
:FireServer() on the client, or :FireAllClients() on the server.
FireUnreliable
Remote:FireUnreliable(...: any--
The arguments to pass
) → ()
Fires the remote's event using an unreliable connection, automatically
routing by context: uses :FireServerUnreliable() on the client, or
:FireAllClientsUnreliable() on the server.
Also accessible as FireFast.
InvokeClient
This item only works when running on the server. ServerThis is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsRemote:InvokeClient(...: any--
The arguments to pass
) → any
Invokes the remote's function on the given player. Identical to
RemoteFunction:InvokeClient().
InvokeServer
This item only works when running on the client. ClientThis is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsRemote:InvokeServer(...: any--
The arguments to pass
) → any
Invokes the remote's function on the server. Identical to
RemoteFunction:InvokeServer().
Invoke
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. YieldsRemote:Invoke(...: any--
The arguments to pass (first arg is the target Player when called from server)
) → any
Invokes the remote's function, automatically routing by context: uses
:InvokeServer() on the client, or :InvokeClient() on the server. When
calling from the server, the first argument should be the target Player.
OnInvoke
Remote:OnInvoke(callback: function--
The callback to invoke when the function is called
) → ()
Sets the callback for the remote's function. Equivalent to setting
RemoteFunction.OnServerInvoke or RemoteFunction.OnClientInvoke.
Context is determined automatically.
OnServerInvoke and OnClientInvoke are aliases for this method.