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

what does replicating things into the client mean?

Asked by 6 years ago

does anyone know what is replicating something into a client, because FE makes that u cant replicate things into the client (I might be wrong lol), so can someone do an example, so i know when to use remote events lol.

1 answer

Log in to vote
1
Answered by 6 years ago

Hi there! You're correct, FE means that you, the client, cannot change any server-sided value (with the most recent update to Roblox, FE is permanently on). With remote events and functions, you can, whether the client is communicating with the server, or vice versa. Here's an example:

Script located in client-sided buttongui

script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.RemoteEvent:FireServer("Button clicked!")
end)

Script located in ServerScriptService

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, text)
print(text)
end)

The server should print "Button clicked!", assuming that a remote event in located in replicated storage. This allows for the remote event to be commutative. I'd also like to mention that remote functions and events always contains a player argument. Hope this helped!

0
Adding on to this answer, here's a useful link on how and when to use Remote Functions and Remote Events: https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events lunatic5 409 — 6y
0
does the script always need to be in serverscriptservice User#23365 30 — 6y
0
No, it can parent any service that runs scripts, take the workspace for example. SnazzySpider67 53 — 6y
0
ok, thanks User#23365 30 — 6y
0
Of course! SnazzySpider67 53 — 6y
Ad

Answer this question