Is ServerStorage a good place to put server sided modules?

  1. What do you want to achieve? I am putting Server Sided Modules in my game and make them work as expected

  2. What is the issue? I got confused because ReplicatedStorage is for both Client and Server to access and modules are mainly put there, and there is a server version of it called ServerStorage but people put server sided modules in ServerScriptService even though it’s for scripts with RunContext Legacy or Server

  3. What solutions have you tried so far? I looked through the forums but it doesn’t say anything about ServerStorage

-- This is a scripting question, not help for debugging

So basically, I want to use Server sided modules in my game, and I got confused on where to put it, I have two choices, ServerStorage and ServerScriptService

1 Like

You put your ModuleScripts into ReplicatedStorage if you want the client and server to be able to access them. If your ModuleScripts are only going to be accessed by the server then you can put it them in ServerStorage or ServerScriptService.

Your solution still causes the confusion which is what I don’t want

If your ModuleScript will only be used by the server you put it in serverstorage or serverscriptservice, otherwise replicatedstorage.

How so?

Client and Server Access = ReplicatedStorage
Just Server = ServerStorage

2 Likes

ServerScriptService is made for scripts, and a ModuleScript is a script. ServerStorage is meant mainly for objects. If you put scripts there they will not execute as it is just a storage area.

1 Like

Then why do we store modules in replicated storage?

So they can be accessed by the client and server.

As noted above, if you must access that ModuleScript from both the client and the server because it is shared code it must be in ReplicatedStorage.

It’s mostly about preference than anything.

If a Module is going to be utilized by just one Script, I parent the Module under that Script. If the Module is going to be used by multiple Scripts, I parent the Module under ServerStorage.

For me, I prefer ServerStorage for Modules since they don’t run until you require() them anyway. For more organisation, I add a Folder in ServerStorage and put server-sided Modules somewhere in that Folder.

4 Likes

Yeah I already explained that lol

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.