How do you use ModuleScripts?

  1. What do you want to achieve?
    I want to know how to use ModuleScripts.

  2. What is the issue? Include screenshots / videos if possible!
    All the server scripts and local scripts are making my explorer messy, so I want to benefit ModuleScripts to be able to reduce the use of server scripts and local scripts and have my explorer be more clean.

  3. What solutions have you tried so far?
    The reason I asked it here is because I can’t access DeveloperHub.

Also,note to myself,please do not ask people to write entire scripts or design entire systems for me. If I can’t answer the three questions above, I should probably pick a different category.

sorry im new i dont understand

If you want a simple example, they are scripts that run once depending on which machine they are required on. They return one value which can be used in other scripts, for example, to make some sort of common class, library, or toolkit that you will use throughout other scripts. It can also split tasks apart, for example, having vehicle handlers in one module, saving in another module, and main framework that keeps track of both of them and can use functions provided by them.

1 Like

thank you for helping 30chars30chars

If u execute a modulescript function from local script, does it replicate?

If it is required on the client, it will run one time on that client and that same value will be returned.

If it is required on the server, it will run one time on the server and that same value will be returned.

so it doesnt replicate to the server?

It does not. You need remotes if you want to replicate.