Currently trying to make a combat system with .Touched and having trouble "debouncing" with the event.
script.Parent.Activated:Connect(function()
if not debounce then
debounce = true
if combo == 0 then
combo = 1
newHitbox = hitbox:Clone()
newHitbox.Parent = myHumanoidRootPart
newHitbox.CFrame = myHumanoidRootPart.CFrame
debris:AddItem(newHitbox, 0.9)
local weld = Instance.new("Weld")
weld.Parent = newHitbox
weld.Part0 = newHitbox
weld.Part1 = myHumanoidRootPart
newHitbox.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
print("Hit")
end
end)
combo = 0
end
debounce = false
end
end)
I've tried adding a debounce within the touched event itself and that didn't work either.
It'll essentially detect all the players' body parts pritning "Hit" 7 times rather than 1.

1 comment
Thanks for the full explanation, I didn't want to accept your answer however since the other person was first.