3 buttons, 1 Red, 1 Yellow, 1 Green 5 Lights When I press the Red button I need all the lights to turn red When I press the Yellow all the lights to turn Yellow And when I press the green button I need all lights to turn green
This is the script I came up with for the green one, nothing happens when I press the green button. I'm pretty new to scripting but there doesn't seem to be any tutorials or even free models that are similar.
local Lights = script.Parent.Lights
-- Light Posts
local A = Lights.A
local B = Lights.B
local C = Lights.C
local D = Lights.D
local E = Lights.E
function changeColour()
A.Light.BrickColor = BrickColor.Green()
B.Light.BrickColor = BrickColor.Green()
C.Light.BrickColor = BrickColor.Green()
D.Light.BrickColor = BrickColor.Green()
E.Light.BrickColor = BrickColor.Green()
end
function onClick()
changeColour()
end
script.Parent.ClickDetector.MouseClick:Connect(onClick)

4 comments
Do you already have a light inside of the parts? What type of light is it Surface, Point?
No, there are no lights. The brick is Neon and it's more the colour changing than actually providing a light source.
^They are Safety lights for a Go-Karting track
Is "Light" the name of the part inside the light post you want to change color? If so, then that's good. Try changing Light.BrickColor = BrickColor.Green() to Light.BrickColor = BrickColor.new("Green")