Recently, I learned a lot about frameworks and just structure in scripts in general.
I know that some devs including myself like to have one main server script in serverscriptservice and have a bunch of module scripts beneath it.
But my question is what code should that main server script contain?
I thought of just doing this:
for i, Script in script:GetChildren() do
require(Script)
end
Is this acceptable or is this a too little amount of code?
you’re importing modules without variables to store what you’re importing.
local modules = {}
for i, Script in script:GetChildren() do
modules[Script.name or your equivalent] = require(Script)
end
BUT
consolidating all server tasks into one script leads to difficult to maintain code and even performance problems.
You need to have a clear purpose and mechanism for what ever system you’re programming. From there, you can divide up the components into multiple scripts.
Thanks for replying, but I actually already found a solution. But now you mention it, its indeed true that having one server script that executes all the code might be bad performance wise, thank you for the insight, Ill try to fix this somehow tho.