script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)
COMMUNITY QUESTION
How do I add a cool down to this script?
1 answer
Nevermind, I found a fix
Debounce = false
script.Parent.Equipped:Connect(function(Mouse)
Mouse.Button1Down:Connect(function()
if not Debounce then
Debounce = true
animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
animation:Play()
wait(.6)
Debounce = false
end
end)
end)
script.Parent.Unequipped:Connect(function()
animation:Stop()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
