Parenting a table to multiple tables?

image
as u can see, Print (module) is being parented to Library which works completely fine except i wanna be able to parent more module scripts beside print so i would only need to call the function through library instead of requiring each module seperately, is that possible?

1 Like

Are you asking for something like this?

-- main module

local module = {}
local dependencies = require(script:WaitForChild("Dependencies"))

--[[
now you can access the modules by just indexing their names through 'dependencies'

e.g.
dependencies.Module1.TestFunction()
]] 

return module
-- dependencies module (child of main module)

local dependencies = {}

-- these are just examples, but you can add as many as you want
dependencies.Module1 = require(script.Module1) 
dependencies.Module2 = require(script.Module2)

return dependencies
1 Like

close enough but not quite, i managed to make it so all i would need to do is :
dependencies.Module1.FunctionName() but what iā€™m looking for is to make it even shorter so it becomes :
dependecies.FunctionName()
note that FunctionName would be a function in a different module

1 Like

Well why not just merge all your modules into a single one?

1 Like

oh i did this
image
and it actually worked!