Class
UnreliableRemoteEvent
An object which facilitates asynchronous, unordered and unreliable, one-way
communication across the client-server boundary. Scripts firing a
UnreliableRemoteEvent do not yield.
The UnreliableRemoteEvent object is a variant of the RemoteEvent
object. It facilitates asynchronous, unordered and unreliable, one-way
communication across the client-server
boundary without yielding for a response. This communication can be directed
from one client to the server, from the server to a specific client, or from
the server to all clients.
In order for both the server and clients to access a
UnreliableRemoteEvent instance, it must be in a place where both sides
can see it, such as ReplicatedStorage, although in some cases it's
appropriate to store it in Workspace or inside a Tool.
UnreliableRemoteEvent is best used for ephemeral events, including
effects that are only relevant for a short time, or for replicating
continuously changing data. These events are not resent if they are lost and
they do not wait for previously fired events to arrive before being processed,
potentially resulting in reduced latency and network traffic. When you need
ordering and reliability, use a RemoteEvent instead.
If no connected listener exists to handle an event, you might see a
Remote event invocation discarded error in the log to indicate that the
event was discarded and that you need to implement either OnClientEvent or
OnServerEvent.
Throttling#
Remote events are subject to rate limits when sent from the client to the
server with the FireServer() method.
RemoteEvents and
UnreliableRemoteEvents both have a limit of
approximately 500 requests per second, per client. This limit is shared
among all remote events of the same type. To avoid throttling and latency
issues, limit recurring remote events whenever possible.
Parameter limitations#
Any type of Roblox object (Enum, Instance, etc.) can be
passed as a parameter when an UnreliableRemoteEvent is fired, as well
as Luau types such as numbers, strings, and booleans, although you should
carefully explore the
limitations.
Events with payloads larger than 1000 bytes are dropped. When this happens in Studio, a log message in the Output window indicates the number of bytes the event went over.
Like all events, the UnreliableRemoteEvent methods encode and compress
certain object types, such as buffers, which shrinks the payload size and can
make it difficult to verify whether you are under the limit prior to firing
the event. If you frequently reach this limit, consider whether a standard
RemoteEvent is the better fit for your use case.
Methods 3#
| FireAllClients | Fires the OnClientEvent event
for all connected clients. Has a 1000 byte limit to the payload of the
event. Events with larger payloads are dropped. |
| FireClient | Fires the OnClientEvent event
for a specific client. Has a 1000 byte limit to the payload of the event.
Events with larger payloads are dropped. |
| FireServer | Fires the OnServerEvent event
on the server from one connected client. Has a 1000 byte limit to the
payload of the event. Events with larger payloads are dropped. |
FireAllClients(arguments: Tuple): ()#
Fires the OnClientEvent event
for all connected clients. Unlike
FireClient(), this event does
not take a target Player as the first argument, since it fires to
multiple clients. Since this method is used to communicate from the server
to clients, it only works when used in a Script.
| Name | Type | Default | Description |
|---|---|---|---|
arguments | Tuple | Values to pass to all
OnClientEvent events
connected to the same UnreliableRemoteEvent. |
Returns
()
FireClient(player: Player, arguments: Tuple): ()#
Fires the OnClientEvent event
for the specific client in the required Player argument. Since
this method is used to communicate from the server to a client, it only
works when used in a Script.
| Name | Type | Default | Description |
|---|---|---|---|
player | Player | The client of the Player to fire the event to. | |
arguments | Tuple | Values to pass to
OnClientEvent events
connected to the same UnreliableRemoteEvent. |
Returns
()
FireServer(arguments: Tuple): ()#
Fires the OnServerEvent event
on the server from one connected client. Connected events receive the
Player argument of the firing client. Since this method is used to
communicate from a client to the server, it only works when used in a
client script.
| Name | Type | Default | Description |
|---|---|---|---|
arguments | Tuple | Values to pass to
OnServerEvent events
connected to the same UnreliableRemoteEvent. |
Returns
()
Events 2#
| OnClientEvent | Fires from a LocalScript when either
FireClient() or
FireAllClients() is called
on the same UnreliableRemoteEvent instance from a Script,
although this firing is not guaranteed even if one of the above methods
are called. This can occur due to packet loss or to maintain optimal
engine performance. |
| OnServerEvent | Fires from a Script when
FireServer() is called on the
same UnreliableRemoteEvent instance from a LocalScript,
although this firing is not guaranteed even if the above methods is
called. This can occur due to packet loss or to maintain optimal engine
performance. |
OnClientEvent(arguments: Tuple)#
Fires from a LocalScript when either
FireClient() or
FireAllClients() is called
on the same UnreliableRemoteEvent instance from a Script,
although this firing is not guaranteed even if one of the above methods
are called. This can occur due to packet loss or to maintain optimal
engine performance.
Also note that it is not guaranteed that the order of events will match
the order of FireClient() or
FireAllClients() calls.
| Name | Type | Default | Description |
|---|---|---|---|
arguments | Tuple | The parameters sent through
FireClient() or
FireAllClients(). |
OnServerEvent(player: Player, arguments: Tuple)#
Fires from a Script when
FireServer() is called on the
same UnreliableRemoteEvent instance from a LocalScript,
although this firing is not guaranteed even if the above methods is
called. This can occur due to packet loss or to maintain optimal engine
performance.
Also note that it is not guaranteed that the order of events will match
the order of FireServer()
calls.
| Name | Type | Default | Description |
|---|---|---|---|
player | Player | The Player associated with the client that the
FireServer() call
originates from. | |
arguments | Tuple | The parameters sent through
FireServer(). |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild