Using [] to get the first value of a table doesn't work

I’ve been trying to use two brackets (Dunno if there’s any coding terminology for it) with a 1 inside so that I can find out what the highest voted map was. Though, for some reason it comes out as nil, even though the highest voted map is Roblox HQ, with one vote and the others having none.

image

Here’s what the table looks like

image

1 Like

You have a dictionary and your trying to use a index they are 2 different things you should research more about dictionaries and arrays and their differences

local dict = {
      SomeKey = true
}
local Array = {
       [1] = true —-or just put true the [] is unnecessary
}
print(Array[1])
print(dict.SomeKey)
2 Likes