function Check()
if script.Parent.Power.Value == true then
game.Workspace.GorillaLights.BrickColor = BrickColor.new(1, 1, 0) --LED
game.Workspace.GorillaLights2.BrickColor = BrickColor.new(1, 1, 0) --LED 2
game.Workspace.GorillaLights.SurfaceLight.Color = Color3.new(1, 1, 0) --Light
for i, child in game.Workspace:GetChildren() do
if child.Name == "GorillaCubeLights" then
child.Round_Cube.BrickColor = BrickColor.new(9, 137, 207) --LED
end
end
end
end
while true do
Check()
wait()
end
also, you are going to have some trouble. BrickColor.new() need a color NAME, not RGB code. just like that:
BrickColor.New("Really Red")
If you want further help, could you be more specific on what part you need to update ?
If you could send a screen of your explorer that would help
I see your polling here, when usually this should be avoided, how does the button work, is it a TextButton? ClickDetector?
Other than that, if you want to check for every part with a certain name, assuming they are all distributed throughout the workspace, you can use :GetDescendants() to retrieve every part within a certain folder or the workspace and check if it’s name is something.
function Check()
if script.Parent.Power.Value == true then
for i, child in game.Workspace.GorillaCubeLights:GetChildren() do
if child.Name == "Round_Cube" then
child.BrickColor = BrickColor.new(9, 137, 207)
end
end
end
end
while true do
Check()
task.wait() -- try to use task.wait() and not just wait()
end