Hi guys,
I have a table with ~150 items in it and I was wondering how I can count the number of entries within the table?
Am I being dumb and using print(#items) wrong? or does that only work for arrays?
I've also tried:
NoCreatures = function()
local count = 0
for _ in pairs (items) do
count = count + 1
end
print(count)
end
I'm sure there's a simple solution to this one! haha
Thanks for your time :)

4 comments
Does it matter that I have made it like --> Items["#092"]="Example" ?
Items = {} is at the beggining of it all. and I know it looks stupid to have it as #000 instead of just letting it be an array but there's a reason haha (e.g. the final number, #150 is only about number 146)
Not at all since "#092" is being treated as a key. Though you can't iterate through it with numbers unless you do something semicomplex..
Thanks for the help :)