SecurityStationFrontAlarm = game.Workspace.Alarms.SecurityRoomFrontAlarm
SecurityStationLeftAlarm = game.Workspace.Alarms.SecurityRoomLeftAlarm
SecurityStationRightAlarm = game.Workspace.Alarms.SecurityRoomRightAlarm
CellRoomAlarm = game.Workspace.Alarms.CellsAlarm
script.Parent.GreenButton.ClickDetector.MouseClick:connect(function() --GREEN PRESSED
SecurityStationFrontAlarm.glass1.BrickColor = BrickColor.new("White")
SecurityStationFrontAlarm.glass2.BrickColor = BrickColor.new("White")
SecurityStationFrontAlarm.light1.SpotLight.Range = 0
SecurityStationFrontAlarm.light2.SpotLight.Range = 0
SecurityStationFrontAlarm.light1.BrickColor = BrickColor.new("White")
SecurityStationFrontAlarm.light2.BrickColor = BrickColor.new("White")
SecurityStationFrontAlarm.light1.SpotLight.Color = Color3.new(0, 0, 0)
SecurityStationFrontAlarm.light2.SpotLight.Color = Color3.new(0, 0, 0)
SecurityStationLeftAlarm.glass1.BrickColor = BrickColor.new("White")
SecurityStationLeftAlarm.glass2.BrickColor = BrickColor.new("White")
SecurityStationLeftAlarm.light1.SpotLight.Range = 0
SecurityStationLeftAlarm.light2.SpotLight.Range = 0
SecurityStationLeftAlarm.light1.BrickColor = BrickColor.new("White")
SecurityStationLeftAlarm.light2.BrickColor = BrickColor.new("White")
SecurityStationLeftAlarm.light1.SpotLight.Color = Color3.new(0, 0, 0)
SecurityStationLeftAlarm.light2.SpotLight.Color = Color3.new(0, 0, 0)
SecurityStationRightAlarm.glass1.BrickColor = BrickColor.new("White")
SecurityStationRightAlarm.glass2.BrickColor = BrickColor.new("White")
SecurityStationRightAlarm.light1.SpotLight.Range = 0
SecurityStationRightAlarm.light2.SpotLight.Range = 0
SecurityStationRightAlarm.light1.BrickColor = BrickColor.new("White")
SecurityStationRightAlarm.light2.BrickColor = BrickColor.new("White")
SecurityStationRightAlarm.light1.SpotLight.Color = Color3.new(0, 0, 0)
SecurityStationRightAlarm.light2.SpotLight.Color = Color3.new(0, 0, 0)
CellRoomAlarm.glass1.BrickColor = BrickColor.new("White")
CellRoomAlarm.glass2.BrickColor = BrickColor.new("White")
CellRoomAlarm.light1.SpotLight.Range = 0
CellRoomAlarm.light2.SpotLight.Range = 0
CellRoomAlarm.light1.BrickColor = BrickColor.new("White")
CellRoomAlarm.light2.BrickColor = BrickColor.new("White")
CellRoomAlarm.light1.SpotLight.Color = Color3.new(0, 0, 0)
CellRoomAlarm.light2.SpotLight.Color = Color3.new(0, 0, 0)
SecurityStationFrontAlarm.RedAlarm:Stop()
SecurityStationFrontAlarm.YellowAlarm:Stop()
end)
script.Parent.YellowButton.ClickDetector.MouseClick:connect(function() --YELLOW PRESSED
SecurityStationFrontAlarm.glass1.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationFrontAlarm.glass2.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationFrontAlarm.light1.SpotLight.Range = 40
SecurityStationFrontAlarm.light2.SpotLight.Range = 40
SecurityStationFrontAlarm.light1.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationFrontAlarm.light2.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationFrontAlarm.light1.SpotLight.Color = Color3.new(255, 255, 0)
SecurityStationFrontAlarm.light2.SpotLight.Color = Color3.new(255, 255, 0)
SecurityStationLeftAlarm.glass1.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationLeftAlarm.glass2.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationLeftAlarm.light1.SpotLight.Range = 40
SecurityStationLeftAlarm.light2.SpotLight.Range = 40
SecurityStationLeftAlarm.light1.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationLeftAlarm.light2.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationLeftAlarm.light1.SpotLight.Color = Color3.new(255, 255, 0)
SecurityStationLeftAlarm.light2.SpotLight.Color = Color3.new(255, 255, 0)
SecurityStationRightAlarm.glass1.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationRightAlarm.glass2.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationRightAlarm.light1.SpotLight.Range = 40
SecurityStationRightAlarm.light2.SpotLight.Range = 40
SecurityStationRightAlarm.light1.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationRightAlarm.light2.BrickColor = BrickColor.new("Bright Yellow")
SecurityStationRightAlarm.light1.SpotLight.Color = Color3.new(255, 255, 0)
SecurityStationRightAlarm.light2.SpotLight.Color = Color3.new(255, 255, 0)
CellRoomAlarm.glass1.BrickColor = BrickColor.new("Bright Yellow")
CellRoomAlarm.glass2.BrickColor = BrickColor.new("Bright Yellow")
CellRoomAlarm.light1.SpotLight.Range = 40
CellRoomAlarm.light2.SpotLight.Range = 40
CellRoomAlarm.light1.BrickColor = BrickColor.new("Bright Yellow")
CellRoomAlarm.light2.BrickColor = BrickColor.new("Bright Yellow")
CellRoomAlarm.light1.SpotLight.Color = Color3.new(255, 255, 0)
CellRoomAlarm.light2.SpotLight.Color = Color3.new(255, 255, 0)
SecurityStationFrontAlarm.RedAlarm:Stop()
SecurityStationFrontAlarm.YellowAlarm:Play()
end)
script.Parent.RedButton.ClickDetector.MouseClick:connect(function() --RED PRESSED
SecurityStationFrontAlarm.glass1.BrickColor = BrickColor.new("Bright Red")
SecurityStationFrontAlarm.glass2.BrickColor = BrickColor.new("Bright Red")
SecurityStationFrontAlarm.light1.SpotLight.Range = 40
SecurityStationFrontAlarm.light2.SpotLight.Range = 40
SecurityStationFrontAlarm.light1.BrickColor = BrickColor.new("Bright Red")
SecurityStationFrontAlarm.light2.BrickColor = BrickColor.new("Bright Red")
SecurityStationFrontAlarm.light1.SpotLight.Color = Color3.new(255, 0, 0)
SecurityStationFrontAlarm.light2.SpotLight.Color = Color3.new(255, 0, 0)
SecurityStationLeftAlarm.glass1.BrickColor = BrickColor.new("Bright Red")
SecurityStationLeftAlarm.glass2.BrickColor = BrickColor.new("Bright Red")
SecurityStationLeftAlarm.light1.SpotLight.Range = 40
SecurityStationLeftAlarm.light2.SpotLight.Range = 40
SecurityStationLeftAlarm.light1.BrickColor = BrickColor.new("Bright Red")
SecurityStationLeftAlarm.light2.BrickColor = BrickColor.new("Bright Red")
SecurityStationLeftAlarm.light1.SpotLight.Color = Color3.new(255, 0, 0)
SecurityStationLeftAlarm.light2.SpotLight.Color = Color3.new(255, 0, 0)
SecurityStationRightAlarm.glass1.BrickColor = BrickColor.new("Bright Red")
SecurityStationRightAlarm.glass2.BrickColor = BrickColor.new("Bright Red")
SecurityStationRightAlarm.light1.SpotLight.Range = 40
SecurityStationRightAlarm.light2.SpotLight.Range = 40
SecurityStationRightAlarm.light1.BrickColor = BrickColor.new("Bright Red")
SecurityStationRightAlarm.light2.BrickColor = BrickColor.new("Bright Red")
SecurityStationRightAlarm.light1.SpotLight.Color = Color3.new(255, 0, 0)
SecurityStationRightAlarm.light2.SpotLight.Color = Color3.new(255, 0, 0)
CellRoomAlarm.glass1.BrickColor = BrickColor.new("Bright Red")
CellRoomAlarm.glass2.BrickColor = BrickColor.new("Bright Red")
CellRoomAlarm.light1.SpotLight.Range = 40
CellRoomAlarm.light2.SpotLight.Range = 40
CellRoomAlarm.light1.BrickColor = BrickColor.new("Bright Red")
CellRoomAlarm.light2.BrickColor = BrickColor.new("Bright Red")
CellRoomAlarm.light1.SpotLight.Color = Color3.new(255, 0, 0)
CellRoomAlarm.light2.SpotLight.Color = Color3.new(255, 0, 0)
SecurityStationFrontAlarm.RedAlarm:Play()
SecurityStationFrontAlarm.YellowAlarm:Play()
end)
The script controls 3 buttons, which when pressed change the alarm systems state (Green, Yellow and Red). I need help simplifying this, so it searches alarms for it's children and modifies them instead of me manually defining what to modify. Help!

3 comments
By the way, feel free not to copy over the bits that change brick colors and play sound, just sort out the framework!
I see that GetChildren() may be needed somehow but how to implement it?
eyegasm