local CanAttack = true script.Parent.Equipped:connect(function() local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) idle:Play() end) script.Parent.Activated:connect(function() local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle) local attack = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack) if CanAttack == true then attack:Play() idle:Stop() wait(1) attack:Stop() idle:Play() CanAttack = true script.Parent.CanDamage.Value = true end end)
It's most likely because every time you make a new animation, never stopping the original. Try doing something like this:
local CanAttack = true local i = script:WaitForChild("Idle) local a = script:WaitForChild("Attack") local hum = script.Parent.Parent:WaitForChild("Humanoid") i.Parent = hum a.Parent = hum local idle = hum:LoadAnimation(i) local attack = hum:LoadAnimation(a) script.Parent.Equipped:connect(function() idle:Play() end) script.Parent.Activated:connect(function() if CanAttack == true then attack:Play() idle:Stop() wait(1) attack:Stop() idle:Play() CanAttack = true script.Parent.CanDamage.Value = true end end)
Also, another thing to note is that animations MUST be parented to the humanoid to work. This should fix all your problems.
Hope I could help. Have a nice day. -REALTimothy0812