So its really weird because it plays the animation fine and finishes the function with no error message but it doesn't seem to hurt NPCs nor players. I'm genuinely stumped on how to fix this.
local CanAttack = true
local player = game.Players.LocalPlayer
local char = player.Character
local idle = script.Parent.Parent.Humanoid:LoadAnimation(script.Idle)
script.Parent.Equipped:Connect(function()
idle:Play()
end)
local canAttack = true
script.Parent.Activated:Connect(function()
if canAttack == true then
canAttack = false
print("PUNCH Activated")
local attackAnimation = script.Attack
local attack = script.Parent.Parent.Humanoid:LoadAnimation(attackAnimation)
local attack2 = script.Parent.Parent.Humanoid:LoadAnimation(script.Attack2)
script.Parent.Handle.Damage.Disabled = false
idle:Stop()
attack:Play()
print('Animation Playing')
wait(1)
canAttack = true
idle:Play()
print('Animation Stopped')
end
end)
function onUnEquipped()
idle:Stop()
end
script.Parent.Unequipped:Connect(onUnEquipped)
Damage Script
script.Parent.Touched:Connect(function(hit)
hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 5
script.Disabled = true
end)

3 comments
wait it was an easy fix im an idiot
thx, you just answered a question I have been facing
XD