try this instead i made some edits (remember to still replace anim)
local debounce = false
script.Parent.Activated:Connect(function()
if not debounce then
debounce = true
local anim = game.Players[script.Parent.Parent.Parent.Parent.Name].Character:WaitForChild("Humanoid"):LoadAnimation(anim)
anim:Play(.5,10)
script.Parent.Touched:Connect(function(hit)
if not hit.Parent:FindFirstChild("HitBySword") and hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid:TakeDamage(3)
local identifier = Instance.new("BoolValue")
identifier.Name = "HitBySword"
game:GetService("Debris"):AddItem(identifier,1)
end
end)
wait(1)
debounce = false
end
end)