I’m creating a module loader script, though I’ve faced some problems. When I use the .Get(ModuleName)
function inside the Module loader, which returns the loaded module, I can’t access its function names. For example:
Module Example:
local module1 = {}
function module1.Print(...)
print(...)
end
return module1
Loading Module:
local moduleLoader = require(path)
moduleLoader._Init(path.to.module1Folder) -- shared.Get = moduleFolder.Get
moduleLoader._Start()
shared._Get("Module1") -- I can't access the functions inside Module1
Module1.Print() -- Doesn't appear (typed as any)
I planned to create a module storing all types used by those functions, though is that the better way of doing so? It is necessary to have all types because I have lots of modules using OOP, and I can’t access methods and functions quickly, which is ugly and bad. Any help is appreciated ^^