So, in this scenario I have a multi-dimensional array that is in a module script. I have a localscript that is accessing that module script. It is correctly requiring and getting the sub-array, except it only gives the value and not the name. For example, if I had this array:
local Random = {
Another = {
Blank1 = 1,
Blank2 = 2,
Blank3 = 3,
},
Something = {
Filled1 = 4,
Filled2 = 5,
Filled3 = 6,
},
}
And I wanted to get the names of the sub-array's children. So for example, let's say I was checking if the values was 2, this is what I would do. Also, let's assume for all purposes that the local and everything else is already set-up so that it connects together.
for i, v in pairs(Random.Another) do
if v == 2 then
return v
end
end
However, what I would want it to do is return Blank2, and not the value (or number). How would I do this?

2 comments
Try printing out the index (i) instead and see what it comes up with.
It still outputs the value.