This module is a super simple one which allows you to require as many modules as you’d like at a single time.
Here’s an example of it’s usage:
local Import = require(path.to.module)
local Module1,Module2,Module3 = Import(path.to.one,path.to.two,path.to.three)
Source code if you want to use it:
function Import(...:ModuleScript)
local ModulesToImport = table.pack(...)
local ImportedModules = {}
for _,module in ipairs(ModulesToImport) do
if not typeof(module) == "Instance" or not module:IsA("ModuleScript") then warn("Failed to import",module,"(not a ModuleScript)") continue end
local ImportedModule = require(module)
if not ImportedModule then warn("Failed to import",module) continue end
table.insert(ImportedModules,ImportedModule)
end
return table.unpack(ImportedModules)
end
return Import