Hello there,
I am trying to load in some data in a table but when I then print out the table it prints as nil. Here is my code:
local success, err = pcall(function()
for i,v in pairs(RawData) do
MaxTable = {
[Player.UserId] = {
["Damage"] = v["Damage"], -- NOT INDEXING RIGHT
["FireRate"] = v["FireRate"],
["MagSize"] = v["MagSize"],
}
}
MaxTable2[Player.UserId] = {
["Healthboost"] = v["Healthboost"],
}
end
print(MaxTable[Player.UserId][Damage]
When I print out " print(MaxTable[Player.UserId][Damage]" , it just prints as nil although Player.UserId is equalling to Damage and Damage is equalling to data.
It does not error, it just prints as nil. I believe I am not indexing correctly however I do not know why that would be the case.
Any help is appreciated, thanks!