What’s the Difference Between a Local Script and a Server Script?

Sorry if this is in the wrong section

Hey Devs,
I’m a little new to scripting and I just realized that I don’t know the difference from a local script and a server script. I want to know where you can put them and what areas they will work in. Ex can a local script work inside a part in the workspace? Anyway any knowledge that you guys know, please tell!

1 Like
5 Likes

Oh thanks for that I guess I didn’t see it

A local script Is a script that runs on the client and preform client actions. For an example, let’s take a look at a Screen Gui button.

If we run this on the server → Whenever someone clicks it, it open the Gui for everyone

If we run this on the client (which is a local script) → when someone clicks it, it opens for them, and not for everyone.

This is client server relationships. The ‘client’ is each player in the server, and the ‘client’ is what the active player sees; while the server hosts the ‘world’ and is connected with the all the clients.

local scripts can run in starterGui and StartPlayerScripts. Server scripts run everywhere else.

Hope this helps!

6 Likes

Yes! This does help! Thanks for clearing it up

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.