Table dictionaries not working?

This just started happening today.

Basically when I do a print(#Table) on a table that labels it’s values as dictionaries it just prints out 0

Example:

Script:
https://gyazo.com/d9657fbfaea8be7c396a66bd6cecc7e7

Output:
https://gyazo.com/96a632305c71e223c715a94605112a35

However if I just use normal table values without a dictionary, it works just fine:

Script:
https://gyazo.com/64acfdfa57fc5b0a9a768606ab485f6f

Output:
https://gyazo.com/5a2d0e2282523138939d99bf890dfbad

Is there a reason for this? It’s breaking my game’s datastores. I tried this in multiple of my places, but still no luck. Also there’s no difference when used on a local or regular script.

1 Like

#table” works if there’s proper number indexes. You’re using strings as indexes.

It’s always been like this. # returns the highest continuous integer key.

local function GetNumElements(t)
local n = 0
for _ in next, t do n = n + 1 end
return n
end

Lua manual:
http://www.lua.org/manual/5.1/manual.html

i just realized i was doing dumb mistake