Knockback is not working, and Combat (I believe) is looping damage through every part

Finally, I’m nearly done with this rollercoaster known as Combat. Although, I do have a small issue, known as Knockback and table looping.

Issue One.

I would say that the combat is done, but the issue that would be prominent is to add BodyVelocity and use force + lookvector to knock your foe away. That isn’t really working at the moment as I begin to make a script such as this

local BV ="BodyVelocity", Character)
				BV.maxForce =,25000,25000)
				BV.Velocity = Character.HumanoidRootPart.CFrame.lookVector*20

This doesn’t even give an error; it simply just does nothing.

If that was the only issue, I feel like I would’ve been able to get through it, but at the same time the combat that was doing the damage I originally wanted is now bugging and cannot play without being a full part of the for loop just looping damage for each part I believe, so I had to lower the damage drastically, and the damage is somewhat randomized depending on how much surface area the Hitbox will get.

--Hitbox Creation
		local HitBox = HiBo:Clone()
		HitBox.CFrame = Character.PrimaryPart.CFrame *, 0, -3)
		local Welds ="WeldConstraint", Character.PrimaryPart)
		Welds.Part0 = HitBox
		Welds.Part1 = Character.PrimaryPart
		HitBox.Parent = workspace

		--Region3 Creation
		local pos1 = HitBox.Position - (HitBox.Size/2)
		local pos2 = HitBox.Position + (HitBox.Size/2)
		local Re3 =, pos2)
		--Region3 In Action
		local HBFinder = workspace:FindPartsInRegion3(Re3, HitBox, 20)
		Debris:AddItem(HitBox, 0.3)
		for i, parts in pairs (HBFinder) do
			if parts.Parent:FindFirstChild("Humanoid") and parts.Parent ~= Character then
				--print("The Humanoid was most definitely hit.")
				local BV ="BodyVelocity", Character)
				BV.maxForce =,25000,25000)
				BV.Velocity = Character.HumanoidRootPart.CFrame.lookVector*20
				if Humanoid.Died then
						if Humanoid.Died then
							script.Disabled = true
							return not Humanoid.Died

					end)--Died Function
	end) --Ofc Main Function

At this point I cannot figure out what to do after trying different methods such as separating the damage from the loop, making the loop a generalized thing.

And as for the Knockback I have tried to no avail to fix it.

i can help you with this, then ill look at your other code and see if i can find the issue.

rather than setting the Velocity to the humanoidRootParts CFrame.lookVector, I usually set the X,Y,Z values independently.

	local PlayerOrientation = Player.Character.HumanoidRootPart.CFrame.LookVector --this will get the orientation that the player is looking at in the world space
	local VelocityModifier = 50 --the higher the number, the higher the velocity 
	local MaxForce =,50000,50000) --higher numbers = more force applied to the player

	local bodyVelocity='BodyVelocity')
	bodyVelocity.Parent = Player.Character.HumanoidRootPart
	bodyVelocity.MaxForce = MaxForce
	bodyVelocity.P = math.huge -- this makes the bodythrusts P value infinite
	bodyVelocity.Velocity =*VelocityModifier,-PlayerOrientation.Y*VelocityModifier,-PlayerOrientation.Z*VelocityModifier) --make sure to use the inverse of the players orientation, or the player will be knocked forward, rather than backwards

	game.Debris:AddItem(bodythrust,0.1) --you can change the time to your liking, with the longer the wait, the longer the effect lasts

try this, and let me know if it works for you

Well, it most definitely works, but it works on me for some odd reason, and immediately on the first hit not on the fourth. The thing with my script is that the Count is recorded on the LocalScript, so that might be a leading factor of why it happened on the first hit, but I have no idea how to carry over the Count variable to the Script.

Update after changing bodythrust to bodyvelocity

Now, the combat doesn’t even work for some reason. Like the hitbox and everything goes, but now the combat won’t even do damage to me or the humanoid I am hitting.

Fixed the Damage issue (the no damage part not the loop part), it was on my part, but that BodyVelocity issue is still here.


Update, I fixed the combat by adding a break after the first hit. The knockback is being done at the moment.