how to make a token top

Discussion in 'Skript' started by hassan7000, Nov 13, 2017.

  1. i made a token skript and i need a commands like /token top and it will show all the players with the highest amount of tokens but i have no idea how to make that can someone help me
     
  2. how do you save the tokens? file or database? if database, what kind of database?
     
  3. i dont know what you mean if you mean what the variable is {tokens.%player%}

    or the variable is saved in the skript variable.csv
     
  4. Use ::’s and also, use the players UUID as it’s safer and works better.
     
  5. Try to save your variable like
    {tokens::%player%}
    Then you can get something like this:

    Code (Text):
    set {_1st.point} to 0
                    set {_2nd.point} to 0
                    set {_3rd.point} to 0
                    set {_4th.point} to 0
                    set {_5th.point} to 0
                    loop {tokens::*}:
                        if loop-value is more than {_1st.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to {_3rd}
                            set {_4th.point} to {_3rd.point}
                            set {_3rd} to {_2nd}
                            set {_3rd.point} to {_2nd.point}
                            set {_2nd} to {_1st}
                            set {_2nd.point} to {_1st.point}
                            set {_1st} to loop-index
                            set {_1st.point} to loop-value
                        else if loop-value is more than {_2nd.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to {_3rd}
                            set {_4th.point} to {_3rd.point}
                            set {_3rd} to {_2nd}
                            set {_3rd.point} to {_2nd.point}
                            set {_2nd} to loop-index
                            set {_2nd.point} to loop-value
                        else if loop-value is more than {_3rd.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to {_3rd}
                            set {_4th.point} to {_3rd.point}
                            set {_3rd} to loop-index
                            set {_3rd.point} to loop-value
                        else if loop-value is more than {_4th.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to loop-index
                            set {_4th.point} to loop-value
                        else if loop-value s more than {_5th.point}:
                            set {_5th} to loiop-index
                            set {_5th.point} to loop-value

     
     
  6. how do make the command /token top with that

    Thanks for your time
     
  7. First of all, the variable you have to use is {token::*}
    example:
    command /test:
    trigger:
    set {token::%player%} to 0

    then use this:

    Code (Text):
    command /token top:
            trigger:
                    set {_1st.point} to 0
                    set {_2nd.point} to 0
                    set {_3rd.point} to 0
                    set {_4th.point} to 0
                    set {_5th.point} to 0
                    loop {tokens::*}:
                        if loop-value is more than {_1st.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to {_3rd}
                            set {_4th.point} to {_3rd.point}
                            set {_3rd} to {_2nd}
                            set {_3rd.point} to {_2nd.point}
                            set {_2nd} to {_1st}
                            set {_2nd.point} to {_1st.point}
                            set {_1st} to loop-index
                            set {_1st.point} to loop-value
                        else if loop-value is more than {_2nd.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to {_3rd}
                            set {_4th.point} to {_3rd.point}
                            set {_3rd} to {_2nd}
                            set {_3rd.point} to {_2nd.point}
                            set {_2nd} to loop-index
                            set {_2nd.point} to loop-value
                        else if loop-value is more than {_3rd.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to {_3rd}
                            set {_4th.point} to {_3rd.point}
                            set {_3rd} to loop-index
                            set {_3rd.point} to loop-value
                        else if loop-value is more than {_4th.point}:
                            set {_5th} to {_4tlmg}
                            set {_5th.point} to {_4th.point}
                            set {_4tlmg} to loop-index
                            set {_4th.point} to loop-value
                        else if loop-value s more than {_5th.point}:
                            set {_5th} to loiop-index
                            set {_5th.point} to loop-value
                send "TOP TOKES"
                send "##1 %_1st% -> %_1st.point%" to player
                send "##1 %_2nd% -> %_2nd.point%" to player
                send "##1 %_3rd% -> %_3rd.point%" to player
                send "##1 %_4th% -> %_4th.point%" to player
                send "##1 %_5th% -> %_5th.point%" to player
       
     
    And that's it
     
  8. Thank you