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.

See who did the most damage?

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

  1. entwickeln

    entwickeln Member

    Joined:
    May 11, 2022
    Messages:
    40
    Likes Received:
    0
    Hello Guys. :emoji_grinning: I wanted to ask if there is a method in Skript that shows you, who did the most damage to an enderdragon or the most hits.
    I want to make an Event where people have to fight against a Enderdragon and the person who did the most hits/damage gets a gift. :emoji_slight_smile:'

    And second question: Is there a way to execute a command when the enderdragon dies in world "EnderdrachenEvent"?

    Help me pls xd
    And thanks for every help
     
  2. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    You can add the number of hits to a list and the damage to another list then check the highest hits and damage and make another list and add those two values and the hiest score wins the event. I am not sure how to check the hiest score of a list but I can help you on how to define the list
    Code (Text):
    1. On damage of ender dragon:
    2.     Victim is in world "world name"
    3.     Set {damage_deal::%attacker's uuid%} to last damage cause of victim#not sure of this works not test it
    4.     Set {hits_deal::%attacker's uuid%} to {hits_deal::%attacker's uuid%} + 1 #im sure this will work to store hits
    5.     Set {total_score::%attacker's uuid%} to {damage_deal::%attacker's uuid%} + {hits_deal::%attacker's uuid%}
    6.  
    7. #now find a way to check every player total score when the event ends this have to be done with loops
    8.  
    And for the command part just use on death of ender dragon and use the condition world you have to do something like if victim is in world "world name":

    To check who is the highest score try to make that using this code https://forums.skunity.com/threads/how-to-sort-things-in-list-variables.3664/
     
    #2 Mich, May 16, 2022
    Last edited: May 16, 2022
  3. entwickeln

    entwickeln Member

    Joined:
    May 11, 2022
    Messages:
    40
    Likes Received:
    0
    What Addons do i need for this?
    It can't understand "
    set {total_score::%attacker's uuid%} to sorted {Kills::*} from highest to lowest"
     
  4. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    RandomSK
     
  5. entwickeln

    entwickeln Member

    Joined:
    May 11, 2022
    Messages:
    40
    Likes Received:
    0
    It's not working
    --- Double Post Merged, May 22, 2022, Original Post Date: May 22, 2022 ---
    RandomSK is red when i do /pl
    idk why pls help xd
     
  6. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    Try using
    The latest version of skript and random sk and paper 1.18.2

    We're I got the example Shane said it worked using this versions and the other guy was using paper 1.8 and don't work
    Works fine using:
    - RandomSK 2.7.1
    - Bensku's Skript fork: dev-25
    - PaperSpigot for 1.11.2 (Paper-1079)
     
  7. entwickeln

    entwickeln Member

    Joined:
    May 11, 2022
    Messages:
    40
    Likes Received:
    0
    do you know how i can loop all players EXCEPT Shroush and Testperson21?

    loop all players:
    set {_player} to random element of all players
    if player is "Shroush" or "TestPerson21":
    repeat loop <--- how can i make this repeat the thing again when someone is called like this? or how can i set a random player in {_player} except Shroush or TestPerson21?

    pls help
     
  8. Mich

    Mich Active Member

    Joined:
    Jul 15, 2020
    Messages:
    145
    Likes Received:
    5
    If loop-player is not "examplePlayer" or "example Player2"
     

Share This Page

Loading...