Advertisement
Guest User

Punishment V2

a guest
Jan 20th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.21 KB | None | 0 0
  1.  
  2. on join:
  3. if {Muted.%player's uuid%} is true:
  4. set {_Muted.Log.%player's uuid%} to difference between {MutedLAST.%player's uuid%} and now
  5. remove {_Muted.Log.%player's uuid%} from {Muted.timespan.%player's uuid%}
  6.  
  7. on script load:
  8. broadcast "&c/punish [<player>] [<reason>]"
  9. broadcast "&c/unpunish [<player>]"
  10.  
  11. on join:
  12. if {Banned.%player's uuid%} is true:
  13. if {Banned.timespan.%player's uuid%} is 0 seconds:
  14. set {Banned.%player's uuid%} to false
  15. else if {Banned.timespan.%player's uuid%} is greater than 0 seconds:
  16. set {_Ban.Log.%player's uuid%} to difference between {BannedLAST.%player's uuid%} and now
  17. remove {_Ban.Log.%player's uuid%} from {Banned.timespan.%player's uuid%}
  18. send "&c&lPunishment! &cYou have been banned by &7%{Banned.issuer.%player's uuid%}%!"
  19. send "&cReason: &c&o%{Banned.reason.%player's uuid%}%"
  20. send "&cDuration: &c&o%{Banned.timespan.%player's uuid%}%"
  21. kick event-player
  22.  
  23. on quit:
  24. if {Banned.%player's uuid%} is true:
  25. set {BannedLAST.%player's uuid%} to now
  26. if {Muted.%player's uuid%} is set:
  27. set {MutedLAST.%player's uuid%} to now
  28.  
  29.  
  30. on chat:
  31. if {Muted.%player's uuid%} is true:
  32. send "&c&lPunishment! &cYou have been muted by &7%{Muted.issuer.%player's uuid%}%!"
  33. send "&cReason: &c&o%{Muted.reason.%player's uuid%}%"
  34. send "&cDuration: &c&o%{Muted.timespan.%player's uuid%}%"
  35. cancel event
  36.  
  37. every second:
  38. loop all players:
  39. if {Muted.%loop-player's uuid%} is true:
  40. remove 1 second from {Muted.timespan.%loop-player's uuid%}
  41. if {Muted.timespan.%loop-player's uuid%} is 0 seconds:
  42. set {Muted.%loop-player's uuid%} to false
  43.  
  44. command /punish [<offline player>] [<text>]:
  45. permission: Rank.JrMod
  46. permission message: &c&lInsufficient Permission! &7You do not have permission too perform this action.
  47. trigger:
  48. if arg 2 is set:
  49. open virtual chest inventory with 5 rows named "Punish %arg-1%" to sender
  50. wait 1 tick
  51. format gui slot 4 of sender with skull of arg-1 named "&7Punish %arg-1%"
  52. format gui slot 11 of sender with green dye named "&2 Severity 1 mute" with lore "" and "&2First offense - 30 minute mute" and "&2Second offense - 1 hour" and "&2Third+ offense - 3 hour mute" to run function Mute1(arg-1, arg-2, sender)
  53. format gui slot 17 of sender with paper named "&c&lWarn" to run function Warn(arg-1, arg-2, sender)
  54. format gui slot 20 of sender with yellow dye named "&e Severity 2 mute" with lore "" and "&eFirst offense - 3 hours" and "&eSecond offense - 5 hours" and "&eThird+ offense - 1 day" to run function Mute2(arg-1, arg-2, sender)
  55. format gui slot 29 of sender with red dye named "&4 Severity 3 mute" with lore "" and "&4First offense - 1 day" and "&4Second offense - 2 days" and "&4Third+ offense - 3 days" to run function Mute3(arg-1, arg-2, sender)
  56. if sender has permission "Rank.Mod":
  57. format gui slot 15 of sender with green dye named "&2 Severity 1 ban" with lore "" and "&2First offense - 1 hour ban" and "&2Second offense - 2 hour ban" and "&2Third+ offense - 3 hour ban" to run function Ban1(arg-1, arg-2, sender)
  58. format gui slot 24 of sender with yellow dye named "&e Severity 2 ban" with lore "" and "&eFirst offense - 6 hours" and "&eSecond offense - 1 day" and "&eThird+ offense - 2 days" to run function Ban2(arg-1, arg-2, sender)
  59. format gui slot 33 of sender with red dye named "&4 Severity 3 ban" with lore "" and "&4First offense - 7 days" and "&4Second offense - 14 days" and "&4Third+ offense - Never..." to run function Ban3(arg-1, arg-2, sender)
  60. else:
  61. send "&c&lIncorrect Usage! &7/punish [<player>] [<reason>]" to sender
  62.  
  63.  
  64. command /unpunish [<offline player>]:
  65. permission: Rank.JrMod
  66. permission message: &c&lInsufficient Permission! &7You do not have permission to perform this action.
  67. trigger:
  68. open virtual chest inventory with 3 rows named "Unpunish %arg%" to sender
  69. format gui slot 11 of sender with redstone repeater named "&cUnmute %arg%" to run function Unmute(arg, sender)
  70. format gui slot 15 of sender with redstone repeater named "&cUnban %arg%" to run function Unban( arg, sender)
  71.  
  72. function Unban(p: offline player, s: sender):
  73. set {_u} to uuid of {_p}
  74. if {Banned.%{_u}%} is true:
  75. set {Banned.%{_u}%} to false
  76. set {Banned.timespan.%{_u}%} to 0
  77. send "&c&lPunishment! &7Unbanned %{_p}%" to {_s}
  78. else:
  79. send "&c&lPunishment! &7That player is not banned!" to {_s}
  80.  
  81. function Unmute(p: offline player, s: sender):
  82. set {_u} to uuid of {_p}
  83. if {Muted.%{_u}%} is true:
  84. set {Muted.%{_u}%} to false
  85. set {Muted.timespan.%{_u}%} to 0
  86. send "&c&lPunishment! &7Unmuted %{_p}%" to {_s}
  87. else:
  88. send "&c&lPunishment! &7That player is not muted!" to {_s}
  89.  
  90. function Warn(p: offline player, r: text, s: sender):
  91. send "&c&lPunishment! &cYou have been warned by %{_s}%" to {_p}
  92. send "&cReason: &o&c%{_s}%" to {_p}
  93. send "&c&lPunishment! &cA staff member &7has warned &c%{_p}% &7for &c%{_r}%" to all players where [input has permission "Rank.Mod"]
  94. play sound "ENTITY_VILLAGER_NO" with volume 100 to {_p}
  95.  
  96. function Mute1(p: offline player, r: text, s: sender):
  97. set {_u} to uuid of {_p}
  98. if {Mute.Sev1.%{_u}%} is 1:
  99. Mute({_p}, {_r}, 30 minutes, {_s})
  100. add 1 to {Mute.Sev1.%{_u}%}
  101. broadcast "%{_u}%"
  102. else if {Mute.Sev1.%{_u}%} is 2:
  103. Mute({_p}, {_r}, 1 hour, {_s})
  104. add 1 to {Mute.Sev1.%{_u}%}
  105. broadcast "%{_u}%"
  106. else if {Mute.Sev1.%{_u}%} <= 3:
  107. Mute({_p}, {_r}, 3 hours, {_s})
  108. broadcast "%{_u}%"
  109.  
  110. function Mute2(p: offline player, r: text, s: sender):
  111. set {_u} to uuid of {_p}
  112. if {Mute.Sev2.%{_u}%} is 1:
  113. Mute({_p}, {_r}, 3 hours, {_s})
  114. add 1 to {Mute.Sev2.%{_u}%}
  115. else if {Mute.Sev2.%{_u}%} is 2:
  116. Mute({_p}, {_r}, 5 hours, {_s})
  117. add 1 to {Mute.Sev2.%{_u}%}
  118. else if {Mute.Sev2.%{_u}%} <= 3:
  119. Mute({_p}, {_r}, 1 day, {_s})
  120.  
  121. function Mute3(p: offline player, r: text, s: sender):
  122. set {_u} to uuid of {_p}
  123. if {Mute.Sev3.%{_u}%} != 3 days:
  124. add 1 day to {Mute.Sev3.%{_u}%}
  125. Mute({_p}, {_r}, {Mute.Sev3.%{_u}%}, {_s})
  126. else:
  127. Mute({_p}, {_r}, 3 days, {_s})
  128.  
  129. function Ban1(p: offline player, r: text, s: sender):
  130. set {_u} to uuid of {_p}
  131. if {Ban.Sev1.%{_u}%} != 3 hours:
  132. add 1 hour to {Ban.Sev1.%{_u}%}
  133. Ban({_p}, {_r}, {Ban.Sev1.%{_u}%}, {_s})
  134. else:
  135. Ban({_p}, {_r}, 3 hours, {_s})
  136.  
  137. function Ban2(p: offline player, r: text, s: sender):
  138. set {_u} to uuid of {_p}
  139. if {Ban.Sev2.%{_u}%} is 1:
  140. Ban({_p}, {_r}, 6 hours, {_s})
  141. add 1 to {Ban.Sev2.%{_u}%}
  142. else if {Ban.Sev2.%{_u}%} is 2:
  143. Ban({_p}, {_r}, 2 days, {_s})
  144. add 1 to {Mute.Sev2.%{_u}%}
  145. else if {Ban.Sev2.%{_u}%} <= 3:
  146. Ban({_p}, {_r}, 2 days, {_s})
  147.  
  148.  
  149. function Ban3(p: offline player, r: text, s: sender):
  150. set {_u} to uuid of {_p}
  151. if {Ban.Sev3.%{_u}%} != 14 days:
  152. add 7 days to {Ban.Sev3.%{_u}%}
  153. Ban({_p}, {_r}, {Ban.Sev3.%{_u}%}, {_s})
  154. else:
  155. Ban({_p}, {_r}, 999 days, {_s})
  156.  
  157.  
  158.  
  159.  
  160. function Mute(p: offline player, r: text, d: timespan, s: sender):
  161. set {_u} to uuid of {_p}
  162. close {_s}'s inventory
  163. set {Muted.%{_u}%} to true
  164. set {Muted.timespan.%{_u}%} to {_d}
  165. set {Muted.issuer.%{_u}%} to {_s}
  166. set {Muted.reason.%{_u}%} to {_r}
  167. send "&c&lPunishment! &cYou have been muted by &7%{_s}%!" to {_p}
  168. send "&cReason: &c&o%{_r}%" to {_p}
  169. send "&cDuration: &c&o%{_d}%" to {_p}
  170. broadcast "&c&lPunishment! &cA staff member &7has muted &c%{_p}% &7for &c%{_r}% &7&o%{_d}%"
  171.  
  172. function Ban(p: offline player, r: text, d: timespan, s: sender):
  173. set {_u} to uuid of {_p}
  174. close {_s}'s inventory
  175. set {Banned.%{_u}%} to true
  176. set {Banned.reason.%{_u}%} to {_r}
  177. set {Banned.timespan.%{_u}%} to {_d}
  178. set {Banned.issuer.%{_u}%} to {_s}
  179. send "&c&lPunishment! &cYou have been banned by &7%{_s}%!" to {_p}
  180. send "&cReason: %{_r}%" to {_p}
  181. send "&cDuration: %{_d}%" to {_p}
  182. kick {_p}
  183. broadcast "&c&lPunishment! &cA staff member &7has banned &c%{_p}% &7for &c%{_r}% &7&o%{_d}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement