R15 and R6 humanoid :TakeDamage()

In my place I have both R15 and R6 humanoids in the same game and :TakeDamage() starts acting funky. TakeDamage() will always work on the R15 humanoid of other players, but it’ll only work once on the R6 humanoid of Bob, all 3 bobs can be killed but once they respawn they cannot be killed again.
However if I turn off R15, Humanoid:TakeDamage() works as its supposed to.

Repro: Make the player into an R15, make an NPC into a R6, kill NPC, let it respawn and try to kill it again.

EDIT: I stand corrected, TakeDamage will almost never work on an R6 humanoid if R15 is enabled.

You can work around this by doing the following:

local function TakeDamage(humanoid,damage)
	if humanoid.Parent == nil then humanoid.Health = humanoid.Health - damage end
	
	local canDamage = true
	for _,i in pairs(humanoid.Parent:children()) do canDamage = canDamage and not i:IsA("ForceField") end

	if canDamage then humanoid.Health = humanoid.Health - damage end
end

TakeDamage(workspace.GuestCapone.Humanoid,30)

Just so you have something that works until this is fixed.

2 Likes