Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

what does replicating things into the client mean?

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

✓ Accepted answer

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!

5 comments

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

0

does the script always need to be in serverscriptservice

0

No, it can parent any service that runs scripts, take the workspace for example.

0

ok, thanks

0

Of course!

This discussion is preserved as it was. New answers, comments, and votes are closed.