How to get a Variable with a string

Hello. I was wondering if its possible to get a Variable with a string.

for example:

local stringVar = "Numbers"

local Numbers =  {
1,
2,
3
}

print(stringVar)

like how to make it that it will not print the value of stringVar (“Numbers”). It should print the value of the Variable that is also named after the value of string.

Don’t think so but you can put it inside a table and call it with the name

local Want = "Numbers"

local DataTable = {
    Numbers = {
        1,
        2,
        3
    }
}

print(DataTable[Want])
1 Like