Replicated storage server to client replication (regarding module scripts)

Hi,

I have what I believe will be a quick question.

I have a module script in replicated storage, i wish for both the server and client to use the functions of this module however i am cautious of the effects that the server can have on replicated storage to the client.

For example, I have ModuleScript in replicated storage. Both the client and server use this module script. ModuleScript stores values for each side to use separately. So would changes to values on the ModuleScript from the server replicate to client? If a player joined later on and required this module would it be populated with existing data?

In my context I have a cooldowns script which is used on client and the server. this is so that the server isn’t called excessively by the client side so cooldowns are additionally officiated on the server side. Their both using the same script within rep storage. Both server and client are using the same script so is it safe to require it from replicated storage and their instance stay seperate??

From what I know about my question at this time, I believe that the module script in question will replicate the changes that the server has made to it it to the client.

Thank you!

1 Like

No, it should be isolated for the server and each individual client (from my knowledge). When you first require a ModuleScript, it caches the result for the next require to use. I wouldn’t expect the server to replicate that cached result onto each client that would join later on, and I think it would be dangerous for the client to be able to replicate its cached result to the server, since exploiters could tamper with it.

3 Likes

You can use Knit framework, really helpful to client-server communication

Thank you for pointing this out. stressing about nothing hahah

1 Like

Fur further clarification on the issue I was facing: Variables not updating on the client, even though their in replicated storage - #3 by Swetch29

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