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 :)
Arrays are tables with a number as the key in Lua so #array should work.