script.Parent.Blade.Touched:connect(function(hit) if equipped and humanoid and humanoid.Health >=0 then print(hit.Parent.Name) target = hit.Parent:FindFirstChild'Humanoid' if target and target.Health >= 0 then print(hit.Parent.Name) target:TakeDamage(damage.Value) end end end)
the code fires like 5 touched events when ever it hits something with a humanoid
local deb = true script.Parent.Blade.Touched:connect(function(hit) if equipped and humanoid and humanoid.Health >=0 and deb == true then deb = false print(hit.Parent.Name) target = hit.Parent:FindFirstChild'Humanoid' if target and target.Health >= 0 then print(hit.Parent.Name) target:TakeDamage(damage.Value) end wait() deb = true end end)
Creating a debounce makes it so that the item can't be touched again for a certain amount of time.