RemoteEvent/OnClientEvent for the specified player. Only connections in
LocalScripts that are running on the specified player’s client will fire. This varies from the RemoteFunction class which will queue requests.
Since this function is used to communicate from the server to the client, it will only work when used in a
The functionality of this function, as well as other
RemoteFunction events and functions, is well documented in this article.
Data can be passed from server to client through remote events in the same way data is passed from client to server. Any extra information can be passed in as arguments to the FireClient and
RemoteEvent/FireAllClientsfunctions. Note that the FireClient function still needs to pass the player to send the message to as the first argument.
Sometimes a game will need to send information from one client to another. Roblox does not support direct client to client contact, so any communication must first go through the server. This is typically done using remote events (although functions could be used if desired). First, the sending client would call FireServer. On the server, the function connected to OnServerEvent would hear this firing, and itself would then call FireClient.
The arguments passed to the
RemoteEvents: Server to a Single Client
The server can send messages to the client through remote events in two ways: it can send a message to an individual client or it can send a message to every client at the same time.
In order to send a message to a single client, the FireClient function should be called from the server via a
To listen for the message on the client, a
LocalScript needs to connect a function to the OnClientEvent event of the RemoteEvent.