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?
You have to put speech marks like this.
local light = game.Workspace.Lights function onClicked() light.Red.BrickColor = BrickColor.new("Lime green") --You need speech marks to make it work. wait(3) light.Red.BrickColor = BrickColor.new("Really red") --You need speech marks to make it work. end script.Parent.TextButton.MouseButton1Down:connect(onClicked)