Calling up a module script from a script?

I understand how to require a module script from a local script. However I am having difficulties in trying to require the module script from a server script. Is this possible?

I appreciate all your help. :slightly_smiling_face:

2 Likes

It depends where your Module Script is located.

If the module is in ReplicatedStorage, the server and the client can require the module.

If the module is in PlayerScripts, the client can require the module.

If the module is in ServerScriptService, the server can require the module.

If the module is an uploaded module, the server can require the module.

6 Likes

There’s no difference in requiring a ModuleScript from a server and from a client. However, beware:

  • Data returned by your module is separate per-client and on the server. Making changes to it on any client does not replicate to the server, nor vice versa.
  • If you want to provide a ModuleScript to both clients and the server, you should place it in ReplicatedStorage.
2 Likes

Thank you wevetments and Flubberlutsch, your answers were very useful.

3 Likes