Client Sided versus Server Sided FULL EXPLANATION

Very recently, I’ve been seeing various issues in the help and feedback section about the client side or server side and thus, I’ve decided to step in and teach you all!

Client Sided -----|------.VS.—|—Server Sided

Differences -----------------------.AND.---------------Similarities

–|Differences|–

Client sided appears locally on
the client hence the name local
script.

Server sided scripts sends
a communication to the server
telling it to communicate
whatever code to the rest
of the clients and hence the name
that we call it: Server Script.
A client-sided script CANNOT
differ the server because of
FLITERING-ENABLED
unless your talking about a
RemoteEvent.

–|Similarities|–

They both send communication
to one.
They’re both able to preform
activities on a client such as a
local script can preform activity
on a single client while server
scripts can preform activities on
multiple clients.
They can both communicate
to each other with the use of a
https://developer.roblox.com/en-us/api-reference/class/RemoteEvent

** FLITERING-ENABLED AND SCRIPTS ACCESS**

Now we’ve covered the similarities and differences, let’s talk about their accesses and Filtering-Enabled.
Filtering-Enabled disables a local-script(client) to be able to change the server. Ever since that has been released, it has prevented exploiting but also caused havoc on people who need it. That’s when you can use a RemoteEvent. Now this post is not dedicated to remote events but I’ll show you a picture of how Filtering-Enabled looks like:


The local scripts represent the clients.

Now let’s look at the limited script accesses. Local scripts will sometimes not run with no errors if placed in the wrong type of script and it’s the same with a server-script.

Server - Script Limits

A server script cannot access the mouse and it’ll lead to this error: Attempt to index :GetMouse() nil or GetMouse() is not a valid member of local player. Why’s that you ask? Well the mouse is an instance of the client and NOT the server and thus, it creates this error.
The server can access the client and it’s descendants, but not instances that are specific to that client, such as their mouse and user input.

Local - Script Limits

First off, a local script CANNOT access things from the server. It cannot access ServerStorage or ServerScriptService. It also cannot access the player’s displayname which I’m actually clueless about but it could be that it’s held at the server.

Server-Script Short explanation

A server script requests a server to communicate all of the following code to the reset of the clients. It cannot access client instances such as the mouse and camera.

I’m not doing a local script explanation since the filtering enabled image is enough.

Vital information from a script unable to be reached

Let’s say you want your server-script to be able to access the mouse. Well then use a RemoteEvent. If you’re willing to learn how to do that click the article or click the arrow here

RemoteEvent

Local script:

local remoteevent = game:GetService("ReplicatedStorage").RemoteEvent
remoteevent:FireServer(game.Players.LocalPlayer:GetMouse()) -- sets the arguement

Server script:

local remoteevent = game:GetService("ReplicatedStorage").RemoteEvent
remoteevent.OnServerEvent:Connect(function(mouse) -- gets the parameter from game.Players.LocalPlayer:GetMouse()
-- do whatever
end)

When do you use either of these scripts?

For making a gui, use a local script. For using data store service, use a server script. For using UserInputService use a local script. You get the drill now, local scripts for client based things(that only appears or occurs on 1 client) and server scripts for editing servers and all of the clients.

If there’s anything wrong with this or that I’ve forgot to implement, please let me know but other than this peace out!

2 Likes

Not true. Only the server can perform actions on all clients. A specific client can only perform actions on itself.

The image shows no replication between the server and the client, which isn’t true. The image should block client-to-server, but allow server-to-client.

This is not true. You should change this to “The server can access the client and it’s descendants, but not instances that are specific to that client, such as their mouse and user input.”

2 Likes

Thanks for the feed-back but the first and second things are wrong. Well kind of wrong. I accidentally added a plural to client and the local script in the image is the clients. The image was meant to show when a client gets edited, it doesn’t show to anyone else so it doesn’t communicate to the reset of the clients or the server.

1 Like