How can I make a custom humanoid/rig take damage?

I made a boss in my game a literal orb. The thing about it however, is even if it does have a humanoid it cannot take damage like any other thing in my game. I already tried using subtraction instead of TakeDamage, still doesnt work. Here is an example of what’s going on.


In this video, the regular dummy takes damage from my attack.

However, in this video, the custom humanoid (orb) does NOT take damage from the attack I am not even sure what creates this issue, hence I don’t have any script/code that shows the error. This is quite simply what the orb looks like
image
Also, I already tried adding a HMR, all it did was make it stop rolling and didn’t help.

Why not just have a NumberValue to keep track of health?

what would the NumberValue change though? The script in the video damaging other things decreases the value of Humanoid.Health

This is how the function of my damage system works

function MagniDamage(Part, magni, mindam, maxdam, knock, Type)
	for _, c in pairs(workspace:children()) do
		local hum = c:findFirstChildOfClass("Humanoid")
		if hum ~= nil then
			local head = c:findFirstChild("Head")
			if head ~= nil then
				local targ = head.Position - Part.Position
				local mag = targ.magnitude
				if magni >= mag and c.Name ~= Player.Name then
					Damagefunc(head, head, mindam, maxdam, knock, Type, RootPart, 0.1, "rbxassetid://231917784", 1)
				end
			end
		end
	end
end

Can you show the code for Damagefunc?

sure,

function Damagefunc(Part, hit, minim, maxim, knockback, Type, Property, Delay, HitSound, HitPitch)
	if DoDamage == true then
		if hit.Parent == nil then
			return
		end
		local h = hit.Parent:FindFirstChildOfClass("Humanoid")
		for _, v in pairs(hit.Parent:children()) do
			if v:IsA("Humanoid") then
				h = v
			end
		end
		if h ~= nil and hit.Parent.Name ~= Character.Name and hit.Parent:FindFirstChild("Head") ~= nil then
			if hit.Parent:findFirstChild("DebounceHit") ~= nil and hit.Parent.DebounceHit.Value == true then
				return
			end
			local c = Create("ObjectValue")({
				Name = "creator",
				Value = game:GetService("Players").LocalPlayer,
				Parent = h
			})
			game:GetService("Debris"):AddItem(c, 0.5)
			if HitSound ~= nil and HitPitch ~= nil then
				CFuncs.Sound.Create(HitSound, hit, 1, HitPitch)
			end
			local Damage = math.random(minim, maxim)
			local blocked = false
			local block = hit.Parent:findFirstChild("Block")
			if block ~= nil and block.className == "IntValue" and block.Value > 0 then
				blocked = true
				block.Value = block.Value - 1
				print(block.Value)
			end
			if blocked == false then
				HitHealth = h.Health
				h.MaxHealth = h.MaxHealth

				h.Health = h.Health - Damage
				if HitHealth ~= h.Health and HitHealth ~= 0 and 0 >= h.Health and h.Parent.Name ~= "Hologram" then
					print("gained kill")
					dmg(h.Parent)
				end
				ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, Part.BrickColor.Color)
			else
				h.Health = h.Health - Damage / 2
				ShowDamage(Part.CFrame * CFrame.new(0, 0, Part.Size.Z / 2).p + Vector3.new(0, 1.5, 0), -Damage, 1.5, Part.BrickColor.Color)
			end
			if Type == "Knockdown" then
				local hum = hit.Parent.Humanoid
				hum.PlatformStand = true
				coroutine.resume(coroutine.create(function(HHumanoid)
					swait(1)
					HHumanoid.PlatformStand = false
				end), hum)
				local angle = hit.Position - (Property.Position + Vector3.new(0, 0, 0)).unit
				local bodvol = Create("BodyVelocity")({
					velocity = angle * knockback,
					P = 5000,
					maxForce = Vector3.new(8000, 8000, 8000),
					Parent = hit
				})
				local rl = Create("BodyAngularVelocity")({
					P = 3000,
					maxTorque = Vector3.new(500000, 500000, 500000) * 50000000000000,
					angularvelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10)),
					Parent = hit
				})
				game:GetService("Debris"):AddItem(bodvol, 0.5)
				game:GetService("Debris"):AddItem(rl, 0.5)
			elseif Type == "Normal" then
				local vp = Create("BodyVelocity")({
					P = 500,
					maxForce = Vector3.new(math.huge, 0, math.huge),
					velocity = Property.CFrame.lookVector * knockback + Property.Velocity / 1.05
				})
				if knockback > 0 then
					vp.Parent = hit.Parent.Head
				end
				game:GetService("Debris"):AddItem(vp, 0.5)
			elseif Type == "Up" then
				local bodyVelocity = Create("BodyVelocity")({
					velocity = Vector3.new(0, 20, 0),
					P = 5000,
					maxForce = Vector3.new(8000, 8000, 8000),
					Parent = hit
				})
				game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
				local bodyVelocity = Create("BodyVelocity")({
					velocity = Vector3.new(0, 20, 0),
					P = 5000,
					maxForce = Vector3.new(8000, 8000, 8000),
					Parent = hit
				})
				game:GetService("Debris"):AddItem(bodyVelocity, 1)
			elseif Type == "Leech" then
				local hum = hit.Parent.Humanoid
				if hum ~= nil then
					for i = 0, 2 do
						Effects.Sphere.Create(BrickColor.new("Bright red"), hit.Parent.Torso.CFrame * cn(0, 0, 0) * angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 15, 1, 0, 5, 0, 0.02)
					end
					Humanoid.Health = Humanoid.Health + 10
				end
			elseif Type == "UpKnock" then
				local hum = hit.Parent.Humanoid
				hum.PlatformStand = true
				if hum ~= nil then
					hitr = true
				end
				coroutine.resume(coroutine.create(function(HHumanoid)
					swait(5)
					HHumanoid.PlatformStand = false
					hitr = false
				end), hum)
				local bodyVelocity = Create("BodyVelocity")({
					velocity = Vector3.new(0, 20, 0),
					P = 5000,
					maxForce = Vector3.new(8000, 8000, 8000),
					Parent = hit
				})
				game:GetService("Debris"):AddItem(bodyVelocity, 0.5)
				local bodyVelocity = Create("BodyVelocity")({
					velocity = Vector3.new(0, 20, 0),
					P = 5000,
					maxForce = Vector3.new(8000, 8000, 8000),
					Parent = hit
				})
				game:GetService("Debris"):AddItem(bodyVelocity, 1)
			elseif Type == "Snare" then
				local bp = Create("BodyPosition")({
					P = 2000,
					D = 100,
					maxForce = Vector3.new(math.huge, math.huge, math.huge),
					position = hit.Parent.Torso.Position,
					Parent = hit.Parent.Torso
				})
				game:GetService("Debris"):AddItem(bp, 1)
			elseif Type == "Slashnare" then
				Effects.Block.Create(BrickColor.new("Pastel Blue"), hit.Parent.Torso.CFrame * cn(0, 0, 0), 15*4, 15*4, 15*4, 3*4, 3*4, 3*4, 0.07)
				for i = 1, math.random(4, 5) do
					Effects.Sphere.Create(BrickColor.new("Teal"), hit.Parent.Torso.CFrame * cn(math.random(-5, 5), math.random(-5, 5), math.random(-5, 5)) * angles(math.random(-50, 50), math.random(-50, 50), math.random(-50, 50)), 1, 15, 1, 0, 5, 0, 0.02)
				end
				local bp = Create("BodyPosition")({
					P = 2000,
					D = 100,
					maxForce = Vector3.new(math.huge, math.huge, math.huge),
					position = hit.Parent.Torso.Position,
					Parent = hit.Parent.Torso
				})
				game:GetService("Debris"):AddItem(bp, 1)
			elseif Type == "Spike" then
				CreateBigIceSword(hit.Parent.Torso.CFrame)
				local bp = Create("BodyPosition")({
					P = 2000,
					D = 100,
					maxForce = Vector3.new(math.huge, math.huge, math.huge),
					position = hit.Parent.Torso.Position,
					Parent = hit.Parent.Torso
				})
				game:GetService("Debris"):AddItem(bp, 1)
			elseif Type == "Freeze" then
				local BodPos = Create("BodyPosition")({
					P = 50000,
					D = 1000,
					maxForce = Vector3.new(math.huge, math.huge, math.huge),
					position = hit.Parent.Torso.Position,
					Parent = hit.Parent.Torso
				})
				local BodGy = Create("BodyGyro")({
					maxTorque = Vector3.new(400000, 400000, 400000) * math.huge,
					P = 20000,
					Parent = hit.Parent.Torso,
					cframe = hit.Parent.Torso.CFrame
				})
				hit.Parent.Torso.Anchored = true
				coroutine.resume(coroutine.create(function(Part)
					swait(1.5)
					Part.Anchored = false
				end), hit.Parent.Torso)
				game:GetService("Debris"):AddItem(BodPos, 3)
				game:GetService("Debris"):AddItem(BodGy, 3)
			end
			local debounce = Create("BoolValue")({
				Name = "DebounceHit",
				Parent = hit.Parent,
				Value = true
			})
			game:GetService("Debris"):AddItem(debounce, Delay)
			c = Instance.new("ObjectValue")
			c.Name = "creator"
			c.Value = Player
			c.Parent = h
			game:GetService("Debris"):AddItem(c, 0.5)
		end
	elseif DoDamage == false then
		print("Damage is disabled")
	end

Maybe ingame just send a line of code through the command line that just tries to manually set the orb’s health to some number and see if that works. Right now i’m not sure why it’s not taking away the health. Are you sure that maybe its healthbar just isn’t visible, and its health is actually decreasing?

Before I made the name visible what I did was go manually into the humanoid health value of the orb each time I tried to damage it, each and every time, the health remained 100000 or so (default health)

also the manual depletion did work, the orb is not invincible