What's the point of having a script that loads all modules, instead of just having normal scripts? Alot of games do it

Not really sure what the point is to be honest

2 Likes

I think it’s so they can make sure there is no errors, and they might call some Init subprograms after requiring them so the module can initialise anything it needs to properly. To be honest, I don’t really get what you’re asking.

Do you mean like what is the point in modules?

Modules are really good because they allow you to organise your scripts. They make your code a lot easier to read and debug, and it means everything inside of them can be accessed from other scripts. This not only means good ease of access but also means your code is robust and structured.

They are exceptionally important for OOP systems, because otherwise your code would get really, REALLY messy.

Can you elaborate a bit on your request?

Why do people use “God scripts”, like they have one server script, one local script, which require modules and require modules only, them modules then have all the code inside of them, rather than having any code inside of the normal scripts, it just seems kinda pointless, but alot of people do it

You can’t control the order in which scripts run. When you use one script and the rest is in modules, you have precise control over the order in which different pieces of code run.

Modules also allow easy communication and data sharing. You could use BindableEvents, BindableFunctions, value instances and attributes for this but they have limitations compared to the possibilities that modules give. You can have functions and events inside the table returned by a modulescript (or the module can just return a function, event or any other value). These events don’t need to be BindableEvents. They can be custom luau events that allow you to avoid the problems of BindableEvents.

1 Like

Module scripts can jse require for maybe like base class or bomb oop modules

you are not me lil boyo :cry: :sob: :sob: :pray: :pray:

jk

1 Like

It automatically gives you a massive ego and makes you seem professional

1 Like

I get that reference lol you are good for that reply