Advertisement
StarBunnie

Untitled

Jun 13th, 2021
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.71 KB | None | 0 0
  1. options:
  2. #Title that is displayed in chat
  3. title: &4HCF &8|
  4. #Time how long someone gets banned for dying
  5. #Default
  6. bantimedefault: 30 minutes
  7. #VIP 1 - Permission: hcf.bantime.vip1
  8. bantimevip1: 20 minutes
  9. #VIP 2 - Permission: hcf.bantime.vip2
  10. bantimevip2: 10 minutes
  11. #VIP 3 - Permission: hcf.bantime.vip3
  12. bantimevip3: 5 minutes
  13. #Should deaths be announced to everyone?
  14. anoudea: true
  15.  
  16. on join:
  17. if player is not alive:
  18. force player to respawn
  19. if {hcf::%player's uuid%::ban} is not set:
  20. set join message to "&8[&a+&8] &a%player%"
  21. else:
  22. player has permission "hcf.bantime.vip1":
  23. set {_bantime} to {@bantimevip1}
  24. if player has permission "hcf.bantime.vip2":
  25. set {_bantime} to {@bantimevip2}
  26. if player has permission "hcf.bantime.vip3":
  27. set {_bantime} to {@bantimevip3}
  28. if player doesn't have permission "hcf.bantime.vip1", "hcf.bantime.vip2" or "hcf.bantime.vip3":
  29. set {_bantime} to {@bantimedefault}
  30. if difference between {hcf::%player's uuid%::ban} and now is less than {_bantime}:
  31. set {_time} to difference between {hcf::%player's uuid%::ban} and now
  32. set {_time} to "%difference between {_time} and {_bantime}%"
  33. set {_time} to formatTime({_time})
  34. kick player due to "&cYou are currently banned:%nl%%nl%&7Time remaining: &c%{_time}%%nl%%nl%&7Cause of death: &c%{hcf::%player's uuid%::cause}%"
  35. else:
  36. delete {hcf::%player's uuid%::ban}
  37. delete {hcf::%player's uuid%::cause}
  38. remove player's uuid from {hcf::deadplayers::*}
  39. set join message to "&8[ &a+ &8] &a%player%"
  40.  
  41. on death:
  42. victim is a player:
  43. set {_item} to attacker's tool
  44. set {hcf::%victim's uuid%::cause} to causeOfDeath("%damage cause%", attacker, {_item})
  45. set {hcf::%victim's uuid%::ban} to now
  46. add victim's uuid to {hcf::deadplayers::*}
  47. set {_cause} to {hcf::%victim's uuid%::cause}
  48. victim has permission "hcf.bantime.vip1":
  49. set {_bantime} to {@bantimevip1}
  50. if victim has permission "hcf.bantime.vip2":
  51. set {_bantime} to {@bantimevip2}
  52. if victim has permission "hcf.bantime.vip3":
  53. set {_bantime} to {@bantimevip3}
  54. if victim doesn't have permission "hcf.bantime.vip1", "hcf.bantime.vip2" or "hcf.bantime.vip3":
  55. set {_bantime} to {@bantimedefault}
  56. set {_time} to "%{_bantime}%"
  57. set {_time} to formatTime({_time})
  58. if {@anoudea} = true:
  59. send action bar "{@title} &c%victim% &7died! &8| &7Reason: &c%{_cause}%" to all players
  60. wait 5 ticks
  61. kick victim due to "&cYou died!%nl%%nl%&7You've been banned for: &c%{_time}%%nl%%nl%&7Cause of death: &c%{_cause}%"
  62.  
  63. function causeOfDeath(t: text, p: entity, i: itemtype) :: text:
  64. if {_t} = "lava", "suffocation", "fall", "fire", "burning", "melting", "poison", "wither", "starvation", "lightning", "void", "hitting wall while flying" or "drowning":
  65. set {_cause} to "%{_t}%" in strict proper case
  66. else if {_t} = "magma":
  67. set {_cause} to "&cMagma Block"
  68. else if {_t} = "contact":
  69. set {_cause} to "&cCactus"
  70. else if {_t} = "falling block":
  71. set {_cause} to "&cAnvil"
  72. else if {_t} = "attack", "sweep attack", "projectile", "potion", "thorns" or "entity explosion":
  73. set {_attacker} to "%{_p}%" in strict proper case
  74. if {_i} is not air:
  75. set {_attackerstool} to "%{_i}%" in strict proper case
  76. else:
  77. set {_attackerstool} to "Hands"
  78. if {_attackerstool} is not "<none>":
  79. {_p} is a player:
  80. set {_cause} to "&c%{_attacker}% &7with &c%{_attackerstool}%"
  81. else:
  82. set {_cause} to "&c%{_attacker}%"
  83. else:
  84. if {_attacker} is not "<none>":
  85. set {_cause} to "&c%{_attacker}%"
  86. if "%{_cause}%" contains "Area":
  87. set {_cause} to "&cDragon's Breath"
  88. else:
  89. set {_cause} to {_t} in strict proper case
  90. set {_cause} to "%{_cause}% &8(Dispenser)"
  91. else:
  92. set {_cause} to "%{_t}%" in strict proper case
  93. return {_cause}
  94.  
  95. on quit:
  96. if {hcf::%player's uuid%::ban} is set:
  97. set leave message to ""
  98. else:
  99. set leave message to "&8[&c-&8] &c%player%"
  100.  
  101. command /revive [<offlineplayer>]:
  102. trigger:
  103. player has permission "hcf.revive":
  104. if arg 1 is not set:
  105. if size of {hcf::deadplayers::*} > 0:
  106. send "{@title} &7List of all currently dead players: &8&o(%size of {hcf::deadplayers::*}%&8&o)"
  107. send " "
  108. loop {hcf::deadplayers::*}:
  109. loop-value has permission "hcf.bantime.vip1":
  110. set {_bantime} to {@bantimevip1}
  111. set {_perm} to "VIP 1"
  112. set {_reduction} to "%difference between {@bantimedefault} and {@bantimevip1}%"
  113. if loop-value has permission "hcf.bantime.vip2":
  114. set {_bantime} to {@bantimevip2}
  115. set {_perm} to "VIP 2"
  116. set {_reduction} to "%difference between {@bantimedefault} and {@bantimevip2}%"
  117. if loop-value has permission "hcf.bantime.vip3":
  118. set {_bantime} to {@bantimevip3}
  119. set {_perm} to "VIP 3"
  120. set {_reduction} to "%difference between {@bantimedefault} and {@bantimevip3}%"
  121. if loop-value doesn't have permission "hcf.bantime.vip1", "hcf.bantime.vip2" or "hcf.bantime.vip3":
  122. set {_bantime} to {@bantimedefault}
  123. set {_perm} to "Default"
  124. set {_reduction} to "None"
  125. if difference between {hcf::%loop-value%::ban} and now is less than {_bantime}:
  126. set {_timeremain} to difference between {hcf::%loop-value%::ban} and now
  127. set {_timeremain} to "%difference between {_timeremain} and {_bantime}%"
  128. set {_timeremain} to formatTime({_timeremain})
  129. set {_timedisplay} to "&c[⌚]"
  130. else:
  131. set {_timeremain} to "&aWaiting for join..."
  132. set {_timedisplay} to "&a[⌚]"
  133. send formatted "&c○ &7%loop-value parsed as offlineplayer% &8| <ttp:&eRevive &7%loop-value parsed as offlineplayer%><cmd:/revive %loop-value parsed as offlineplayer%>&e[❤]<reset> &8| <ttp:&7Cause of death: &c%{hcf::%loop-value%::cause}%>&c[☠]<reset> &7- <ttp:&7Time remaining: &c%{_timeremain}%>%{_timedisplay}%<reset> &8| <ttp:&7Time reduction: <##80cee1>%{_reduction}% &8| &7Perm: <##80cee1>%{_perm}%><##80cee1>[☘]<reset>"
  134. else:
  135. send "{@title} &7Seems like noone died yet."
  136. else:
  137. if {hcf::%arg 1's uuid%::ban} is set:
  138. delete {hcf::%arg 1's uuid%::*}
  139. send "{@title} &7You revived &c%arg 1%&7!"
  140. remove arg 1's uuid from {hcf::deadplayers::*}
  141. else:
  142. send "{@title} &7Seems like &c%arg 1% &7hasn't died yet!"
  143. else:
  144. send "{@title} &cYou don't have the required permission to use this command!"
  145.  
  146. function formatTime(t: text) :: text:
  147. replace " seconds" in {_t} with "s"
  148. replace " minutes" in {_t} with "m"
  149. replace " hours" in {_t} with "h"
  150. replace " days" in {_t} with "d"
  151. replace " second" in {_t} with "s"
  152. replace " minute" in {_t} with "m"
  153. replace " hour" in {_t} with "h"
  154. replace " day" in {_t} with "d"
  155. replace " and", " and " and "and " in {_t} with ""
  156. return {_t}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement