Hitbox Damage Issue

Hello, I am having an issue with Raycast Hitbox V4. Basically what happens is when I use my punch barrage ability on a dummy it damages it like intended, However, when I move away from the dummy while holding down the punch barrage ability it keeps damaging the dummy despite my punch barrage hitting thin air.

Here is a video clip to clarify:

Here is the code that damages the player.

local Params = RaycastParams.new()
	Params.FilterDescendantsInstances = {Character}
	Params.FilterType = Enum.RaycastFilterType.Exclude
	
	local Hitbox = RaycastHitbox.new(Stand.Hitbox1)
	Hitbox.RaycastParams = Params
	
	barrageanim:Play(0.1, 1, 1.5)
	Hitbox:HitStart()
	repeat
		Hitbox.OnHit:Connect(function(hit, humanoid)
			repeat
				if humanoid.Parent.Block.Value == true then
					humanoid:TakeDamage(0)
				else
					humanoid:TakeDamage(0.5)
				end
				wait(0.1)
			until BarrageCounter >= 40 or HoldingEBarrage == false
		end)
		BarrageCounter = BarrageCounter + 1
		wait(0.1)
	until BarrageCounter >= 40 or HoldingEBarrage == false

you should see how the server side of the barrage looks like, maybe you moving didnt update the position of the stand.

You’re creating a new Hitbox.OnHit connection with every repeat.

Fixed code:

local Params = RaycastParams.new()
Params.FilterDescendantsInstances = {Character}
Params.FilterType = Enum.RaycastFilterType.Exclude

local Hitbox = RaycastHitbox.new(Stand.Hitbox1)
Hitbox.RaycastParams = Params

barrageanim:Play(0.1, 1, 1.5)
Hitbox:HitStart()

Hitbox.OnHit:Connect(function(_, humanoid)
	if humanoid.Parent.Block.Value == true then
		humanoid:TakeDamage(0)
	else
		humanoid:TakeDamage(0.5)
	end
	
	-- Reset hitbox
	Hitbox:HitStop()
	Hitbox:HitStart()
end)

while BarrageCounter < 40 or HoldingEBarrage do
	BarrageCounter += 1
	
	task.wait(0.1)
end

Hitbox:Destroy()