I feel like I’ve been scripting pretty inefficiently just by coming on the devforum and seeing the ways people do things. A lot of things that I’m now realizing that shouldn’t be handled on the server are why some of what I’m trying to do is jittery. I want to start scripting smarter and make sure everything is going where they’re supposed to be. For the best results and optimization, what exactly should I be putting on the server/client?
Put thing such as game logic, player data management (DataStores), and anything that needs workspace
to be manipulated in the server. Anything that changes or manipulates the camera, GUI, or other effects that they can only see would be for the client.
Tip: Don’t trust the client for scripts you don’t want them to see.
Always have sanity checks on the server. Such as checking if someone has enough currency to buy this thing.
Use the sever for anything you don’t trust the client doing (most things) and use the client mainly for rendering.
He vital things you really need to know is dependent on what you want.
For example, if you want faster replication then you should do it on the server, or, if you want, you set the network ownership of the object to the local player, so it will look smooth on their screen.
Client sided objects include, but not limited to: all guis, client created values, the local character. Server sided objects include, but not limited to: studio made objects, server instanced objects.
Basically, the server should be handling anything that you want replicating to other players in the game, while the client should handle aesthetics, and anything unreplicated. The server also does checks on any vulnerable info the client sends the server.