Ad
Log in to vote
5

What is the difference between LocalScripts, regular Scripts, and ServerScriptService scripts? [closed]

Asked by 7 years ago

I'm a bit new to scripting, and I really didn't learn the technical stuff. What is the difference between a LocalScript, and a regular Script? What does a script running in the "ServerScriptService" do differently than one running in the Workspace?

I just want a clear explanation of this kind of stuff, and as detailed as possible. Thanks!

Locked by adark and Shawnyg

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
7
Answered by
adark 5477 Badge of Merit Moderation Voter Community Moderator
7 years ago

First of all, the ServerScriptService is the 'container' for pretty much all Scripts. When placed there, they will act just as if they were in the Workspace, directly, but with a different Parent. It's a good idea to put your Scripts in there whenever possible for both organizational purposes and a tiny bit of security - ServerScriptService doesn't replicate to any Client.

Now, LocalScripts are, well, Local. They run on the Client, whereas normal Scripts run on the Server. This lets you use certain Client-only things such as Camera Manipulation, custom Input Bindings and Mouse stuff. They also let you use the RenderStepped Event, which updates exactly at the framerate of the Client, allowing for perfectly smooth animations and whatnot.

Anything that requires an external connection, such as the MarketPlaceService and the various other services that allow interaction with the ROBLOX site, need to be in Scripts.

LocalScripts will only run in three places: the PlayerGui (in which I should mention Scripts will not run, if you have FilteringEnabled set to true), the Player's Backpack, and the Player's Character model. They do not have to be direct children, only descendants.

Scripts, on the other hand, will run as descendants of Workspace, nil (at least until garbage collected), again the Player's Backpack, and the ServerScriptService.

0
Thanks! SlickPwner 534 — 7y
Ad
Log in to vote
2
Answered by 7 years ago

I can't explain the ServerScriptService script.But i can do normal scripts and localscripts. Localscripts Localscripts will only run for one player. Normal scripts Normal script run for the whole server