Code I have right now:
local debounce = true
if debounce then --Where on the script would I place the debounce stuff?
debounce = false
wait(1)
debounce = true
end
script.Parent.ClickDetector.MouseClick:Connect(function()
--Do I put this in between local debounce and if debounce then?
game.Workspace.ZooPhotographer.Camera.L.BrickColor = BrickColor.White()
game.Workspace.ZooPhotographer.Camera.L.PointLight.Brightness = 1
game.Workspace.ZooPhotographer.Camera.L.PointLight.Range = 8
game.Workspace.ZooPhotographer.Camera.L.Material = Enum.Material.Neon
script.Parent.CameraFlash:Play()
wait(0.25)
game.Workspace.ZooPhotographer.Camera.L.BrickColor = BrickColor.Black()
game.Workspace.ZooPhotographer.Camera.L.PointLight.Brightness = 0
game.Workspace.ZooPhotographer.Camera.L.PointLight.Range = 0
game.Workspace.ZooPhotographer.Camera.L.Material = Enum.Material.Glass
script.Parent.CameraFlash:Stop()
end)
What should I fix?
I feel like math would be involved but I am not so sure.
Something along the lines of "'If the button is clicked more than once, the effects and sound cannot be played, but the wait time in the debounce section must pass until the button can be clicked again'".
Thanks! :)
