Editing a module table

So I want to be able to edit the contents of my table that is stored inside a module script in order to add players to it and access it from anywhere. How would I go about this? Table.insert doesn’t appear to be working.

It should work though.


local module = {
   tab = {}
return module


local module = require(ModuleLocation)
module.Test = 1
module.tab.Test = 1
print(module.Test) --1
print(module.tab.Test) --1

There’s a casing mismatch with module.Tab.Test in your “OtherScript”. It should be module.tab.Test. Other than that, :+1:.

1 Like

Also an accidental local in the table.

1 Like

I had a usual generic issue. Sorry for wasting your time, marked it as solution since I’m back on dev hub now.

1 Like