2 scenarios:
ModuleScripts
have no side in the Client-Server model
by default, they run inside the context that they are required
in.
Whenever you require a ModuleScript
, you should imagine it being run inline in that very location.
With this in mind, if you plan on only requiring a ModuleScript
from a LocalScript
, you could use Client-side
services like UserInputService
within your ModuleScript
. Similarly, if you only require a ModuleScript
from a Script
, you would be able to manipulate objects within ServerStorage
from your ModuleScript
.
However, some people create Utility Modules
that can be required by both a Client
and the Server
. This is achieved by the ModuleScript
being located in ReplicatedStorage
, and also it not containing any code that is side specific.
They are both sided, though, if I remember correctly, if you changed data of a module script on a server script, it won't replicate to the client, meaning the changes won't apply to the client.Same thing for the client, if a module script is changed on the client, it will stay the same on the server side