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

I am confused with module scripts, what should be located inside there?

I'm trying to become more organized. If for example, I have a ton of moves, let's say one spawns a brick. Should the brick spawning be done in a server script or module script? And what should be done in a module script?

1 answer

✓ Accepted answer

Module scripts can be used in many ways.

Communicating between scripts, Storing functions that are accessed by multiple scripts, Some are even just used for data storage like tables that you need.

You can find your own way to use it in the way you like it the most.

ModuleScripts are just tools for the scripts, you can require them and use whatever they have.

If a localscript requires the module then it will also have the properties of a localscript, (stuff like being able to access localplayer but not replicating across the server), the opposite goes as well. If you require it with a server script it will have the properties of one.

Let's say you have 2 scripts that use the same function, you can put the function inside of the modulescript and then require it.

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