szumielxd

StatsScoreBoard

Nov 13th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. on death of player:
  2. add 1 to {deaths.%victim%}
  3. if attacker is player:
  4. add 1 to {kills.%attacker%}
  5. else if {damager.%victim%} is set:
  6. add 1 to {kills.%{damager.%victim%}%}
  7.  
  8. on death of monster:
  9. entity is not player:
  10. add 1 to {mobkills.%player%}
  11.  
  12.  
  13. on damage of player:
  14. attacker is player:
  15. set {damager.%victim%} to "%attacker%"
  16. wait 7 seconds
  17. delete {damager.%victim%}
  18.  
  19. on join:
  20. set {logintime.%player%} to now
  21. wait 2 ticks
  22. sb(player)
  23.  
  24. on disconnect:
  25. delete stylish scoreboard "T-%player%"
  26. if {onlinetime.%player%} is not set:
  27. if difference between {logintime.%player%} and now is bigger than 10 minutes:
  28. set {onlinetime.%player%} to date {logintime.%player%} as unix - date now as unix
  29. else:
  30. add floor((date now as unix - date {logintime.%player%} as unix)/60) to {onlinetime.%player%}
  31.  
  32. every 1 minute:
  33. loop all players:
  34. {onlinetime.%loop-player%} is set:
  35. add floor((date now as unix - date {logintime.%loop-player%} as unix)/60) to {onlinetime.%loop-player%}
  36. set {logintime.%loop-player%} to now
  37.  
  38.  
  39. every 5 seconds:
  40. loop all players:
  41. sb(loop-player)
  42.  
  43.  
  44. function sb(p: Player):
  45. if {onlinetime.%{_p}%} is not set:
  46. set {_onlineT} to 0
  47. else:
  48. set {_t} to floor({onlinetime.%{_p}%})
  49. set {_m} to {_t} mod 60
  50. set {_t} to floor({_t}/60)
  51. set {_h} to {_t} mod 24
  52. set {_t} to floor({_t}/60)
  53. set {_d} to {_t}
  54. if {_m} is not 0:
  55. set {_m} to "%{_m}%m "
  56. else:
  57. set {_m} to ""
  58. if {_h} is not 0:
  59. set {_h} to "%{_h}%h "
  60. else:
  61. set {_h} to ""
  62. if {_d} is not 0:
  63. set {_d} to "%{_d}%d "
  64. else:
  65. set {_d} to ""
  66. set {_onlineT} to "%{_d}%%{_h}%%{_m}%"
  67. if {mobkills.%{_p}%} is not set:
  68. set {_mobs} to 0
  69. else:
  70. set {_mobs} to {mobkills.%{_p}%}
  71. if {kills.%{_p}%} is not set:
  72. set {_kills} to 0
  73. else:
  74. set {_kills} to {kills.%{_p}%}
  75. if {deaths.%{_p}%} is not set:
  76. set {_deaths} to 0
  77. else:
  78. set {_deaths} to {deaths.%{_p}%}
  79. delete stylish scoreboard "T-%{_p}%"
  80. if stylish scoreboard "T-%{_p}%" does not exist:
  81. create new stylish scoreboard named "T-%{_p}%"
  82. create a new id based score "%{_p}%Slot8" with text "&8&m&8&l »&m &m &8&l«" slot 9 for stylish scoreboard "T-%{_p}%"
  83. create a new id based score "%{_p}%Slot7" with text " &aNick: &7%{_p}%" slot 8 for stylish scoreboard "T-%{_p}%"
  84. create a new id based score "%{_p}%Slot6" with text " &aStan konta: &7%{_p}'s balance%" slot 7 for stylish scoreboard "T-%{_p}%"
  85. create a new id based score "%{_p}%Slot5" with text " &aCzas online: &7%{_onlineT}%" slot 6 for stylish scoreboard "T-%{_p}%"
  86. create a new id based score "%{_p}%Slot4" with text " " slot 5 for stylish scoreboard "T-%{_p}%"
  87. create a new id based score "%{_p}%Slot3" with text " &8⋙&2Zabójstwa: &7%{_kills}%" slot 4 for stylish scoreboard "T-%{_p}%"
  88. create a new id based score "%{_p}%Slot2" with text " &8⋙&2Zgony: &7%{_deaths}%" slot 3 for stylish scoreboard "T-%{_p}%"
  89. create a new id based score "%{_p}%Slot1" with text " &8⋙&2Zabite moby: &7%{_mobs}%" slot 2 for stylish scoreboard "T-%{_p}%"
  90. create a new id based score "%{_p}%Slot9" with text " &8&m&8&l»&m &m &8&l«" slot 1 for stylish scoreboard "T-%{_p}%"
  91. set title of stylish scoreboard "T-%{_p}%" to "&a&l-= &2&lFreeBuild &a&l=-"
  92. set stylish scoreboard of {_p} to "T-%{_p}%"
Advertisement
Add Comment
Please, Sign In to add comment