#damage negating skript not working

1 messages · Page 1 of 1 (latest)

steep forge
#

I have this code

    if victim is a player:
        set {_damage} to damage
        set {_armor} to victim's armor final attribute
        set {_newDamage} to {_damage} - {_armor}
        
        broadcast "Original Damage: %{_damage}%"
        broadcast "Armor: %{_armor}%"
        broadcast "New Damage: %{_newDamage}%"
        
        if {_newDamage} < 1:
            set {_newDamage} to 1
            
        set damage to {_newDamage}```

but it broadcasts 1.5 new damage and original damage when im hit by a husk while wearing 0 armor, but it doesn't do damage to me. how do I fix it so it actually does damage?
normal lintel
#

well you're checking if {_newDamage} is less than 1 instead of greater than

#

you can also use the min function set {_newDamage} to min({_newDamage}, 1)

#

remember the alligator eats the bigger number :)

steep forge
normal lintel
#

oh