Oxalist

Scoreboard Skript

Mar 7th, 2020 (edited)
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. #function Scoreboard(p: player):
  2. # set {_money} to {_p}'s balance
  3. #wipe {_p}'s sidebar
  4. #set name of sidebar of {_p} to "&6&lRoaming"
  5. #set score "&f" in sidebar of {_p} to 10
  6. #set score "&d &8➦ &fRank: &a%{_p}'s prefix%" in sidebar of {_p} to 9
  7. #set score "&b &8➦ &fBalance: &a%{_money}%" in sidebar of {_p} to 8
  8.  
  9. function createBoard(p: player, t: text, size: integer = 15):
  10. add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
  11. if stylish scoreboard "%{_t}%-%{_p}%" does not exist:
  12. create new stylish scoreboard named "%{_t}%-%{_p}%"
  13. loop {_size} times:
  14. create a new id based score "%{_p}%Slot%loop-number%" with text "%{_d::%loop-number%}%" slot loop-number for stylish scoreboard "%{_t}%-%{_p}%"
  15. function deleteBoard(p: player, t: text):
  16. loop 15 times:
  17. delete the id based score "%{_p}%Slot%loop-number%" in stylish scoreboard "%{_t}%-%{_p}%"
  18. delete stylish scoreboard "%{_t}%-%{_p}%"
  19. function setSlot(p: player, board: text, slot: integer, t: text):
  20. add "&a", "&b", "&c", "&d", "&e", "&1", "&2", "&3", "&4", "&5", "&6", "&7", "&8", "&9" and "&f" to {_d::*}
  21. if {_slot} is between 1 and 15:
  22. set text of id "%{_p}%Slot%{_slot}%" to "%{_d::%{_slot}%}%%{_t}%"
  23.  
  24. function updateBoard(p: player):
  25. setSlot({_p}, "main", 10, "&f")
  26. setSlot({_p}, "main", 9, "&b &8➦ &fRank: &a%{_p}'s prefix%")
  27. setSlot({_p}, "main", 8, "&a &8➦ &fBalance: &a%{_p}'s balance%")
  28.  
  29.  
  30. on join:
  31. createBoard(player, "main", 10)
  32. set title of stylish scoreboard "main-%player%" to "&6&lRoaming"
  33. set stylish scoreboard of player to "main-%player%"
  34. while player is online:
  35. updateBoard(player)
  36. wait 2 seconds
  37.  
  38. on quit:
  39. deleteBoard(player, "main")
Add Comment
Please, Sign In to add comment