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.

Solved TopKills - Blank list

Discussion in 'Skript' started by Simon942, Dec 27, 2018.

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

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi there

    I have a problem with this skript: https://pastebin.com/njG4btAu
    The problem is that it doesn't show the TopKillers.
    Only the message --TOP KILLS-- that is inserted in the options:
    But why it doesn't works... i don't know i have tried all. And i can't understand it.

    There are no errors at all.

    Full code:
    Code (Skript):
    1. options:
    2.     servernavn: &e&lCombo&c&lPVP #navn på scoreboard.
    3.  
    4.  
    5. every 1 second:
    6.     loop all players:
    7.         wipe loop-player's sidebar
    8.         set name of sidebar of loop-player to "  {@servernavn}  "
    9.         set score " &b&l" in sidebar of loop-player to 10
    10.         set score " &a&lStats:" in sidebar of loop-player to 9
    11.         set score "  &7Kills: &a%{kills.%loop-player%}%" in sidebar of loop-player to 8
    12.         set score "  &7Dødsfald: &a%{deahts.%loop-player%}%" in sidebar of loop-player to 7
    13.         set score "  &7KillStreak: &a%{ks.%loop-player%}%" in sidebar of loop-player to 6
    14.         set score "  &7Penge: &a%loop-player's money%" in sidebar of loop-player to 5
    15.         set score "&b" in sidebar of loop-player to 4
    16.         set score " &a&lServeren:" in sidebar of loop-player to 3
    17.         set score "  &7Online: &a%number of all players%" in sidebar of loop-player to 2
    18.         set score "  &7Ping: &a%loop-player's ping%" in sidebar of loop-player to 1
    19.         set score " &a&l" in sidebar of loop-player to 0      
    20.  
    21. variables:
    22.     {ks.%player%} = 0
    23.     {kills.%player%} = 0
    24.     {deahts.%player%} = 0
    25.  
    26.  
    27. on death:
    28.     attacker is a player
    29.     add 1 to {kills.%attacker%}
    30.     add 1 to {ks.%attacker%}
    31.     add 1 to {deahts.%victim%}
    32.  
    33. on death of player:
    34.     set {ks.%player%} to 0
    35.    
    36.    
    37.    
    38.    
    39.    
    40.    
    41. options:
    42.     top10: &c&l--TOP KILLS--  
    43.    
    44. command /top10:
    45.     trigger:
    46.         loop {kills::*}:
    47.             add 1 to {_size}
    48.             if {_low.to.high.list::%loop-value%} is not set:
    49.                 set {_low.to.high.list::%loop-value%} to loop-index
    50.             else:
    51.                 set {_n} to 0
    52.                 loop {_size} times:
    53.                     set {_n} to {_n}+1
    54.                     {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
    55.                     set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
    56.                     stop loop
    57.         wait 1 tick
    58.         set {_n} to size of {_low.to.high.list::*}
    59.         loop {_low.to.high.list::*}:
    60.             set {_high.to.low.list::%{_n}%} to loop-value
    61.             set {_n} to {_n}-1
    62.         wait 1 tick
    63.         send "{@top10}" to player
    64.         loop {_high.to.low.list::*}:
    65.             add 1 to {_result}
    66.             send "&f%loop-value%&7: &c%{kills::%loop-value%}% kills" to player
    67.             if {_result} is 10:
    68.                 stop
    69.  
    70.    
    71.    
    72.    
    73.    


     
  2. Best Answer:
    Post #8 by Runakai, Dec 27, 2018
  3. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Your variables have to be {kills::%player%} instead of just {Kills,%player%}
     
  4. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi there

    Thank you for the answear!
    I tried to change my variable to this:
    Code (Skript):
    1. variables:
    2.     {ks.%player%} = 0
    3.     {kills::%player%} = 0
    4.     {deahts.%player%} = 0
    But it still just shows the --TOP KILLS-- header then i type /Top10

    /top10 configuration:
    Code (Skript):
    1. options:
    2.     top10: &c&l--TOP KILLS--  
    3.    
    4. command /top10:
    5.     trigger:
    6.         loop {kills::*}:
    7.             add 1 to {_size}
    8.             if {_low.to.high.list::%loop-value%} is not set:
    9.                 set {_low.to.high.list::%loop-value%} to loop-index
    10.             else:
    11.                 set {_n} to 0
    12.                 loop {_size} times:
    13.                     set {_n} to {_n}+1
    14.                     {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
    15.                     set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
    16.                     stop loop
    17.         wait 1 tick
    18.         set {_n} to size of {_low.to.high.list::*}
    19.         loop {_low.to.high.list::*}:
    20.             set {_high.to.low.list::%{_n}%} to loop-value
    21.             set {_n} to {_n}-1
    22.         wait 1 tick
    23.         send "{@top10}" to player
    24.         loop {_high.to.low.list::*}:
    25.             add 1 to {_result}
    26.             send "&f%loop-value%&7: &c%{kills::%loop-value%}% kills" to player
    27.             if {_result} is 10:
    28.                 stop
     
  5. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Code (Skript):
    1.  
    2. command /topkills:
    3.     trigger:
    4.         loop {kill::*}:
    5.             add 1 to {_size}
    6.             if {_low.to.high.list::%loop-value%} is not set:
    7.                 set {_low.to.high.list::%loop-value%} to loop-index
    8.             else:
    9.                 set {_n} to 0
    10.                 loop {_size} times:
    11.                     set {_n} to {_n}+1
    12.                     {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
    13.                     set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
    14.                     stop loop
    15.         wait 1 tick
    16.         set {_n} to size of {_low.to.high.list::*}
    17.         loop {_low.to.high.list::*}:
    18.             set {_high.to.low.list::%{_n}%} to loop-value
    19.             set {_n} to {_n}-1
    20.         wait 1 tick
    21.         set {_i} to 0
    22. #THIS IS THE MESSAGE WITH TOP KILLS
    23.         send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
    24.         loop {_high.to.low.list::*}:
    25.             add 1 to {_topnumber}
    26.             set {_player} to "%loop-value%" parsed as offlineplayer
    27.             send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value%}% Kills"
    28.             add 1 to {_i}
    29.             if {_topnumber} > 9: #this is top 10 you can change it
    30.                 stop
    31.         send "&7&m------------------------------"
    32. on join:
    33.     if {kill::%player%} is not set:
    34.         set {kill::%player%} to 0
    35.     if {death::%player%} is not set:
    36.         set {death::%player%} to 0
    That's the original code. Try using this one instead
     
  6. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi there

    I changed in the skript for get it compatible with my own pvp stats skript and Scoreboard.
    So i don't need to reset the players stats.

    Best regards Simon
     
  7. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Actually I am focusing about the top 10 part ant not the variable. Your's looks different than mine and mine works well. Just change the name of the variable in the one i've sent you
     
  8. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    Hi again

    I paste the full code: https://pastebin.com/yJPTRpr0
    For now it only says there are two things: Name conflict with the variables.
    Screenshot: http://prntscr.com/m01aza

    My plan is: To make a command as players can use everywhere and a leaderboard for top kills on signs with a players skull.
    But first i need to get the command to work, and after that we can go further with the sign setup.

    Best regards Simon
    --- Double Post Merged, Dec 27, 2018, Original Post Date: Dec 27, 2018 ---
    I really pleasure your help!
     
  9. Runakai

    Moderator Supporter

    Joined:
    Apr 27, 2018
    Messages:
    497
    Likes Received:
    31
    Well it's not that much of a problem tbh. Does it work tho?
     
  10. Simon942

    Simon942 Member

    Joined:
    Sep 22, 2018
    Messages:
    46
    Likes Received:
    1
    It works fine now :emoji_slight_smile:
    Thank you alot
     
Thread Status:
Not open for further replies.

Share This Page

Loading...