Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I use Private Modules?

I know how to use ModuleScripts, but I'm unsure as to how exactly I would use a private module.

Would I use it like a normal ModuleScript, or would the private module run its own code, or what?

1 answer

To create a private Module

Create a standard ModuleScript, and make the name of it MainModule. Upload it to Roblox, and you're done.


To use a private Module

Just do require(moduleId) and it will load in the module for you. This only works on Roblox servers, so you won't be able to test in Studio if you're using it.

2 comments

0

I know that much, but do I need to use it like a normal ModuleScript, or will it run itself?

0

"Just do require(moduleId) and it will load in the module for you" - What do you think, genius? Of course it's used like a normal ModuleScript: That line requires it in.

This discussion is preserved as it was. New answers, comments, and votes are closed.