#Whats is the use of module scripts???
1 messages · Page 1 of 1 (latest)
module is for templates so that you could use them on your serverscript.
for example:
ModuleScript:
module = {
hp = 100
}
serverScript:
module.hp
thx
A module script is often used to organize code. They are most commonly filled with functions (or classes with their inherited functions). You can technically make almost everything they do in 1 script but this would have 2 downfalls:
- A larger system would get insanely large scripts, we're talking about going into the tens of thousands of lines of code in a single file. Which is really hard to navigate compared to 10 files of 1k lines each.
- A module script can be used to easily share functions between scripts. Say you've a util script to e.g. convert numbers into "readable numbers" (5543438 -> 5.5 mil), then you just need to have 1 module with such a function. And then you can easily request the module in any script (e.g. if you place it in RS, then both local and server scripts can access it), and you only need to write said function once
i really needed that
I needed help about orienting i uploaded it already
Organization, custom libraries, and custom objects