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 Script (Regular)?

As I said before, I have many questions about scripting. But one of my most best questions is what is the difference between a local script and a regular script? I really need to know this one because since a script can do whatever a local script can do, but in likewise it can't, then what are the differences between the two? Could anyone answer this?

1 answer

✓ Accepted answer

A server script(the regular one) is ~= local script.

##LocalScript

These MUST be in ether replicated first, or the player. StarterGui, StarterPlayerScripts and StarterPack clone all of their items into PlayerGui PlayerScript and Backpack respectively, all areas localScripts can go into. They are used for handling player Input, the following script should not be used in a server script.

game:GetService("UserInputService").InputBegan:connect(function(key)
	if key.KeyCode == Enum.KeyCode.Q then
		print"Q has been pressed!"
	end
end)

Server scripts would not do with this at all. LocalScripts are also for handling gui's, and tools.

##ServerScript

These scripts should be in serverScriptService, but can be in workspace if you feel like using lighting for storage, or starterGui for tools. They handle things like the workspace. And dataStores. Not really too much to say on these

##For FE games

For FE games, the maker has to have knowledge of both scripts, and their part in FE. Say I made a part using a localScript and put it in the workspace. It gets made when Mouse.Button1Down. It would only appear to the player who clicked,if the player stands on it, the other players would see that one player floating. To have that part be for all players, the server has to make it. Yet another difference between them.

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