This is my current script for a containment breach alarm.
Colour1 = "White"
Colour2 = "Really red"
On = false
Debounce = false
gc = script.Parent.Parent:GetChildren()
script.Parent.ClickDetector.MouseClick:Connect(function()
if On == false and Debounce == false then
Debounce = true
game.Workspace.Sound.ContainmentAlarm:Play()
On = true
for i,v in pairs(gc) do
if v.Name == "Change" then
v.BrickColor = BrickColor.new(Colour1)
wait(0)
v.BrickColor = BrickColor.new(Colour2)
end
end
wait(3)
Debounce = false
elseif On == true and Debounce == false then
On = false
Debounce = true
for i,v in pairs(gc) do
if v.Name == "Change" then
v.BrickColor = BrickColor.new(Colour1)
end
end
game.Workspace.Sound.ContainmentAlarm:Pause()
end
wait(3)
Debounce = false
end)
I want to change the colours of all the parts in 'game.Workspace["Light Switch"].Lights'

5 comments
Thank you
Can you add it into my script?
Right now the lights wont turn off red when I turn the alarm on
Yeah hold on
updated