I made script of when you press GUI button it starts police siren. It works fine and well but the only problem you can't stop it. How do I make so that when you click button again, it stops the sirens and the lights too.
Here's my script:
local light = game.Workspace.Lights
function onClicked()
light.Sound:Play()
while true do
light.Red.Material = "Neon"
light.Blue.Material = "Plastic"
light.Red.PointLight.Enabled = true
light.Blue.PointLight.Enabled = false
wait(0.8)
light.Blue.Material = "Neon"
light.Red.Material = "Plastic"
light.Red.PointLight.Enabled = false
light.Blue.PointLight.Enabled = true
wait(0.8)
end
end
script.Parent.TextButton.MouseButton1Down:connect(onClicked)

2 comments
It doesn't work at all now.
Filtering Enabled on? Any errors?