The script below activates an hit animation when the player clicks their screen:
local Tool = script.Parent
local Animation = Tool.Animation
Tool.Activated:Connect(function()
local Character = Tool.Parent
local Humanoid = Character.Humanoid
local AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
end)
There is no cooldown however, so the player can do it infinitely.
Can someone tell me how I can add a cooldown so that the player can't click and attack until a specific time period ends?
I'd also like to know where in the script I'm supposed to put it, at the beginning or the end, because that kind of stuff confuses me :)

1 comment
THANK YOU! This worked perfectly!! I will make sure to keep this in mind when trying to create other weapons w/ cooldowns!