Solved TopKills - Blank list

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

Simon942

Member
Sep 22, 2018
46
1
0
21
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_language.skript:
options:
    servernavn: &e&lCombo&c&lPVP #navn på scoreboard.
 
  
every 1 second:
    loop all players:
        wipe loop-player's sidebar
        set name of sidebar of loop-player to "  {@servernavn}  "
        set score " &b&l" in sidebar of loop-player to 10
        set score " &a&lStats:" in sidebar of loop-player to 9
        set score "  &7Kills: &a%{kills.%loop-player%}%" in sidebar of loop-player to 8
        set score "  &7Dødsfald: &a%{deahts.%loop-player%}%" in sidebar of loop-player to 7
        set score "  &7KillStreak: &a%{ks.%loop-player%}%" in sidebar of loop-player to 6
        set score "  &7Penge: &a%loop-player's money%" in sidebar of loop-player to 5
        set score "&b" in sidebar of loop-player to 4
        set score " &a&lServeren:" in sidebar of loop-player to 3
        set score "  &7Online: &a%number of all players%" in sidebar of loop-player to 2
        set score "  &7Ping: &a%loop-player's ping%" in sidebar of loop-player to 1
        set score " &a&l" in sidebar of loop-player to 0       
 
variables:
    {ks.%player%} = 0
    {kills.%player%} = 0
    {deahts.%player%} = 0
 
 
on death:
    attacker is a player
    add 1 to {kills.%attacker%}
    add 1 to {ks.%attacker%}
    add 1 to {deahts.%victim%}
 
on death of player:
    set {ks.%player%} to 0
    
    
    
    
    
    
options:
    top10: &c&l--TOP KILLS--   
    
command /top10:
    trigger:
        loop {kills::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
                    set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        send "{@top10}" to player
        loop {_high.to.low.list::*}:
            add 1 to {_result}
            send "&f%loop-value%&7: &c%{kills::%loop-value%}% kills" to player
            if {_result} is 10:
                stop
 
Your variables have to be {kills::%player%} instead of just {Kills,%player%}
 
Hi there

Thank you for the answear!
I tried to change my variable to this:
code_language.skript:
variables:
    {ks.%player%} = 0
    {kills::%player%} = 0
    {deahts.%player%} = 0
But it still just shows the --TOP KILLS-- header then i type /Top10

/top10 configuration:
code_language.skript:
options:
    top10: &c&l--TOP KILLS--   
    
command /top10:
    trigger:
        loop {kills::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
                    set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        send "{@top10}" to player
        loop {_high.to.low.list::*}:
            add 1 to {_result}
            send "&f%loop-value%&7: &c%{kills::%loop-value%}% kills" to player
            if {_result} is 10:
                stop
 
Hi there

Thank you for the answear!
I tried to change my variable to this:
code_language.skript:
variables:
    {ks.%player%} = 0
    {kills::%player%} = 0
    {deahts.%player%} = 0
But it still just shows the --TOP KILLS-- header then i type /Top10

/top10 configuration:
code_language.skript:
options:
    top10: &c&l--TOP KILLS--  
   
command /top10:
    trigger:
        loop {kills::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
                    set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        send "{@top10}" to player
        loop {_high.to.low.list::*}:
            add 1 to {_result}
            send "&f%loop-value%&7: &c%{kills::%loop-value%}% kills" to player
            if {_result} is 10:
                stop
code_language.skript:
command /topkills:
    trigger:
        loop {kill::*}:
            add 1 to {_size}
            if {_low.to.high.list::%loop-value%} is not set:
                set {_low.to.high.list::%loop-value%} to loop-index
            else:
                set {_n} to 0
                loop {_size} times:
                    set {_n} to {_n}+1
                    {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
                    set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                    stop loop
        wait 1 tick
        set {_n} to size of {_low.to.high.list::*}
        loop {_low.to.high.list::*}:
            set {_high.to.low.list::%{_n}%} to loop-value
            set {_n} to {_n}-1
        wait 1 tick
        set {_i} to 0
#THIS IS THE MESSAGE WITH TOP KILLS
        send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
        loop {_high.to.low.list::*}:
            add 1 to {_topnumber}
            set {_player} to "%loop-value%" parsed as offlineplayer
            send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value%}% Kills"
            add 1 to {_i}
            if {_topnumber} > 9: #this is top 10 you can change it
                stop
        send "&7&m------------------------------"
on join:
    if {kill::%player%} is not set:
        set {kill::%player%} to 0
    if {death::%player%} is not set:
        set {death::%player%} to 0

That's the original code. Try using this one instead
 
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
 
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
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
 
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
[doublepost=1545896578,1545896547][/doublepost]I really pleasure your help!
 
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
[doublepost=1545896578,1545896547][/doublepost]I really pleasure your help!
Well it's not that much of a problem tbh. Does it work tho?
 
Status
Not open for further replies.