Hey,
I wanted to make the cloned buttons Backgroundcolor to get changed by the colrs name like in “Brickcolor”.
Is there any way to do so?
local Colors = script.Colors:GetChildren()
for i = 1, #Colors do
local Button = script.TextButton:Clone()
Button.Name = Colors[i].Name
Button.Text = Colors[i].Name
Button.Parent = script.Parent
Button.BackgroundColor3 = Colors[i].Name
end
I guess you could use the .new() constructor of BrickColor like so:
local Colors = script.Colors:GetChildren()
for i = 1, #Colors do
local Button = script.TextButton:Clone()
Button.Name = Colors[i].Name
Button.Text = Colors[i].Name
Button.Parent = script.Parent
Button.BackgroundColor3 = BrickColor.new(Colors[i].Name)
end