Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What's the difference between a Script and a LocalScript? [closed]

Asked by 5 years ago

This question already has an answer here:

When not to use a LocalScript?

I want to know when to use either of the two scripts, but I don't know the difference between them so I don't wanna mess up.

0
LocalScripts are usually used to modify stuff with players. ServerScripts/Normal Scripts are, yknow, normal scripts. I'm also pretty sure [but don't 100% know] LocalScripts are the only way to modify stuff for 1 client. AAzterr 27 — 5y
0
ServerScripts are recommended for most actions though AAzterr 27 — 5y
0
Thank you. Incinerxte 2 — 5y

Marked as Duplicate by User#24403

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?

2 answers

Log in to vote
0
Answered by 5 years ago

I will just copy another guy's answer:

" - Script: This runs Server-Sided, (On The Server). This uses Server-Sided events and properties.

  • LocalScript: This runs Client-Sided, (On Your Computer). This uses Client-Sided events and properties such as getting the player with game.Players.LocalPlayer or getting the camera/mouse.

  • ModuleScript: This is a bit different but it's similar to Script except for:

1) Doesn't run the code the instant the game is started, only when calling require.

2) You can make a Function in ModuleScript and use it multiple times in multiple other scripts.

Don't be afraid to look at the wiki for even better answers! "

------------------ alphawolvess

Ad
Log in to vote
0
Answered by 5 years ago

Localscripts deal with client side related things. For example: If you spawned a part with a localscript, it would only replicated/show to the client only. A way around this is to fire Remote Events, these can be read only by the server scripts.

Serverscripts deal with server related things. Everything you do in a serverscript will replicated/show to ALL clients. You can use these to read Remote Events being fired.

It's really that simple, there's a tiny bit more; some stuff on the server cannot be read on the client, (PlayerGui stuff for example). That's really it!

(I suggest looking at the developer post here for more info on Remote Events. https://developer.roblox.com/articles/Remote-Functions-and-Events)