Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Filtering Enabled, send string from server to client?

Asked by
Cuvette 246 Moderation Voter
6 years ago

Just a quick one, is it possible for me to send a string from the server to the players Gui on their client? For example a message from the server to the client saying hello and then updating the players textlabel to say hello?

If this is possible can somebody explain the easiest way to do this, thanks in advance.

1 answer

Log in to vote
1
Answered by
Mayk728 855 Moderation Voter
6 years ago

Of course it is! Here's an example:

Server; Telling all the clients a string

local RemoteEvent = game.ReplicatedStorage:WaitForChild('RemoteEvent')

RemoteEvent:FireAllClients("Hello client!")

Client(s); receiving the string

local RemoteEvent = game.ReplicatedStorage:WaitForChild('RemoteEvent')

RemoteEvent.OnClientEvent:Connect(function(Argument)
    print(Argument) --Prints the string "Hello client!"
end)
0
Wow that was too easy. I just overthink when it comes to using FE. Thanks! Cuvette 246 — 6y
0
No problem! :) Mayk728 855 — 6y
Ad

Answer this question