Basically I have a table of strings that are the same as the index to a saved variables table.
I'm not sure how to go about writing the proper function to set and get the values in of the saved variable table using the table of strings.
Lua Code:
local example = {
profile = {
helper = {
enable = true,
}
}
}
local index = {
"profile",
"helper",
"enable"
}
local function GetValue(t) -- This Seems to work
if type(t) == "table" then
local DB
for k, v in next, t do
if not DB then
DB = example[t[k]]
else
DB = DB[t[k]]
end
end
return DB
else
return example[t]
end
end
local function SetValue(t, val)
-- Do things here???
end