local myTable = {one = Color3.fromRGB(255, 255, 255), two = Color3.fromRGB(0, 0, 0)} local myVariable = "one" myTable[myVariable]
How would i make this work. I want it to take the variable from local myVariable not look in the table for myVariable. How would I do this?
Well, your table doesn't define "one" as a string so you have to do
local myTable = {["one"] = Color3.fromRGB(255, 255, 255), ["two"] = Color3.fromRGB(0, 0, 0)} local myVariable = "one" myTable[myVariable]