Hi there scripters out there i was wondering how to add a function when on click it immdiatly disbles the button for 1 minute before renableing it to be clicked the command should go right under sound play i need it for both thanks
function ToggleLight()
if script.Parent.ClickDetector.MaxActivationDistance == 15 then
script.Parent.OpenSound:play()
script.Parent.BrickColor = BrickColor.new("Bright red")
game.Workspace.lockdowndoor1.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor1.Script.Disabled = false
wait(20)
game.Workspace.lockdowndoor2.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor2.Script.Disabled = false
wait(20)
game.Workspace.lockdowndoor3.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor3.Script.Disabled = false
wait(20)
game.Workspace.lockdowndoor4.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor4.Script.Disabled = false
wait(20)
script.Parent.ClickDetector.MaxActivationDistance = 15
else
script.Parent.OpenSound:play()
script.Parent.BrickColor = BrickColor.new("Yellow")
game.Workspace.lockdowndoor1.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor1.Script.Disabled = false
wait(20)
game.Workspace.lockdowndoor2.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor2.Script.Disabled = false
wait(20)
game.Workspace.lockdowndoor3.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor3.Script.Disabled = false
wait(20)
game.Workspace.lockdowndoor4.Script.Disabled = true
wait(.1)
game.Workspace.lockdowndoor4.Script.Disabled = false
wait(20)
script.Parent.ClickDetector.MaxActivationDistance = 15
end
end
script.Parent.ClickDetector.MouseClick:connect(ToggleLight)

2 comments
Please put in code block.
Code block please!