Guest User

Untitled

a guest
May 28th, 2024
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. on first join:
  2. set {player.%player%.time} to 24 * 60 * 60
  3. send "&aYou have been given 24 hours of playtime!" to player
  4.  
  5. # Display remaining time in the hotbar
  6. every 1 second:
  7. loop all players:
  8. set action bar of loop-player to "&eTime left: &c%{player.%loop-player%.time} / 3600% hours"
  9.  
  10. # Decrease player's time by 1 second every second
  11. every 1 second:
  12. loop all players:
  13. remove 1 from {player.%loop-player%.time}
  14. if {player.%loop-player%.time} <= 0:
  15. kick loop-player due to "Your time is up!"
  16.  
  17. # Manage player kills
  18. on death of player:
  19. attacker is a player
  20. victim is a player
  21. add 1 hour to {player.%attacker%.time}
  22. remove 1 hour from {player.%victim%.time}
  23.  
  24. # Extra time clock crafting recipe
  25. register new shaped recipe for enchanted clock named "&a&lExtra Time" with lore "&eAdd 30 minutes" using:
  26. 1st row: echo shard, diamond, echo shard
  27. 2nd row: diamond, clock, diamond
  28. 3rd row: echo shard, diamond, echo shard
  29.  
  30. # Use Extra Time clock
  31. on right click:
  32. if player's held item is a enchanted clock named "&b&lExtra Time":
  33. add 30 minutes to {player.%player%.time}
  34. remove 1 of player's tool
  35.  
  36. # Revive clock crafting recipe
  37. register new shaped recipe for enchanted clock named "&a&lRevive Clock" with lore "&eUse to revive a player" using:
  38. 1st row: diamond, echo shard, diamond
  39. 2nd row: echo shard, enchanted clock named "&a&lExtra Time", echo shard
  40. 3rd row: diamond, echo shard, diamond
  41.  
  42. # Reviving players
  43. on right click:
  44. if player held item is a enchanted clock named "&a&lRevive Clock":
  45. open anvil with name "Revive Player" to player
  46.  
  47. on anvil rename:
  48. if name of event-item is "&a&lRevive Clock":
  49. set {revive.%player%} to event-string
  50. send "&aYou have renamed the Revive Clock to &e%event-string%&a!" to player
  51.  
  52. on right click:
  53. if player's held item is a enchanted clock named "&a&lRevive Clock" with lore "%{revive.%player%}%":
  54. set {_target} to {revive.%player%}
  55. if {_target} is not set:
  56. send "&cNo player name specified!" to player
  57. stop
  58. if {_target} is online:
  59. send "&cPlayer %{_target}% is currently online!" to player
  60. stop
  61. set {revives.%{_target}%} to {revives.%{_target}%} + 1
  62. if {revives.%{_target}%} is 1:
  63. set {player.%{_target}%.time} to 12 * 60 * 60
  64. if {revives.%{_target}%} is 2:
  65. set {player.%{_target}%.time} to 6 * 60 * 60
  66. i if {revives.%{_target}%} is 3:
  67. set {player.%{_target}%.time} to 3 * 60 * 60
  68. if {revives.%{_target}%} is 4:
  69. set {player.%{_target}%.time} to 1.5 * 60 * 60
  70. if {revives.%{_target}%} is 5:
  71. ban {_target} permanently
  72. send "&cPlayer %{_target}% has been permanently banned!" to player
  73. else:
  74. unban {_target}
  75. send "&aPlayer %{_target}% has been revived with %{player.%{_target}%.time} / 3600% hours!" to player
  76. remove 1 of player's tool
  77.  
  78. # Withdraw time command
  79. command /withdraw [<integer>]:
  80. permission: withdraw.time
  81. trigger:
  82. if arg-1 is not set:
  83. send "&cUsage: /withdraw <hours>"
  84. stop
  85. set {_time} to arg-1
  86. if {_time} is not between 1 and 23:
  87. send "&cYou can only withdraw between 1 and 23 hours."
  88. stop
  89. if {player.%player%.time} >= {_time} * 60 * 60:
  90. remove {_time} * 60 * 60 from {player.%player%.time}
  91. give player {_time} * 3600 of enchanted clock named "&a&lExtra Time" with lore "&eAdd 30 minutes"
  92. send "&aYou have withdrawn %{_time}% hours as Extra Time clocks."
  93. else:
  94. send "&cYou do not have enough time to withdraw!"
Advertisement
Add Comment
Please, Sign In to add comment