Is there a way to require something from another module script?

So say we had one module script that defines something. For example:

local childmodule = require(script.ModuleScript)
local Admins = {"C4LEBS"} 

And we want to grab that and use it inside of another module script. How would we do it? Would it be like this:

local parentmodule = require(script.Parent)
local getAdmins = parentmodule.Admins

I’m not really sure how. If you do know, please do let me know!

1 Like

Define it as a value inside of the returned module table, something like:

-- parent module
local Foo = {}
Foo.Bar = {"C4LEBS"}

return Foo
-- child module
local Foo = require(script.Parent)

This should also be moved to #help-and-feedback:scripting-support


This helped a lot, thank you so much!