How can I know if it’s a simple var or a table?
Why? Well, I want to make something like this:
[lua]
cats = {}
cats.names = {}
cats[“john”].names = {“Pussy”,“Tom”,“Terry”}
cats[“gaylord”].names = “Jerry”
[/lua]
Then, I’ll want to do something like
[lua]
local name = “gaylord”
local fed_cats = {}
for k,v in pairs (cats[name]) do
fed_cats[k] = v;
end
[/lua]
Wouldn’t what return an error or something? I think, I should somehow check, if cats[“gaylord”].names is a table or a string?