RemoteEvent
An object which facilitates asynchronous, one-way communication across the client-server boundary. Scripts firing a RemoteEvent do not yield.
Memory category | Instances |
---|
Member index 6
Description
The RemoteEvent object facilitates asynchronous, 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 RemoteEvent 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.
If you need the result of the call, you should use a RemoteFunction instead. Otherwise a remote event is recommended since it will minimize network traffic/latency and won't yield the script to wait for a response.
See Remote Events and Callbacks for code samples and further details on RemoteEvent.
Parameter Limitations
Any type of Roblox object such as an Enum, Instance, or others can be passed as a parameter when a RemoteEvent is fired, as well as Luau types such as numbers, strings, and booleans, although you should carefully explore the limitations.
History 18
- 614 Add
- 601 Change Superclass of RemoteEvent from Instance to BaseRemoteEvent
- 573 Change ReturnType of FireServer from void to null
- 573 Change ReturnType of FireClient from void to null
- 573 Change ReturnType of FireAllClients from void to null
- 483 Change Parameters of OnServerEvent from (player: Instance, arguments: Tuple) to (player: Player, arguments: Tuple)
- 483 Change Parameters of FireClient from (player: Instance, arguments: Tuple) to (player: Player, arguments: Tuple)
- 462 Change ThreadSafety of OnServerEvent from to Unsafe
- 462 Change ThreadSafety of OnClientEvent from to Unsafe
- 462 Change ThreadSafety of FireServer from to Unsafe
- 462 Change ThreadSafety of FireClient from to Unsafe
- 462 Change ThreadSafety of FireAllClients from to Unsafe
- 123 Add OnServerEvent
- 123 Add OnClientEvent
- 123 Add FireServer
- 123 Add FireClient
- 123 Add FireAllClients
- 123 Add RemoteEvent
Members 6
FireAllClients
Parameters (1) | ||
---|---|---|
arguments | Tuple | |
Returns (1) | ||
null |
Fires the OnClientEvent event for each client connected to the same RemoteEvent. 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 will only work when used in a Script.
Any type of Roblox object such as an Enum, Instance, or others can be passed as a parameter to FireAllClients(), as well as Luau types such as numbers, strings, and booleans, although you should carefully explore the limitations.
See Remote Events and Callbacks for code samples and further details on RemoteEvent.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of FireAllClients from void to null
- 462 Change ThreadSafety of FireAllClients from to Unsafe
- 123 Add FireAllClients
FireClient
Parameters (2) | ||
---|---|---|
player | Player | |
arguments | Tuple | |
Returns (1) | ||
null |
Fires the OnClientEvent event for one connected client specified by the required Player argument. Since this method is used to communicate from the server to a client, it will only work when used in a Script.
Any type of Roblox object such as an Enum, Instance, or others can be passed as a parameter to FireClient(), as well as Luau types such as numbers, strings, and booleans, although you should carefully explore the limitations.
See Remote Events and Callbacks for code samples and further details on RemoteEvent. See also FireAllClients() which works similarly but fires the event for each client connected to the same RemoteEvent.
Thread safety | Unsafe |
---|
History 4
- 573 Change ReturnType of FireClient from void to null
- 483 Change Parameters of FireClient from (player: Instance, arguments: Tuple) to (player: Player, arguments: Tuple)
- 462 Change ThreadSafety of FireClient from to Unsafe
- 123 Add FireClient
FireServer
Parameters (1) | ||
---|---|---|
arguments | Tuple | |
Returns (1) | ||
null |
Fires the OnServerEvent event on the server from one 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 will only work when used in a LocalScript.
Any type of Roblox object such as an Enum, Instance, or others can be passed as a parameter to FireServer(), as well as Luau types such as numbers, strings, and booleans, although you should carefully explore the limitations.
See Remote Events and Callbacks for code samples and further details on RemoteEvent.
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of FireServer from void to null
- 462 Change ThreadSafety of FireServer from to Unsafe
- 123 Add FireServer
OnClientEvent
Parameters (1) | |
---|---|
arguments | Tuple |
Fires from a LocalScript when either FireClient() or FireAllClients() is called on the same RemoteEvent instance from a Script.
See Remote Events and Callbacks for code samples and further details on OnClientEvent.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of OnClientEvent from to Unsafe
- 123 Add OnClientEvent
OnServerEvent
Parameters (2) | |
---|---|
player | Player |
arguments | Tuple |
Fires from a Script when FireServer() is called on the same RemoteEvent instance from a LocalScript.
See Remote Events and Callbacks for code samples and further details on OnServerEvent.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of OnServerEvent from (player: Instance, arguments: Tuple) to (player: Player, arguments: Tuple)
- 462 Change ThreadSafety of OnServerEvent from to Unsafe
- 123 Add OnServerEvent