I have a module script with a table in it where I get and change content (data)
-- ModuleScript
local module = {}
local data = {}
function module.WriteData(content)
table.insert(data, content)
end
function module.GetData()
return data
end
return module
But I can’t see the changes made to the table when requiring the module from different environments
-- Server
local module = require(path)
module.WriteData(5)
print(module.GetData()) -- [ 5 ]
-- Another "server" environment (plugin or game console)
local module = require(path)
-- Data already written by the Server script
print(module.GetData()) -- [ ]
_G
and shared
don’t work because those are intended for same context levels, and SharedTables don’t let me save Instances data types in it. Help