My script doesn't work but the for i, color script is a functional part How do I improve and fix this mess.
local violet = script.Parent.Violet local indigo = script.Parent.Indigo local blue = script.Parent.Blue local green = script.Parent.Green local yellow = script.Parent.Yellow local orange = script.Parent.Orange local red = script.Parent.Red local Color = game.Workspace.FordFusion.Body.Model.Model:GetChildren() game.Workspace.Detection.Touched:Connect(OnTouch) -- function OnTouch() red.Visible = true orange.Visible = true yellow.Visible = true green.Visible = true blue.Visible = true indigo.Visible = true violet.Visible = true violet.MouseButton1Click:Connect(function() wait(.1) for i, color in pairs (Color) do if color.Name == "Color" then color.BrickColor = BrickColor.new("Magenta") end end end indigo.MouseButton1Click:Connect(function() for i, color in pairs (Color) do if color.Name == "Color" then color.BrickColor = BrickColor.new("Dark Indigo") end end end) end