Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- command: playtime
- permission: playtime.use
- prefix: &9SkyTime &8»
- variables:
- {second::%player%} = 0
- {minute::%player%} = 0
- {hour::%player%} = 0
- every second:
- loop all players:
- add 1 to {second::%loop-player%}
- if {second::%loop-player%} is 60:
- subtract 60 from {second::%loop-player%}
- add 1 to {minute::%loop-player%}
- if {minute::%loop-player%} is 60:
- subtract 60 from {minute::%loop-player%}
- add 1 to {hour::%loop-player%}
- command /{@command} [<offline player>]:
- permission: {@permission}
- trigger:
- if arg 1 is not set:
- send "{@prefix} &7Your playtime is &c%{hour::%player%}%&7h and &c%{minute::%player%}%&7m"
- stop
- if arg 1 is set:
- if arg 1 is "top":
- loop {hour::*}:
- add 1 to {_size}
- if {_low.to.high.list::%loop-value%} is not set:
- set {_low.to.high.list::%loop-value%} to loop-index
- else:
- set {_n} to 0
- loop {_size} times:
- set {_n} to {_n}+1
- {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
- set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
- stop loop
- wait 1 tick
- set {_n} to size of {_low.to.high.list::*}
- loop {_low.to.high.list::*}:
- set {_high.to.low.list::%{_n}%} to loop-value
- set {_n} to {_n}-1
- wait 1 tick
- message "{@prefix} &7Top 10 Players:"
- loop {_high.to.low.list::*}:
- add 1 to {_result}
- send "&c%loop-value%&8 » &c%{hour::%loop-value%}%&7h"
- if {_result} is 10:
- stop
- else:
- if {days.%arg 1%} is not set:
- set {days.%arg 1%} to 0
- if {hour::%arg 1%} is not set:
- set {hour::%arg 1%} to 0
- if {minute::%arg 1%} is not set:
- set {minute::%arg 1%} to 0
- send "{@prefix} &c%arg 1%&7's playtime is &c%{hour::%arg 1%}%&7h and &c%{minute::%arg 1%}%&7m"
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement