Sort most damage/hits

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

Status
Not open for further replies.

entwickeln

Member
May 11, 2022
40
0
6
21
Hello guys, i tried to make an enderdragon event.
The guy who did the moste damage to the enderdragon gets an reward, but it gives me error.
Is this right what i do?
Do i need any special addon for this.
Here is the script pls help me:

options:
Prefix: &cTest


command /enderdrachenevent:
permission: server.enderdrachenevent.use
permission message: "{@Prefix} §cDu bist nicht dazu befugt, diesen Befehl auszuführen§7." to player
trigger:
make console execute command "/mvcreate EnderdrachenEvent END"
wait 5 seconds
set {start} to true
play sound "entity.ender_dragon.growl" with volume 0.35 and pitch 1 to all players
broadcast "{@Prefix} &7Das &2Enderdrachen Event &7hat nun gestartet. &8» &a/enderdrache"
broadcast "{@Prefix} &7Noch &260 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 30 seconds
broadcast "{@Prefix} &7Noch &230 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 15 seconds
broadcast "{@Prefix} &7Noch &215 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 10 seconds
broadcast "{@Prefix} &7Noch &25 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 1 second
broadcast "{@Prefix} &7Noch &24 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 1 second
broadcast "{@Prefix} &7Noch &23 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 1 second
broadcast "{@Prefix} &7Noch &22 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 1 second
broadcast "{@Prefix} &7Noch &21 &7Sekunden, bis zum Start des Events."
play sound "block.note_block.pling" with volume 0.35 and pitch 1 to all players
wait 1 second
make console execute command "/pex group spieler add multiverse.teleport.self.EnderdrachenEvent"
if {EnderdracheListe::*} contains player:
make player execute command "/mvtp EnderdrachenEvent"
wait 1 second
broadcast "{@Prefix} &7Das Event hat &anun &7gestartet."
send all players in world "EnderdrachenEvent" title "{@Prefix}" with subtitle "§7&oMache am meisten Schaden am Enderdrachen" for 3 seconds
play sound "entity_player_levelup" with volume 0.35 and pitch 1 to all players in world "EnderdrachenEvent"

On damage of ender dragon:
Victim is in world "EnderdrachenEvent"
set {damage_deal::%attacker's uuid%} to last damage cause of victim
set {hits_deal::%attacker's uuid%} to {hits_deal::%attacker's uuid%} + 1 hits
set {total_score::%attacker's uuid%} to {damage_deal::%attacker's uuid%} + {hits_deal::%attacker's uuid%}
set {Toplist::*} to sorted {total_score::%attacker's uuid%} from highest to lowest !!(GIVES ERROR HERE))
send message "&7&m-----------&8< &2Top10 &8>&7&m-----------" to player !(GIVES ERROR HERE))
loop {TopList::*}:
message "%loop-index%: %loop-value%" !(GIVES ERROR HERE))
wait 5 seconds

on death of ender dragon:
if {EnderdracheListe::*} contains player:
make player execute command "spawn"
wait 2 seconds
make console execute command "/mvimport EnderdrachenEvent normal"
wait 2 ticks
make console execute command "/mvdelete EnderdrachenEvent"
wait 2 ticks
make console execute command "/mv confirm"
set {start} to false
remove all players from {EnderdracheListe::*}



command /enderdrache:
trigger:
if {start} is true:
add player to {EnderdracheListe::*}
send message "{@Prefix} &7Du wurdest zum &2Enderdrachen Event &7hinzugefügt." to player
else:
send message "{@Prefix} &7Momentan ist kein &2Enderdrachen Event &7am laufen."


THE ERROR:
 
Can you please use the code block by clicking the + sign and selecting Code on it? Also, what is the error?
 
Status
Not open for further replies.