I made a dash and for the hitbox I used a for loop that get all the character’s body parts and if one of the parts gets touched the event will fire, the problem is, it doesn’t disconnect:
task.spawn(function ()
for _,part in ipairs(char:GetDescendants())do
if part.ClassName == "MeshPart" then local rp = part
connexion2 = rp.Touched:Connect(function(hit)
task.wait() print("hited")
if hit.Parent:FindFirstChild("Humanoid")
and hit.Parent.Name ~= char.Name then local humanoid = hit.Parent.Humanoid
if humanoid:FindFirstChild(player.Name.."BsDash") then return
else
print("lDamaged") humanoid:TakeDamage(20)
local Dbv = Instance.new("BoolValue")
Dbv.Name = player.Name.."BsDash"
Dbv.Parent = humanoid
game:GetService("Debris"):AddItem(Dbv,1)
end
this in not the whole script and I put a disconnect on the very end, but the event continue firing if I walk.