Advertisement
LukaMC59

Untitled

Nov 14th, 2017
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. options:
  2. command: playtime
  3. permission: playtime.use
  4. prefix: &8»
  5.  
  6. variables:
  7. {second::%player%} = 0
  8. {minute::%player%} = 0
  9. {hour::%player%} = 0
  10.  
  11. every second:
  12. loop all players:
  13. add 1 to {second::%loop-player%}
  14. if {second::%loop-player%} is 60:
  15. subtract 60 from {second::%loop-player%}
  16. add 1 to {minute::%loop-player%}
  17. if {minute::%loop-player%} is 60:
  18. subtract 60 from {minute::%loop-player%}
  19. add 1 to {hour::%loop-player%}
  20.  
  21. command /{@command} [<offline player>]:
  22. permission: {@permission}
  23. trigger:
  24. if arg 1 is not set:
  25. send "{@prefix} &7Your playtime is &c%{hour::%player%}%&7h and &c%{minute::%player%}%&7m"
  26. stop
  27. if arg 1 is set:
  28. if arg 1 is "top":
  29. loop {hour::*}:
  30. add 1 to {_size}
  31. if {_low.to.high.list::%loop-value%} is not set:
  32. set {_low.to.high.list::%loop-value%} to loop-index
  33. else:
  34. set {_n} to 0
  35. loop {_size} times:
  36. set {_n} to {_n}+1
  37. {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
  38. set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
  39. stop loop
  40. wait 1 tick
  41. set {_n} to size of {_low.to.high.list::*}
  42. loop {_low.to.high.list::*}:
  43. set {_high.to.low.list::%{_n}%} to loop-value
  44. set {_n} to {_n}-1
  45. wait 1 tick
  46. message "{@prefix} &7Top 10 Players:"
  47. loop {_high.to.low.list::*}:
  48. add 1 to {_result}
  49. send "&c%loop-value%&8 » &c%{hour::%loop-value%}%&7h"
  50. if {_result} is 10:
  51. stop
  52. else:
  53. if {days.%arg 1%} is not set:
  54. set {days.%arg 1%} to 0
  55. if {hour::%arg 1%} is not set:
  56. set {hour::%arg 1%} to 0
  57. if {minute::%arg 1%} is not set:
  58. set {minute::%arg 1%} to 0
  59. send "{@prefix} &c%arg 1%&7's playtime is &c%{hour::%arg 1%}%&7h and &c%{minute::%arg 1%}%&7m"
  60. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement