When ever I take damage it registers it as normal damage for a second. Sometimes when it reaches to low enough it kills the player normally even when the custom health I made doesnt reach to 0
Code:
on damage:
set {strengthInput::%attacker%} to damage
wait 1 tick
remove {strengthInput::%attacker%} from {health::%uuid of victim%}
set victim's health to ({health::%uuid of victim%} / ({maxhealth::%uuid of victim%} / 20)) / 2
if {health::%uuid of victim%} < 0:
kill the victim
wait 1 second
set {health::%uuid of victim%} to {maxhealth::%uuid of victim%}