I need help fixing a dragon fight skript

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

Jonathan

Member
May 2, 2022
1
0
1
15
So I am working on a skript for a dragon fight on the server I am developing on. I have gotten stuck on the 2 remaining errors, as I do not know how to change the code to fix it. Here is my code:
Code:
on load:
  set {dragonTimer} to 0

every 1 minute:
  add 1 to {dragonTimer}
  if {dragonTimer} is 60:
    set {dragonTimer} to 0
    spawn ender dragon at location 0, 65, 10000 in world "world"
    set last spawned ender dragon's max health to 1000
    set last spawned ender dragon's health to 1000

on damage of ender dragon:
  set {_damage} to damage
  add {_damage} to {damage.%damager%}

on death of ender dragon:
  set {topDamager} to 0
  set {topDamage} to 0
  loop all players:
    if {damage.%loop-player%} is greater than {topDamage}:
      set {topDamage} to {damage.%loop-player%}
      set {topDamager} to loop-player

  if {topDamager} is not 0:
    set {_players} to all players
    remove {_players::*} from {topDamager}
    set {_size} to size of {_players}
    set {_blazePowder} to 1

    loop {_size} times:
      set {_currentPlayer} to {_players::[_loop-number - 1]}
      set {_currentDamage} to {damage.%_currentPlayer%}
      set {item} to blaze powder named "&5Dragon Essence"
      enchant {item} with mending

      if loop-number is 1:
        give 4 of {item} to {_currentPlayer}
      else if loop-number is 2:
        give 3 of {item} to {_currentPlayer}
      else if loop-number is 3:
        give 2 of {item} to {_currentPlayer}
      else:
        give 1 of {item} to {_currentPlayer}

And here are the errors I am getting:
1701484371538.png


I would really appreciate some help.

Thanks,
Jonathan