I am trying to make a module loader but I have a very ugly issue right here
If you try to paste this code in studio
-- Make sure the game is loaded before actually loading it
if (not game.Loaded) then
game.Loaded:Wait()
end
-- (EDIT)
local ServerScriptService = game:GetService("ServerScriptService")
local Server = ServerScriptService:WaitForChild("Server")
local Services = Server:WaitForChild("Services")
local self = {}
self.Services = {}
self.Inserted = {}
local function Init()
for _, Module in pairs(Services:GetDescendants()) do
if (Module:IsA("ModuleScript")) then
self.Services[Module.Name] = Module
table.insert(self.Inserted, Module.Name)
end
end
for _, Name in pairs(self.Inserted) do
print(Name)
local m = require(self.Services[Name])
m:FixonInit()
m:FixonStart()
end
end
Init()
it will only run and print 1 Module
and without require it prints every module name
been debugging this since morning bruh