LeaderBoard

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

MeHow

Active Member
Feb 6, 2017
140
13
18
22
Lithuania
Hello, I need help with this skript. I have no idea why it's not working no errors no nothing....
Server ver: 1.8
Skript: 2.2

code_language.skript:
command /topreset:
    permission: top.admin
    trigger:
        clear {rank::*}
        clear {rankp::*}
        clear {ranks::*}
        message "{@prefix} Stats' reset completed."
        stop
       
command /top <integer = 1>:
    trigger:
        if {@pages} is equal to 0:
            set {_pages} to 0
            set {_players} to 0
            loop {ranks::*}:
                loop {rank::%loop-index%::*}:
                    set {_players} to {_players}+1
            set {_pages} to {_players}/10
            set {_pages} to rounded up {_pages}
            if {_pages} is 0:
                message "{@prefix} There are no players ranked."
                stop
            if argument is greater than {_pages}:
                message "{@prefix} You have to type a number between &c1 &8and &c%{_pages}%"
                stop
        if argument is less than 1:
            if {@pages} is 0:
                message "{@prefix} You have to type a number between &c1 &8and &c%{_pages}%"
            else:
                message "{@prefix} You have to type a number between &c1 &8and &c{@pages}"
            stop
        if argument is greater than {@pages}:
            if {@pages} is 0:
                if argument is greater than {_pages}:
                    message "{@prefix} You have to type a number between &c1 &8and &c%{_pages}%"
            else:
                message "{@prefix} You have to type a number between &c1 &8and &c{@pages}"
                stop
        if {@pages} is 0:
            message "&4====&7&lTOP %{_players}%&4===="
        else:
            message "&4====&7&lTOP %{@pages}*10%&4===="
        if {@pages} is 0:
            set {_lasttop} to {_players}
            set {_num} to argument*10
            if {_lasttop} is greater than {_num}:
                set {_lasttop} to {_num}
            message "{@prefix}Showing page %argument% of %{_pages}%. Top %(argument*10)-9%-%{_lasttop}%"
        else:
            message "{@prefix} Showing page %argument% of {@pages}. Top %(argument*10)-9%-%argument*10%"
        set {_count} to 0
        set {_number} to (argument*10)-10
        set {_discard} to (argument*10)-10
        set {_showed} to 0
        loop {ranks::*}:
            loop {rank::%loop-index%::*}:
                if {_discard} is equal to 0:
                    set {_list} to loop-value-2
                    set {_count} to {_count}+1
                    set {_number} to {_number}+1
                    set {_points} to ({rankp::%loop-value-2%}-1000000000)*-1
                    if {_count} is greater than 10:
                        exit
                    else:
                        if {_points} is equal to 1:
                            message "&c%{_number}%. &6%{_list}% &e- &a%{_points}% point."
                        else:
                            message "&c%{_number}%. &6%{_list}% &e- &a%{_points}% points."
                        set {_showed} to {_showed}+1
                else:
                    set {_discard} to {_discard}-1
        if {_showed} is equal to 10:
            stop
        else:
            if {@pages} is 0:
                stop
            set {_number} to {_number}+1
            loop 10-{_showed} times:
                message "&c%{_number}%. &6Noone."
                set {_number} to {_number}+1
            stop
        stop
       
command /rank [<text>]:
    trigger:
        if arg 1 is set:
            if {rankp::%argument%} is set:
                set {_points} to {rankp::%argument%}
                set {_count} to 0
                loop {ranks::*}:
                    loop {rank::%loop-index%::*}:
                        set {_count} to {_count}+1
                        if loop-index-2 is equal to argument:
                            message "{@prefix} %argument% is rank &c%{_count}%&6 with &b%{_points}% &8points."
                            stop
            else:
                message "{@prefix} %argument% isn't ranked with &b0 &8points."
        else:
            if {rankp::%player%} is set:
                set {_points} to {rankp::%player%}
                set {_count} to 0
                loop {ranks::*}:
                    loop {rank::%loop-index%::*}:
                        set {_count} to {_count}+1
                        if loop-index-2 is equal to player:
                            message "{@prefix} You are rank &c%{_count}%&6with &b%{_points}% &8points."
            else:
                message "{@prefix} You aren't ranked with &b0 &8points."
        stop      

on death of player:
    loop all players:
        clear {rankp::%uuid of loop-player%}
        clear {Instalpick.%uuid of loop-player%}
        set {Instalpick.%uuid of loop-player%} to "elo.%uuid of loop-player%" in yaml file "plugins/gDuels/config.yml"
        set {rankp::%uuid of loop-player%} to {Instalpick.%uuid of loop-player%}
       

        set name of citizen {_npc.1} to "&b%{PlayerIndic.1}%: &e%{elo.%uuid of %{PlayerIndic.1}%%}%"
        set name of citizen {_npc.2} to "&b%{PlayerIndic.2}%: &e%{elo.%uuid of %{PlayerIndic.2}%%}%"              
        set name of citizen {_npc.3} to "&b%{PlayerIndic.3}%: &e%{elo.%uuid of %{PlayerIndic.3}%%}%"

Thanks for helping :emoji_slight_smile:_
 
Status
Not open for further replies.