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.

TOP PLAYER

Discussion in 'Skript' started by Uzumaki, Jul 26, 2017.

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

    Uzumaki Well-Known Member

    Joined:
    Feb 20, 2017
    Messages:
    310
    Likes Received:
    10
    Hey guys i want to show the player with more kills example "Uzumaki Won With 6 Kills"




    My Fails

    Code (Skript):
    1. sub "winner":  
    2.     set {_1st.point} to 0
    3.     loop {Won::gamekills::*}:
    4.         set {_1st} to loop-index
    5.         set {_1st.point} to loop-value
    6.         wait 2 seconds
    7.         broadcast "&7&e●&l&o &c%{_1st}% &7&lwon with &c&l%{_1st.point}% &cKills &e●&l&o"
    8.         loop all players:
    9.             send loop-player title "&e&c%{_1st}% &7Won &e✦" for 2 seconds      
    10. on death of player:
    11.     add 1 to {Won::gamekills::%attacker%}
    12.  


     
  2. Best Answer:
    Post #3 by ShaneBee, Jul 26, 2017
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Try:
    Code (Skript):
    1. sub "winner":
    2.     set {_1st.point} to 0
    3.     loop {Won::gamekills::*}:
    4.         If loop-value > {_1st.point}:
    5.             set {_1st} to loop-index
    6.             set {_1st.point} to loop-value
    7.     Broadcast "%{_1st}% has the most kills"
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Code (Skript):
    1. # 0:int=0 - function nuller.
    2.  
    3. function winner(0:int=0):
    4.     loop {game::kills::*}:
    5.         set {_kills::%loop-index%} to "%loop-value%;%loop-index%"
    6.         set {_} to 1
    7.         loop {_kills::*}:
    8.             set {_player::*} to split "%{_kills::%loop-index-2%}%" by ";"
    9.             {_player::2} != "<none>":
    10.                 {_player::1} != "<none>":
    11.                     {_} <= 3:
    12.                         broadcast "##%{_}% %{_player::2}% won with %{_player::1}% kills."
    13.                         add 1 to {_}
    14.  
    15. function delwin(0:int=0):
    16.     delete {game::kills::*}
    17.  
    18. on death:
    19.     add 1 to {game::kills::%player%}
    idk how to fix it: [​IMG]
    --- Double Post Merged, Jul 26, 2017, Original Post Date: Jul 26, 2017 ---
    try this
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Or just use what i sended :emoji_stuck_out_tongue:
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Thanks
    --- Double Post Merged, Jul 26, 2017, Original Post Date: Jul 26, 2017 ---
    Thanks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...