How would I go about doing something (e.x. printing something in the output) if all the lights in this script are bright green? I’m rather inexperienced at scripting so I apologize if this is just a really simple solution. (This is a local script in StarterPlayerScripts.)
local state = false
game.Workspace.switch1.ClickDetector.mouseClick:connect(function(touched)
state = not state
if state then
game.Workspace.light1.BrickColor = BrickColor.new("Bright green")
game.Workspace.light2.BrickColor = BrickColor.new("Bright green")
game.Workspace.light3.BrickColor = BrickColor.new("Bright green")
else
game.Workspace.light1.BrickColor = BrickColor.new("Medium stone grey")
game.Workspace.light2.BrickColor = BrickColor.new("Medium stone grey")
game.Workspace.light3.BrickColor = BrickColor.new("Medium stone grey")
end
end)
game.Workspace.switch2.ClickDetector.mouseClick:connect(function(touched)
state = not state
if state then
game.Workspace.light3.BrickColor = BrickColor.new("Bright green")
game.Workspace.light4.BrickColor = BrickColor.new("Bright green")
else
game.Workspace.light3.BrickColor = BrickColor.new("Medium stone grey")
game.Workspace.light4.BrickColor = BrickColor.new("Medium stone grey")
end
end)
game.Workspace.switch3.ClickDetector.mouseClick:connect(function(touched)
state = not state
if state then
game.Workspace.light4.BrickColor = BrickColor.new("Bright green")
game.Workspace.light5.BrickColor = BrickColor.new("Bright green")
else
game.Workspace.light4.BrickColor = BrickColor.new("Medium stone grey")
game.Workspace.light5.BrickColor = BrickColor.new("Medium stone grey")
end
end)
Any replies or help would be very much appreciated and I thank you in advance.