Complex Characters Bug My Code

I made slimes with only 2 parts and the script works perfectly with them, r6 works alright, r15 kinda works, and rthro barely works. Why is this? It prints all the parts, but doesnt damage a lot of them.

while CircleSlash.IsPlaying==true and dosworddamage==true do
				for i,target in pairs(game.Workspace:GetPartBoundsInBox(script.Parent.Parent.Blade.Hitbox.CFrame,script.Parent.Parent.Blade.Hitbox.Size)) do
					if target.Parent:FindFirstChild("Humanoid") and target.Parent.Humanoid.Health>0 and not target:IsDescendantOf(player.Character) and target.Name=="HumanoidRootPart" then
						for i,v in pairs(damaged) do
							if target.Parent==v then
								damagethis=false
							end
						end
						if damagethis==true then
							target.Parent.Humanoid:TakeDamage(20)
							sound=script.Parent.Parent.Blade.Slice:Clone()
							sound.Parent=script.Parent.Parent.Blade
							sound:Play()
							game.Debris:AddItem(sound,1)
							table.insert(damaged,target.Parent)
						end
					end
				end
				task.wait()
			end
			table.clear(damaged)
			damagethis=true
			dosworddamage=true
			player.Character.Humanoid.WalkSpeed=16
			task.wait(.5)
			db=false

the hitboxes change depending on the rig type

so how would i fix this? I’m kind of stumped right now

You can Try checking for RigType and then made a script for each type individually

Make a hitbox part and scale it to the Bounding Box size of the character. Then weld it to the HumanoidRootPart. Inflict damage on the basis of the hitbox getting hit, not character limbs.