local CanAttack = true
local mouse = game.Players.LocalPlayer
tool = script.Parent
char = game.Players.LocalPlayer.Character
humanoid = char:WaitForChild("Humanoid")



function onClicked()

	local attack = humanoid:LoadAnimation(script.Parent.attack)
			attack:Play()

	if CanAttack == true then
		attack:Play()
		CanAttack = false
		wait(1)
		attack:Stop()
		CanAttack = true
		script.Parent.CanDamage.Value = true
	end
end

function onEquipped(mouse)
	local attack = humanoid:LoadAnimation(script.Parent.attack)
	mouse.Button1Down:connect(onClicked)
end

tool.Equipped:connect(onEquipped)

no errors. any idea why my animation won't play?