Tables do not work as intended [simplified]

Because I have the impression that many people still do not understand my problem, I will simplify it:
Let’s say we have a ModuleScript and inside of it we have a table (not the one that is returned, but another normal table). Now I add something, say it is a string:

local Module = {}

Module.Table = {}
table.insert(Table, #Table + 1, "TestString")

return Module

So, you usually think with me that it must be correct, right? But now when I want to look at it in another script:

local Module = require(Module.path)
for i,v in ipairs(Module.Table) do
    print(i,v) --Here it does not work for me

Normally I should get my string back, but not me, when I play this, this doesn’t print anything (I’m writing this from Mobile but normally it should work), this proves that there’s nothing inside (I even tried the traditional method of print(Table[1]) but it still didn’t work). Why and is this a bug or just me doing something wrong?

I hope this version is better than the previous one.
Thanks for reading:

U are returning modules but your table is called Module.

Also insert automatically does #Table + 1 if you omit the Position

Also u used Table instead of Module.table in the Parameters
In your other script u reffered to table is Module.Table instead of Module.table


Ops srry, thanks i will change this! (I am writting this from a mobile, this is why and this is only a example, not worry)

Module and module need to be written the same, otherwise it won’t return the Module

1 Like

Thank you for showing me these spelling mistakes, it’s just hard to write from your mobile phone.

But this is just from context, I actually have another script (which is bigger) and this one is just to show my problem. I know the path exactly, and I do everything correctly (my main table works, and I have several subtables, only one of them doesn’t work), but when I try to get the stored value, it only returns nil, even if I previously printed my value in the ModuleScript itself.

I hope you now better understand my problem @Crrustyy and @LukaDev_0. I’ll say it again:

I have a large ModuleScript and want to get a table from it, only the table is always empty although I look up correctly.

And yes:

  1. The table was filled and
  2. I wrote everything correctly,

these spelling mistakes just came up because it’s hard to write from my mobile phone

Thank you very much for your answers! I just removed something with next and it works now (you can’t see than, argh forget about this thing). I still don’t understand why, but it works and yes… I just want to warn you and thank you.