I’m trying to make a table in code, where data from a larger table is condensed into a smaller and more narrow table, however the first entry of the small table is consistently from the second entry of the main table.
local afflictions = {
test1 = {
identifier = "test1",
maxIntensity = 100,
wholeBody = true,
effect = {
consciousness = -1
}
},
test2 = {
identifier = "test2",
maxIntensity = 100,
wholeBody = false,
effect = {
test1 = 1
}
},
test3 = {
identifier = "test3",
maxIntensity = 100,
wholeBody = false,
effect = {
test1 = 1
}
},
test4 = {
identifier = "test4",
maxIntensity = 100,
wholeBody = false,
effect = {
test1 = 1
}
}
}
local playerAfflictions = {}
local identifiers = {}
for i, a in pairs(afflictions) do
table.insert(identifiers, a.identifier)
end
for i, e in pairs(identifiers) do
print(i.." / "..e)
end
At the end there is a for loop for debugging. I have tried switching them around and the issue still persisted. I’m pretty lost and would appreciate any assistance. Thanks!