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.

Hologram Top 5 Leaderboard

Discussion in 'Skript' started by JustADev, Sep 5, 2017.

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

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    Plugins Installed:
    Skript v2.2
    SkQuery
    Umbaska
    SkDragon
    HolographicDisplays

    Server Version:
    Spigot-1.8-version

    Question:
    Why does my code not recognize the loop-index?
    https://gyazo.com/e795496066943eef7c038a17652b9181

    Code:
    Code (Skript):
    1. every 5 seconds:
    2.     loop {Kills::*}:
    3.         add 1 to {_size}
    4.         if {_LowToHigh::%loop-value%} is not set:
    5.             set {_LowToHigh::%loop-value%} to loop-index
    6.         else:
    7.             set {_n} to 0
    8.     loop {_size} times:
    9.         set {_n} to {_n}+1
    10.         if {_LowToHigh::%loop-value-1%::%{_n}%} is not set:
    11.             set {_LowToHigh::%loop-value-1%::%{_n}%} to loop-index
    12.             exit loop
    13.             set {_n} to size of {_LowToHigh::*}
    14.     loop {_LowToHigh::*}:
    15.         set {_HighToLow::%{_n}%} to loop-value
    16.         set {_n} to {_n}-1
    17.         set {_num} to 0
    18.     loop {_HighToLow::*}:
    19.         add 1 to {_num}
    20.         execute console command "/hd setline top5 %{_num} + 2% &a%loop-value%&8: &e%{Kills::%loop-value%}%"
    21.     if {_num} is 5:
    22.         stop
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Did you debug? Do that to narrow down the problem.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    This is my first time doing this... so idk what loop-index issues are
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    You didn't even answer my question... have you done something like this to debug:
    Code (Skript):
    1. broadcast "%loop-index%"
     
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Says no matching loop
     
Thread Status:
Not open for further replies.

Share This Page

Loading...