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?
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,
01 | function hi() |
02 | print ( "wut" ) |
03 | function bye() |
04 | print ( "wut" ) |
05 | function bye() |
06 | print ( "wut" ) |
07 | function sup() |
08 | print ( "wut" ) |
09 | function ninja() |
10 | print ( "wut" ) |
11 | function forever() |
12 | print ( "wut" ) |
13 | function nwentyone() |
14 | print ( "wut" ) |
with functions everywhere, you would want to use a modulescript.