Try to click the 3 dots button at the top right corner of the output, and disable “Log Mode”, so you can see the content of the tables in the output.
Then, how the rock.Loot
table looks like?
I made a quick test with a fake table, adding the amount, and used that code that is causing the error, with this fake table works normally:
local FakeTable = {}
FakeTable[1] = {}
FakeTable[1]["Amount"] = {3,7}
FakeTable[2] = {}
FakeTable[2]["Amount"] = {2,5}
FakeTable[3] = {}
FakeTable[3]["Amount"] = {4,8}
local lootgained = {}
for i, v in pairs(FakeTable) do
warn(i, v)
table.insert(lootgained, i, v)
lootgained[i].Amount = math.random(v.Amount[1], v.Amount[2])
end
print(lootgained)
The output: