1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Message most damage player

Discussion in 'Skript' started by entwickeln, May 21, 2022.

Thread Status:
Not open for further replies.
  1. entwickeln

    entwickeln Member

    Joined:
    May 11, 2022
    Messages:
    40
    Likes Received:
    0
    Hey, how can i message the player that did the most damage to an Enderdragon?
    Here is my Code:


    1. on damage:
    2. if victim is ender dragon:
    3. if victim's world is "EnderdrachenEvent":
    4. add damage to {enderdamage::%attacker%}
    5. on death:
    6. if victim is ender dragon:
    7. if victim's world is "EnderdrachenEvent":
    8. h = 0
    9. loop {enderdamage::%attacker%}:
    10. if h < {enderdamage::%loop-index%}:
    11. h = {enderdamage::%loop-index%}
     
  2. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    Code (Text):
    1. command /test:
    2.     trigger:
    3.         loop {enderdamage::*}:
    4.             add 1 to {_size}
    5.             if {_low.to.high.list::%loop-value%} is not set:
    6.                 set {_low.to.high.list::%loop-value%} to loop-index
    7.             else:
    8.                 set {_n} to 0
    9.                 loop {_size} times:
    10.                     set {_n} to {_n}+1
    11.                     {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
    12.                     set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
    13.                     stop loop
    14.         wait 1 tick
    15.         set {_n} to size of {_low.to.high.list::*}
    16.         loop {_low.to.high.list::*}:
    17.             set {_high.to.low.list::%{_n}%} to loop-value
    18.             set {_n} to {_n}-1
    19.         wait 1 tick
    20.         set {_i} to 0
    21.        
    22.         loop {_high.to.low.list::*}:
    23.             set {_player} to "%loop-value%" parsed as offlineplayer
    24.             broadcast "%{_player}% Dit the most damage"
    25.             #give reward to the {_player}
    Try this I took this code from here https://parser.skunity.com/resource/162
     
Thread Status:
Not open for further replies.

Share This Page

Loading...