if script.Parent.Disabled == true then wait(5) script.Parent.Disabled = false wait(0) script.Parent.Disabled = true
my script
game:GetService("UserInputService").InputBegan:connect(function(input,gameprocesed) if input.KeyCode == Enum.KeyCode.LeftShift then for i = 1,16 do wait() game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed + 1 end end end) game:GetService("UserInputService").InputEnded:connect(function(input,gameprocesed) if input.KeyCode == Enum.KeyCode.LeftShift then for i = 1,16 do wait() game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed = game.Players.LocalPlayer.Character:WaitForChild("Humanoid").WalkSpeed - 1 end end end) game.Players.LocalPlayer.Character:WaitForChild("Humanoid").Died:connect(function() game.Workspace.Camera.FieldOfView = 70 game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16 script.Disabled = true end)
and the script I am trying to cool down (I stole it from someone as that was at times I did not know how to code)
If you want a cooldown you should probably use a debounce variable instead of disabling the script, as that stops the thread completely..
if debounce == true then wait(5) debunce = false wait(0) debounce = true end