Hitbox sometimes kills instantly

Hello developers! today i found a bug in my game. usually moves do their damage but sometimes moves kills instantly. let me provide you scripts.

move (module):

			local HitRaycast = hb.Create(chr, Vector3.new(6,6,6), chr.HumanoidRootPart.CFrame * CFrame.new(0, 0, -2))
			for i, v in pairs(HitRaycast) do
				if game.Players:FindFirstChild(v.Name) then
					camshakerem:FireClient(game.Players[v.Name],"Bump")
				end
				camshakerem:FireClient(plr,"Bump")
				sfx:Play()
				v.Humanoid:TakeDamage(7)
				ch.DamageIndicate(v,7)
				ch.STUN(v,1.2,4)
				--v.HumanoidRootPart.Rotation = chr.HumanoidRootPart.Rotation + Vector3.new(0,180,0)	
				ch.Ragdoll(v,1)
				camrem:FireClient(plr,75,0.5,0)
				ch.Knockback(chr,v,5,0,0,0,0.25)
				ch.CastVFX(v,game:GetService("ServerStorage").VFX.KingOfCurses.Dismantle.Attachment,"Torso")
			end

hitbox module:


local function HitboxIndicator(Size, cFrame)
	local HitboxPart = Instance.new("Part", workspace.EffectsDebris)
	HitboxPart.Transparency = 0
	HitboxPart.Color = Color3.new(0.635294, 0.854902, 0.352941)
	HitboxPart.Material = Enum.Material.ForceField
	HitboxPart.Anchored = true
	HitboxPart.CanCollide = false
	HitboxPart.CanTouch = false
	HitboxPart.CanQuery = false
	HitboxPart.Size = Size
	HitboxPart.CFrame = cFrame
	game.Debris:AddItem(HitboxPart, 0.4)
end

local movesets = require(game:GetService("ReplicatedStorage"):WaitForChild("Dodges"))

local module = {}


function module.Create(Attacker, Size, cFrame)
	local Params = OverlapParams.new()
	Params.FilterType = Enum.RaycastFilterType.Blacklist
	Params.FilterDescendantsInstances = {Attacker}

--	HitboxIndicator(Size, cFrame)
	local Parts = workspace:GetPartBoundsInBox(cFrame, Size, Params)
	local Victims = {}

	for _, Parts in pairs(Parts) do
		local Victim = Parts.Parent
		if Victim:FindFirstChildWhichIsA("Humanoid") and Victim:FindFirstChild("HumanoidRootPart") then
			if not Victims[Victim.Name] then
				if Victim:HasTag("Dodge") then
					movesets[Victim.AbilityValue.Value](Victim,Attacker)
					break
				elseif Victim:HasTag("IF") then
					break
				elseif Victim:HasTag("Block") then
					break
				else
					Victims[Victim.Name] = Victim
					print(Victim.Name.." damaged")
				end
			end
		end
	end
	return Victims
end


return module

any help will be appreciated

Can’t seem to find any errors. Have you tried using the debug watcher?

As a side note, you should use tables instead of dictionaries since you aren’t referring to specific elements in the table, nor using their names.

can you send me the finished script with comments because my english not that good i understand luau more then english

Well, no, I can’t do that per the rules of the forum. You can look up how to use the debug watcher in a script, which pauses the game to show you each individual step of the code runner.

Here’s a link to tables on the creator hub

forgot to say i tried debugging, i didnt undertstood whats the thing with tables and dictiniorais

Tables are like dictionaries, but you refer to them with numbers (like MyTable[1] for the first entry) instead of with names. They are also iterated through a specific order instead of being random like a dictionary. They’re less resource intensive and easier to work with if you aren’t worried about specific names when iterating (Such as in your script, when dealing damage to the victims)