I am working on a game that needs to store data in a table, I would use StringValue and parse it to JSON but it is slower and takes more lines of code.
I tried putting the data in a modulescript to require it with multiple scripts, but requiring the modulescripts returns the raw unedited value.
ModuleScript
local module = {}
module.data = {}
return module
ServerScript
local module = require(game.ReplicatedStorage.ModuleScript)
module.data[1] = "Test"
print(module.data[1]) -- Outputs "Test"
LocalScript
local module = require(game.ReplicatedStorage.ModuleScript)
print(module.data[1]) -- Outputs nil
As in my game, the serverscript runs first before the localscript so the localscript would be able to load the module script with its edited variables. But it just keeps returning the unedited value, how would I prevent this?