Idk why, But I think this should work, it's not changing the material so I think it errors at the second if statement
function Clicked() local GetBoat = game.Players.LocalPlayer.Character local colorfulls = GetBoat.NormalBoat:GetChildren("Colorfull") for i = 1, #colorfulls do if colorfulls[i].Name == "Colorfull" then if colorfulls[i].Material == "Plastic" then colorfulls[i].Material = "Neon" script.Parent.booton.TextColor3 = Color3.new(255,0,0) else colorfulls[i].Material = "Plastic" script.Parent.booton.TextColor3 = Color3.new(255,255,255) end end end end script.Parent.booton.MouseButton1Down:connect(Clicked)
There's some errors on what your trying to do. The Clicked should be onClicked()
function onClicked() local GetBoat = game.Players.LocalPlayer.Character local colorfulls = GetBoat.NormalBoat:GetChildren("Colorfull") for i = 1, #colorfulls do if colorfulls[i].Name == "Colorfull" then if colorfulls[i].Material == "Plastic" then colorfulls[i].Material = "Neon" script.Parent.booton.TextColor3 = Color3.new(255,0,0) else colorfulls[i].Material = "Plastic" script.Parent.booton.TextColor3 = Color3.new(255,255,255) end end end end script.Parent.booton.MouseButton1Click:connect(onClicked)