I am making a technology wing that has 4 generators, the generator are gonna work as when one goes off it dims when two goes off it dims even more, three even more, and four completely off. These generators have a big green button, I have put a click detector on the button and ik how to change a spotlight's brightness "light.spotlight.brightness = #" but I don't know how to select every light in the game. All the lights are in a group but idk how to change the brightness of an entire group. Ty for your help and time ;)
Simply iterate through the group of lights and change the brightness of each like so:
for _,light in pairs(game.Workspace.Lights:GetChildren()) do light.SpotLight.Brightness = light.SpotLight.Brightness-0.1 end
Add that to your current script and with a bit of tweaking you can set it up for your game. If you need more help with this or it doesn't work, let me know in the comments with as much detail as possible. Otherwise, accept this as the answer!