Custom damage skript no work

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Fwify

Member
May 17, 2024
1
0
1
14
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%}