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.

leaderboard

Discussion in 'Skript' started by Ter2FIc, Jan 22, 2021.

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

    Ter2FIc Member

    Joined:
    Dec 30, 2020
    Messages:
    20
    Likes Received:
    0
    Code (Text):
    1.  
    2. on death of player:
    3.     add 1 to {honor::%attacker%}
    4.     message "&fYou got &41 &3honor &fby killing %victim%!" to attacker
    5.     remove 10 from {honor::%victim%}
    6.     message "&fYou lost &410 &3honor &f because you were killed by %attacker%." to victim
    7.  
    8. command /viewpoint:
    9.     trigger:
    10.         send "You have total &3%{honor::%player%}% &fhonor."
    11.  
    12.  
    13. command /tophonor:
    14.     trigger:
    15.         loop {honor::*}:
    16.             add 1 to {_size}
    17.             if {_low.to.high.list::%loop-value%} is not set:
    18.                 set {_low.to.high.list::%loop-value%} to loop-index
    19.             else:
    20.                 set {_n} to 0
    21.                 loop {_size} times:
    22.                     set {_n} to {_n}+1
    23.                     {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
    24.                     set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
    25.                     stop loop
    26.         wait 1 tick
    27.         set {_n} to size of {_low.to.high.list::*}
    28.         loop {_low.to.high.list::*}:
    29.             set {_high.to.low.list::%{_n}%} to loop-value
    30.             set {_n} to {_n}-1
    31.         wait 1 tick
    32.         set {_i} to 0
    33.         send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
    34.         loop {_high.to.low.list::*}:
    35.             add 1 to {_topnumber}
    36.             set {_player} to "%loop-value%" parsed as offlineplayer
    37.             send "&7%{_topnumber}% - &c%{_player}% &8» &7%{honor::%loop-value%}% Honors"
    38.             add 1 to {_i}
    39.             if {_topnumber} > 10:
    40.                 stop
    41.         send "&7&m------------------------------"
    So I wrote those codes to display the player with the most honor in-text :emoji_grinning:
    But I wanted to display it on the leaderboard with a placeholder.
    But I don't know how. :emoji_frowning:
    What variables should I write for the placeholder?
    %skript_?%
     
  2. Ter2FIc

    Ter2FIc Member

    Joined:
    Dec 30, 2020
    Messages:
    20
    Likes Received:
    0
    Yeah I know I need to use skript in placeholder. But I am asking what variable name I need to use.
     
  3. D4isDAVID

    D4isDAVID Member

    Joined:
    Jun 19, 2020
    Messages:
    48
    Likes Received:
    2
  4. Ter2FIc

    Ter2FIc Member

    Joined:
    Dec 30, 2020
    Messages:
    20
    Likes Received:
    0
    so should I use %skript_low.to.high.list::{loop-value}% or what. I don't know what variable.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...