How to call a table with a string?
-- Color tables
colors = {"blue", "red", "orange", "green"}
--table = {light color, dark color}
blue = {"Pastel Blue", "Cyan"} red = {"Persimmon", "Really Red"} orange = {"Gold", "Deep orange"} green = {"Shamrock", "Lime green"}
-- Changes tycoon template colors
local spawns = game.workspace.Tycoon_Spawns:GetChildren()
game.workspace.Tycoons.ChildAdded:connect(function(child)
local value = child:GetDescendants()
local random_color = math.random(1, #colors)
local ran_color = colors[random_color]
local str = Instance.new("StringValue", child)
str.Name = "Tycoon_Color"
str.Value = ran_color
table.remove(colors, random_color)
for i = 1, #value do
local color = child.Tycoon_Color.Value
print(color)
if value[i].Name == "light" then
print(color[1])
end
if value[i].Name == "dark" then
print(color[2])
end
end
end)