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

Why we actually need to use remote events/functions?

Why can't we access client information with scripts instead of giving it with remotes? It would be a lot more practical to get the info directly. Is there a reason why we need to send this information with remotes instead of getting it directly?

1 answer

✓ Accepted answer

To just directly and synchronously use values from a client without delay means that everything you might possibly want to access from a Server script--every Lua-accessible value--would have to be constantly replicating from all clients, and the server would have potentially tens or even hundreds of clients' complete datamodels in memory all the time. That's obviously a terrible waste of both server memory and replication bandwidth.

A RemoteFunction gives you the ability to selectively fetch just the values you need from a client, only as often as you need them. RemoteEvents can be used even more flexibly for a query and response that's totally asynchronous (not having to yield the script like a RemoteFunction), and can often get the same data a little quicker than a RemoteFunction (I don't know the precise implementation detail that is the reason for this).

3 comments

0

If I remember correctly, these were also important to help deal with Roblox's horrific exploitation and cheating problem. To prevent client side changes, something that can easily be adjusted or tweaked by a player, from replicating over to the server. It's not a perfect system but it definitely has reduced the number of The Flashes we see nowadays in games.

0

Thank you!

0

Yes, automatic replication of things from client to server--and more specifically allowing the replicated values to change the server game state without a means for developers to intercept and validate--was what made exploiting so easy.

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