Changes to Tables in ModuleScript on Server not replicating to Client

I am using a ModuleScript to track data on the player’s character, through a table that can be updated using functions on the server side. But when I intend to read the data in the table on the client side using either a function in the ModuleScript that checks if tables have entries, or a direct reference to the table, the table is empty (which is the original state of the ModuleScript) even when I have added entries to the table. How would I go about fixing this? Or is this a limitation of using ModuleScripts for storing data? Thanks in advance!

Are you using just a normal module script i.e:

local Data = {}

Data._Data = {}

return Data

Or are you using global tables/shared.

Also what kind of data are you trying to replicate/transfer? (Obviously the character but things like position and that.)

When a script/localscript calls require() on a modulescript. The modulescript’s source code is copied and sent to the script that called it as a table/ value. So when you require the module on a server, change data, then require it on the client, you are getting a brand new copy of that modulescript on the client.

I suggest you replicate your values using remote’s on a by change basis by sending the necessary client/'s data/'s when a value changes.

Im using a normal module script like this:

local Data = {

Something = {},
Something2 = {},
Something3 = 100,
Something4 = true,

}

return Data

If that’s the case, I think I might just use Value objects instead of a ModuleScript to store the data that needs to be read from the client. This is to make sure that the data can be read from both client and server.

But this behavior means that data stored on a ModuleScript cannot be read at all by the client, which is something I think would be useful for the type of game I am making.