local test = {}
test["hi"] = "lol"
print(#test)
I am very confused to why it prints 0. Did roblox change something?
local test = {}
test["hi"] = "lol"
print(#test)
I am very confused to why it prints 0. Did roblox change something?
You can't get the length of a dictionary, only an array with ascending numbers as index's.
local Array = {}
for i = 1, 3 do
Array[i] = 'hi'
end
print(#Array)
OUTPUT:
3
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
it never worked before for dictionaries
Full information: http://lua-users.org/wiki/TablesTutorial