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

Can someone please tell me the difference between a Script, LocalScript, and ModuleScript?

Asked by 7 years ago

Someone please differentiate between these 3 type of script?

2 answers

Log in to vote
0
Answered by
thesit123 509 Moderation Voter
7 years ago

Local script: "A LocalScript is a Lua source container that runs Lua code on a client connected to a W server." - Roblox Wiki

Module script: "A ModuleScript is a Script-like object that contains code for a module." - Roblox Wiki

Normal Script: "A Script in ROBLOX is a type of object that holds a section of Lua code. A script will execute on the server and has access only to server-side events and properties." - Roblox Wiki

0
You should research into Robloxs' Wiki time to time. thesit123 509 — 7y
0
Heads up! If you learn to code in other languages, you will need a more detailed explanation of threads, environments, and other stuff that makes the differences between these scripts HUGE. Bellyrium 310 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

Since the other answer did not do a great job I'll try to be as vague as possible

LocalScripts can only run on the client side, meaning they can't urn in workspace unless they're inside of the character

Scripts can be run on any Server managed area. This means it's mostly used for server-side interaction, but cannot use things like game.Players.LocalPlayer

ModuleScripts are scripts that do not autorun, so at the end of the script you have to return something that can be called

Example

Inside the module script

local thing = 3

return thing

Inside the Script or LocalScript

local module = require(Place where the module is located)

print(moduld) -- prints 3

Answer this question