Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #function Scoreboard(p: player):
- # set {_money} to {_p}'s balance
- #wipe {_p}'s sidebar
- #set name of sidebar of {_p} to "&6&lRoaming"
- #set score "&f" in sidebar of {_p} to 10
- #set score "&d &8β¦ &fRank: &a%{_p}'s prefix%" in sidebar of {_p} to 9
- #set score "&b &8β¦ &fBalance: &a%{_money}%" in sidebar of {_p} to 8
- function createBoard(p: player, t: text, size: integer = 15):
- add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
- if stylish scoreboard "%{_t}%-%{_p}%" does not exist:
- create new stylish scoreboard named "%{_t}%-%{_p}%"
- loop {_size} times:
- create a new id based score "%{_p}%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "%{_t}%-%{_p}%"
- function deleteBoard(p: player, t: text):
- loop 15 times:
- delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "%{_t}%-%{_p}%"
- delete stylish scoreboard "%{_t}%-%{_p}%"
- function setSlot(p: player, board: text, slot: integer, t: text):
- add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
- if {_slot} is between 1 and 15:
- set text of id "%{_p}%Slot%{_slot}%" to "%{_d::%{_slot}%}%%{_t}%"
- function updateBoard(p: player):
- setSlot({_p}, "main", 10, "&f")
- setSlot({_p}, "main", 9, "&b &8β¦ &fRank: &a%{_p}'s prefix%")
- setSlot({_p}, "main", 8, "&a &8β¦ &fBalance: &a%{_p}'s balance%")
- on join:
- createBoard(player, "main", 10)
- set title of stylish scoreboard "main-%player%" to "&6&lRoaming"
- set stylish scoreboard of player to "main-%player%"
- while player is online:
- updateBoard(player)
- wait 2 seconds
- on quit:
- deleteBoard(player, "main")
Add Comment
Please, Sign In to add comment