Okay so I've been looking into modulescripts and I get the use of them, how to use require and all that. My only question is can I call a function from a modulescript within the MainModule using require(assetid) ? If so how because when I do require it returns the error saying the modulescript I am looking for is nil. Sorry about not providing any sourcecode rn, about to head out and figured I'd ask this real quick and get back to it.
Pretty much what I have is: MainModule>FireMagics(ModuleScript inside MainModule) I tried testing by using a print cmd just to see if it was working, mod = require(assetid) mod.FireMagics.Print("Success") . And the Print function is just a basic print(msg).
When I use require, does it not retrieve the children of MainModule and if does how do I access them?
I don't know if I got you right, but I'm assuming you want your MainModule to require a module parented to it.
So, first of all, make sure the module is a child of MainModule (like on this picture)
Now, if you want your MainModule to use that module, just use
require(script.ModuleScript)
or
require(script:WaitForChild("ModuleScript"))
in your MainModule.
(obviously replace ModuleScript
with the name of your module)