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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

ScrollBoard (A mouse scrolling scoreboard)

Discussion in 'Snippets' started by LimeGlass, Feb 25, 2017.

  1. LimeGlass

    VIP Supporter Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    621
    Likes Received:
    438
    Medals:
    Basically this is a snippet that creates a scoreboard that will allow users to scroll and display multiple infomation

    Example video:


    Addons needed:

    - SkellettBae

    Raw code:

    Code (Skript):
    1. function ScrollBoardDeleteBoard(p: player):
    2.     loop 15 times:
    3.         delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "Scroll-%{_p}%"
    4.     delete stylish scoreboard "Scroll-%{_p}%"
    5.     delete {ScrollBoard::temp::%{_p}%::data}
    6. on quit:
    7.     ScrollBoardDeleteBoard(player)
    8. on join:
    9.     if stylish scoreboard "Scroll-%player%" exists:
    10.         ScrollBoardDeleteBoard(player)
    11.     add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
    12.     create new stylish scoreboard named "Scroll-%player%"
    13.     set title of stylish scoreboard "Scroll-%player%" to "&6&lScrollBoard"
    14.     set stylish scoreboard of player to "Scroll-%player%"
    15.     loop 15 times: #Size of the scroll board
    16.         create a new id based score "%player%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "Scroll-%player%"
    17.     set {ScrollBoard::temp::%player%::data} to 0
    18.     while player is online:
    19.         wait a tick #Update time
    20.         if {ScrollBoard::temp::%player%::data} < 0:
    21.             if slot of id "%player%Slot1" < 1:
    22.                 set {ScrollBoard::temp::%player%::data} to 1
    23.             else if slot of id "%player%Slot1" = 1:
    24.                 set {ScrollBoard::temp::%player%::data} to 0
    25.         loop 15 times: #Size of the scroll board (Same as above)
    26.             set {_size} to slot of id "%player%Slot%loop-number%"
    27.             set the slot of id "%player%Slot%loop-number%" to {_size} + {ScrollBoard::temp::%player%::data}
    28.         set {ScrollBoard::temp::%player%::data} to 0
    29. on hotbar change:
    30.     if new held slot > past held slot:
    31.         if past held slot is 0:
    32.             if new held slot is 8:
    33.                 subtract 2 from {ScrollBoard::temp::%player%::data}
    34.         add 1 to {ScrollBoard::temp::%player%::data}
    35.     else:
    36.         if past held slot is 8:
    37.             if new held slot is 0:
    38.                 add 2 to {ScrollBoard::temp::%player%::data}
    39.         subtract 1 from {ScrollBoard::temp::%player%::data}
     
    • Like Like x 3

Share This Page

Loading...