I'm trying to learn scripting. So I decided to train myself by making a GUI button that changes part called Red into green color then into really red color. But for some reason, it doesn't work.
local light = game.workspace.Lights
function onClicked()
light.Red.BrickColor = BrickColor.new(Green)
wait(3)
light.Red.BrickColor = BrickColor.new(Really red)
end
script.Parent.TextButton.MouseButton1Down:connect(onClicked)
What have I done wrong in this?
