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

What is the point of doing onserverevent:connect(function(...)?

Asked by 3 years ago

I've seen people doing this a lot, and I don't see the point. What is the point of it?

0
so when a remote event triggers you can use it in a server script to know when it fires FrontalDev 17 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

Basically, things that the server changes can be seen by all clients. But if a client changes something it'll only work for them. In some cases, you want the server to do something when something happens on the client, to accomplish this we can use RemoteEvents. This lets a client fire a function which the server can detect and read.

I'd suggest reading this article regarding the Client-Server Model, it goes quite in-depth when it comes to your question. If you have any further questions you can just comment on this post.

Ad

Answer this question