local slotBase = 20
for i = 1,slotBase,1 do
if #items > 0 then
for index,value in pairs(items) do
if value.Slot == "Slot" .. i then
end
if index == #items and value.Slot ~= "Slot" .. i then
local place = #items + 1
table.insert(items, place, Slot)
items[place].Slot = "Slot" .. i
save()
end
end
else
local place = #items + 1
table.insert(items, place, Slot)
items[place].Slot = "Slot" .. i
save()
end
end
I set up a print, and it said the loop only went through one time. It is supposed to go through 20 times. Help to fix this problem is highly appreciated, thanks!

2 comments
TheAlphaStigma's answer is correct. The only reason it printed once is because you are waiting for the INDEX to hit the NUMBER OF ITEMS IN THE TABLE, which is most likely 20. If it only hits 20 once, it'll only execute the action once. Read his post again.
@Shawnyg Good on ya, lad! :D