I tried two methods both gave me no errors but neither worked the first I found from a YouTube tutorial the other I made just to try a different way.

player = game.Players.LocalPlayer
mouse = player:GetMouse()
animation = script:WaitForChild("Animation")
enabled = true
mouse.Button1Down:connect(function()
	if enabled then
		enabled = false
		
		local animationTrack = player.Character.Humanoid:LoadAnimation(animation)
		animationTrack:Play()
		
		wait()
		enabled = true
	end
end)
----------------------------------------------------------------------Second way I tried
player = game.Players.LocalPlayer
mouse = player:GetMouse()
animation = script:WaitForChild("Animation")
enabled = false
function click()
	local animationTrack = player.Character.Humanoid:LoadAnimation(animation)
	wait(3)
	enabled = true
	animationTrack:Play()
end
mouse.Button1Down:connect(click)