Dear developers, I’m Lucas.
I need help doing this operation:
I want to get all values from this table:
local Table = {
["Animals"] = {"Cats", "Dogs", "Snakes"};
["Names"] = {"Sophia", "Luke", "Mimi"};
["Friends"] = {
["Best Friends"] = {"Kate", "George"};
["New Friends"] = {"You", "Thomas"};
};
["Favorite Animal"] = "Cat"
}
I want to use a function like ‘Instance:GetDescendants()’ using tables as instance.
I also tried this:
for _, a in pairs(Table) do
print(a)
end
So the values were printed to the output:
> table:0x52e165...
> table:0xd0fe58...
> Cat
> table:0xdebec4...
But it only printed the values (“Cat”) which were not inside another table.
I tried another solution:
local function GetChlidren(Object)
pcall(function()
for _, a in pairs(Object) do
return a
end
end)
end
print(GetChlidren(Table))
But it returned a nil value.
I really need help with this. I’m getting tired of this error and searching for solutions .
All kind of support is welcome .