I'm having problems with looping until a certain variable is true. Please help me.

  • 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 community!

    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!

ProLamb231

Member
Jul 26, 2024
13
1
3
Hello, I am relatively new to skript. I am having trouble making my combatlog skript due to this one error that I keep stumbling uppon. Here is my code:

on damage:
if {combatlog} is not set:
set {combatlog} to true
if {combatlog} is true:
send "&cYou are now in combat!" to victim and attacker
set {combatlog::%victim's uuid%} to 10
set {combatlog::%attacker's uuid%} to 10
loop until {combatlog::%attacker's uuid%} and {combatlog::%victim's uuid%} = 0:
wait 1 second
decrease {combatlog::%victim's uuid%} by 1
decrease {combatlog::%attacker's uuid%} by 1
send actionbar "&cCombat tag: %{combatlog::%attacker's uuid%}%" to attacker
send actionbar "&cCombat tag: %{combatlog::%victim's uuid%}%" to victim
send "&aYou are no longer in combat!" to victim and attacker
send actionbar "&aYou are no longer in combat!" to victim and attacker
delete {combatlog::%victim's uuid%}
delete {combatlog::%attacker's uuid%}

There is more code underneath this that is not important to what I need help with.