Is OnServerEvent / FireServer Better then OnClientEvent / FireAllClients?
I need some help figuring this out! Thank you.
Is OnServerEvent / FireServer Better then OnClientEvent / FireAllClients?
I need some help figuring this out! Thank you.
They have completely different uses. One pair is for communicating information to the server, and the other for communicating to the client.
The API and related pages might explain it better.
Not that! Trying to reduce lag, for example in my ELS System I have this
:FireServer(âELSâ)
Etc
As she said above, you canât pick a lag-reducing option as they both have different uses.
They are not optional.
Not to repeat whatâs been said, but they are used for completely different purposes and so âwhatâs better?â is a very ill-formed question.
As far as reducing lag, which signal is fired really does not matter. Both FireClient and FireServer take in some arguments, convert them into JSON strings and send the data over the network. The receiving machine (server/ your computer) picks it up, converts it back into a RBX type and invokes the signal handler function you connected with either :OnServerEvent or :OnClientEvent.
If you have issues with remotes and lag, then you might be sending remotes very frequently or with large amounts of data.
Thereâs no better one. You will need to use them both depending on what you are doing. You canât exclude one for the other, itâll make scripting harder
Just a heads up - since this is more of a scripting related question, itâs been moved to scripting support.