Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on first join:
- set {player.%player%.time} to 24 * 60 * 60
- send "&aYou have been given 24 hours of playtime!" to player
- # Display remaining time in the hotbar
- every 1 second:
- loop all players:
- set action bar of loop-player to "&eTime left: &c%{player.%loop-player%.time} / 3600% hours"
- # Decrease player's time by 1 second every second
- every 1 second:
- loop all players:
- remove 1 from {player.%loop-player%.time}
- if {player.%loop-player%.time} <= 0:
- kick loop-player due to "Your time is up!"
- # Manage player kills
- on death of player:
- attacker is a player
- victim is a player
- add 1 hour to {player.%attacker%.time}
- remove 1 hour from {player.%victim%.time}
- # Extra time clock crafting recipe
- register new shaped recipe for enchanted clock named "&a&lExtra Time" with lore "&eAdd 30 minutes" using:
- 1st row: echo shard, diamond, echo shard
- 2nd row: diamond, clock, diamond
- 3rd row: echo shard, diamond, echo shard
- # Use Extra Time clock
- on right click:
- if player's held item is a enchanted clock named "&b&lExtra Time":
- add 30 minutes to {player.%player%.time}
- remove 1 of player's tool
- # Revive clock crafting recipe
- register new shaped recipe for enchanted clock named "&a&lRevive Clock" with lore "&eUse to revive a player" using:
- 1st row: diamond, echo shard, diamond
- 2nd row: echo shard, enchanted clock named "&a&lExtra Time", echo shard
- 3rd row: diamond, echo shard, diamond
- # Reviving players
- on right click:
- if player held item is a enchanted clock named "&a&lRevive Clock":
- open anvil with name "Revive Player" to player
- on anvil rename:
- if name of event-item is "&a&lRevive Clock":
- set {revive.%player%} to event-string
- send "&aYou have renamed the Revive Clock to &e%event-string%&a!" to player
- on right click:
- if player's held item is a enchanted clock named "&a&lRevive Clock" with lore "%{revive.%player%}%":
- set {_target} to {revive.%player%}
- if {_target} is not set:
- send "&cNo player name specified!" to player
- stop
- if {_target} is online:
- send "&cPlayer %{_target}% is currently online!" to player
- stop
- set {revives.%{_target}%} to {revives.%{_target}%} + 1
- if {revives.%{_target}%} is 1:
- set {player.%{_target}%.time} to 12 * 60 * 60
- if {revives.%{_target}%} is 2:
- set {player.%{_target}%.time} to 6 * 60 * 60
- i if {revives.%{_target}%} is 3:
- set {player.%{_target}%.time} to 3 * 60 * 60
- if {revives.%{_target}%} is 4:
- set {player.%{_target}%.time} to 1.5 * 60 * 60
- if {revives.%{_target}%} is 5:
- ban {_target} permanently
- send "&cPlayer %{_target}% has been permanently banned!" to player
- else:
- unban {_target}
- send "&aPlayer %{_target}% has been revived with %{player.%{_target}%.time} / 3600% hours!" to player
- remove 1 of player's tool
- # Withdraw time command
- command /withdraw [<integer>]:
- permission: withdraw.time
- trigger:
- if arg-1 is not set:
- send "&cUsage: /withdraw <hours>"
- stop
- set {_time} to arg-1
- if {_time} is not between 1 and 23:
- send "&cYou can only withdraw between 1 and 23 hours."
- stop
- if {player.%player%.time} >= {_time} * 60 * 60:
- remove {_time} * 60 * 60 from {player.%player%.time}
- give player {_time} * 3600 of enchanted clock named "&a&lExtra Time" with lore "&eAdd 30 minutes"
- send "&aYou have withdrawn %{_time}% hours as Extra Time clocks."
- else:
- send "&cYou do not have enough time to withdraw!"
Advertisement
Add Comment
Please, Sign In to add comment