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

Why we actually need to use remote events/functions?

Asked by 4 years ago
Edited 2 years ago

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

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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).

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. XxTrueDemonxX 362 — 4y
0
Thank you! User#27525 1 — 4y
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. EmilyBendsSpace 1025 — 4y
Ad

Answer this question