Damage being capped at 53, why?

	if attacker then
		if attacker:GetAttribute("Venomous") == true then
			if ignoredefense ~= true then
				victim:SetAttribute("Venom", math.clamp(math.clamp(victim:GetAttribute("Venom")+5,0,victim.MaxHealth/2)-victim:GetAttribute("Defense"),0,victim.MaxHealth/2))
			else
				victim:SetAttribute("Venom", math.clamp(victim:GetAttribute("Venom")+5,0,victim.MaxHealth/2))
			end
		end
	end

second block:

	if venom == true then
		victim:SetAttribute("Venom", math.clamp(victim:GetAttribute("Venom")+damage,0,victim.MaxHealth*0.75))
	end

if the attacker has the “Venomous” attribute set to true then it will add 5 damage to whatever amount of normal damage they did, no problem. (the capping for it works too) and if the “venom” boolean is set to true in the function then the damage will be converted to venom damage. but if both are enabled at the same time the damage still works but it gets capped at 53 venom only, I’ve been trying to fix this for so long and I’ve tried a bunch of different things. help, please.

1 Like

there must be no solution to this, probably an engine bug then.
dang.

1 Like

Probably to do with that line. Normally max health is 100, so half is 50, pretty close to the 53.Does adjusting it have any effect?

it basically fixes it but the +5 venom still goes until the cap hits, but I can just add a check for if the players venom is half the max health then it won’t do it, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.