Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What is the difference between a local script and a normal script?

What is the difference between a local script and a normal script. Also what are the advantages

2 answers

✓ Accepted answer

Introduction & Understanding


The reasoning behind this the existence of difference, is mainly due to FilteringEnabled. Before continuing, please learn more about this by watching this quick video covering a bit of FE, and some reading. It’s mandatory you gather a collective knowledge on this as it is an imposed requirement as of ROBLOX’s Experimental Mode update of early September 2017. It’s also quite interesting and can increase performance between both the Client and the Server.


FilteringEnabled prevents automatic communication of LocalScripts to ServerScripts, primarily to reduce the probability of exploitation. Though because of this, these Scripts have been ultimately divided into their proper relationships.

####LocalScripts - Client

####ServerScripts - Server

Meaning that any work related or directed towards these categories can only be achievable accordingly. Though loopholes can achieve some amount of work in its opposite.

FilteringEnabled doesn’t fully cut off communication though, it only prevents automatic communication. You can learn how to gain manual connection between these Scripts with RemoteEvents


Downsides of Filtering Enabled?

There is a downside that comes along with FE. LocalScripts will no longer replicate information or modifications made on the Client to all other connected Users. E.g. If we decided to reset a Player, this will only occur on their screen. To work around this issue, we have to handle work that requires all connected Clients to experience a modification—as resetting a user—within a global environment (Server). As mentioned above, this is done to prevent exploitation, so that one malicious Player cannot ruin the experience for everyone else

A normal script is run on the server, an exploiter cannot modify the values and stuff inside of a normal script (except it can be deleted if it's parented to something the player's character). Server scripts cannot reference the LocalPlayer because it is run on the server. Normal scripts are used to do things that will replicate on the server (everyone can see). LocalScripts are run on the client, you need them so that the player can do stuff. LocalScripts are used to get player input, fire remotes etc. Because of filtering enabled, most things done by a LocalScript will not replicate to the server (others can't see).

This discussion is preserved as it was. New answers, comments, and votes are closed.