Hi there, I was attempting to help someone with scripting when they showed me their method of implementing server scripts and remote events.
He made the script and remote in the starter GUI (along with the respective GUI). This means every player has a server script and remote for themselves.
The function of the script is using insert service to spawn something.
My usual method of doing it is having a single script in Server Script Service handle the logic and a remote in Replicated Storage accessed by every player.
Is either of these methods better than the other? What are the implications of using each?
1 Like
There isn’t any definite answer to this, but I usually go with Option B. Think about this way; ideally you want your code to be only not only readable but also fluid in performance.
In the scenario you provided, a remote event for each individual doesn’t seem that bad. Right?
I would think so too. Generally, if multiple players are calling the same remote “x” amount of times every few seconds, then it could become a bit of an issue. So yeh frequency in how often you’re calling a remote can be a factor for latency, especially when called at such high rates. On the other hand, the amount of events used doesn’t hamper performance; it’s how you utilize them that matters. I believe.
In the case that you’ve provided, there’s no right answer. One remote event for each player isn’t much of a big deal, but generally, I like to use multiple events that can be accessed by all clients because it’s a systematic way of controlling for said purposes as well as networking my remotes in directories such as ReplicatedStorage. But if were, to be honest, some time’s it’s a mix. In regards to your script, I’m not entirely sure. I usually have one server script to handle all of that. I also have to question why you would need to do that? It’s just seems strange to have a server script there.