How to make the punch cooldown?
How do I need to make it cooldown punch because there too op for every second i want to make it cooldown like like 1 second
Here the code
01 | local player = game.Players.LocalPlayer |
05 | local anim = Instance.new( "Animation" ) |
08 | game.Players.LocalPlayer.Character:WaitForChild( "RightHand" ).Touched:Connect( function (hit) |
09 | if hit.Parent:FindFirstChild( "Humanoid" ) and not db and not damage and hit.Parent.Humanoid ~ = game.Players.LocalPlayer.Character.Humanoid then |
10 | if game.Players.LocalPlayer.Character.Humanoid.Health > 0 then |
12 | game.ReplicatedStorage.Punch:FireServer(hit.Parent.Humanoid) |
17 | game:GetService( "UserInputService" ).InputBegan:Connect( function (input, event) |
18 | if input.UserInputType = = Enum.UserInputType.MouseButton 1 then |
20 | local playAnim = game.Players.LocalPlayer.Character:WaitForChild( "Humanoid" ):loadAnimation(anim) |