Hello, I am trying to make a combat log like skript. For some reason this always crash my game when i get damaged by someone, and doesnt even work how it should be (if you get damaged twice, or if you get damaged while the "while blabla" system is working the "while" system get doubled or happen again), can someone help me please ? this is my code, Thank you !
Code:
on damage:
attacker is player
victim is player
set metadata tag "damaged" of victim to true
set {cb.time.%victim's uuid%} to 10
while {cb.time.%victim's uuid%} is higher than 0:
if metadata tag "damaged" of victim is false:
send action bar "Combat %{cb.time.%victim's uuid%}%" to victim
wait 1 second
subtract 1 from {cb.time.%victim's uuid%}