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

Should I use a module script?

I personally have no experience with module scripts. I know what they're used for but I would need to learn it.

I'm making a GUI that when you click the buttons, it appears into everyones PlayerGui. I've got the script done (if we're using a normal script of course) and it works. Would it be more clean if I were to use the ModuleScript though?

1 answer

✓ Accepted answer

First, to decide whether to use one or not, let's see what a ModuleScript actually is.

A ModuleScript can only be activated by using require in your main script.

If your script is, for example, 1,000 lines, you would want to use a module script to clean it up, making it look more professional and less messy.

If your script is like this,

function hi()
print("wut")
function bye()
print("wut")
function bye()
print("wut")
function sup()
print("wut")
function ninja()
print("wut")
function forever()
print("wut")
function nwentyone()
print("wut")

with functions everywhere, you would want to use a modulescript.

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