Hi there,
I am trying to set a value in an multidimensional array.
local t = { name = "foo", login = "foo", score = { classic = { easy = 0, normal = 0, hard = 0 } } }
Is there any way to directly set the value t if the indeces are variable?
So i want to set the value with a function call like
function setValue(name, value) if type(name) == "string" then elseif type(name) == "table" then -- i want to be able to set the value t.score.classic.easy -- with the given table {"score", "classic", "easy"} end end
any ideas?
thanks