Module Not Working As A Global Table

Im using a module to store pet states

Module Script :

local ReplicatedTables = {
	States = {},
}

return ReplicatedTables

Server Script:

local StateHolder = require(game.ReplicatedStorage.Modules.ReplicatedTables)
StateHolder[plr] = "None"

The problem is that the script below returns {} (an empty table)
Local Script:

local StateHolder = require(game.ReplicatedStorage.Modules.ReplicatedTables)
print(StateHolder)

Server scripts and local scripts cannot share data between modules (that would be a security risk). I’d recommend using attributes or value bases.

1 Like