Zeldaboy111

Bans Af ]|[ Skript #306

Apr 26th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. #©
  2. #- Reselling/Reuploading while claiming that it is yours or made by you is disallowed
  3. #- Do not edit it and upload it as your own
  4. #- While using it in a video, please feature everything under "Video"
  5. #©
  6. #
  7. #Video:
  8. #Skript made by Zeldaboy111
  9. #More content of the creator: https://forums.skunity.com/search/26443679/
  10.  
  11. options:
  12. logo: &c&lPunishment &8►&7
  13.  
  14. function checkBan(p: Player):
  15. if {ban.%{_p}%} is set:
  16. set {_difference} to difference between now and {ban.%{_p}%}
  17. if {_difference} > {ban.%{_p}%.time}:
  18. delete {ban.%{_p}%.time}
  19. delete {ban.%{_p}%.unban}
  20. delete {ban.%{_p}%}
  21.  
  22. function checkWarnings(p: Player):
  23. if {warnings.%{_p}%.amountActive} >= 1:
  24. loop {warnings.%{_p}%.warnNumber::*}:
  25. set {_difference} to difference between now and {warnings.%{_p}%.warnedAt::%loop-value%}
  26. if {_difference} > {warnings.%{_p}%.duration::%loop-value%}:
  27. delete {warnings.%{_p}%.warnNumber::%loop-value%}
  28. delete {warnings.%{_p}%.warnedAt::%loop-value%}
  29. delete {warnings.%{_p}%.duration::%loop-value%}
  30. remove 1 from {warnings.%{_p}%.amountActive}
  31.  
  32.  
  33. command /punish [<text>]:
  34. aliases: /pu
  35. trigger:
  36. if player has permission "rank.helper":
  37. if arg-1 is set:
  38. if arg-1 parsed as a player is set:
  39. set {_t} to arg-1 parsed as a player
  40. open chest with 6 rows named "Punish %{_t}%" to player
  41.  
  42. set slot 19 of player's current inventory to paper named "&aWarn" with lore "", "&7Click to Warn %{_t}%", "" and "&8(&2Helper&8)"
  43. set slot 20 of player's current inventory to stone sword named "&cClient Modifications" with lore "", "&7Click to Ban %{_t}%", "&7for &oClient Modifications", "" and "&8(&2Helper&8)" without any NBT
  44.  
  45.  
  46. else:
  47. send "{@logo} The player &c%arg-1% &7is not found."
  48. else:
  49. send "{@logo} You have to give up a &cplayer &7to punish."
  50.  
  51.  
  52. command /checkoffenses [<text>]:
  53. aliases: /checkoff
  54. trigger:
  55. if player has permission "rank.helper":
  56. if arg-1 is set:
  57. if arg-1 parsed as a player is set:
  58. set {_t} to arg-1 parsed as a player
  59. send "&8&m &8[ &cOFFENSESES &8]&8&m "
  60. send " "
  61. send "&7User&8: &c%{_t}%"
  62. checkBan({_t})
  63. if {ban.%{_t}%} is set:
  64. send "&7Active Ban&8: &7%{ban.%{_t}%.reason}%"
  65. send "&7Total Ban Length&8: &7%{ban.%{_t}%.time}%"
  66. send "&7Banned At&8: &7%{ban.%{_t}%}%"
  67. send "&7Unban at&8: &7%{ban.%{_t}%.unban}%"
  68.  
  69. else:
  70. send "&7Active Ban&8: &7None"
  71.  
  72. checkWarnings({_t})
  73. send "&7Total Warnings&8: &7%{warnings.%{_t}%.amount}%"
  74. if {warnings.%{_t}%.amountActive} >= 1:
  75. send "&7Active Warnings&8: &7%{warnings.%{_t}%.amountActive}%"
  76.  
  77. else:
  78. send "&7Active Warnings&8: &7None"
  79.  
  80.  
  81. send " "
  82. send "&8&m &8[ &cOFFENSESE &8]&8&m "
  83.  
  84. else:
  85. send "{@logo} The player &c%arg-1% &7is not found."
  86. else:
  87. send "{@logo} You have to give up a &cplayer &7to check it's offenses."
  88.  
  89. on connect:
  90. if {ban.%player%} is set:
  91. checkBan(player)
  92.  
  93. if {ban.%player%.time} is set:
  94. kick player due to "BANNED"
  95.  
  96. if {warnings.%player%.amount} is not set:
  97. set {warnings.%player%.amount} to 0
  98.  
  99. if {warnings.%player%.amountActive} is not set:
  100. set {warnings.%player%.amountActive} to 0
  101.  
  102. on quit:
  103. if {ban.%player%} is set:
  104. set quit message to ""
  105.  
  106. on inventory click:
  107. if type of clicked inventory is chest inventory:
  108. if inventory name of player's current inventory starts with "Punish ":
  109. cancel event
  110. set {_name::*} to inventory name of player's current inventory split at " "
  111. set {_target} to {_name::2}
  112. set {_target} to {_target} parsed as an offline player
  113.  
  114. if clicked slot is 19:
  115. close player's inventory
  116. send "{@logo} You have warned %{_target}%&7."
  117. send "{@logo} You have been warned." to {_target}
  118. if {warnings.%{_target}%.amount} is not set:
  119. set {warnings.%{_target}%.amount} to 0
  120.  
  121. add 1 to {warnings.%{_target}%.amount}
  122. add 1 to {warnings.%{_target}%.amountActive}
  123. set {warnings.%{_target}%.warnedAt::%{warnings.%{_target}%.amount}%} to now
  124. set {warnings.%{_target}%.duration::%{warnings.%{_target}%.amount}%} to 10 seconds
  125. set {warnings.%{_target}%.warnNumber::%{warnings.%{_target}%.amount}%} to {warnings.%{_target}%.amount}
  126.  
  127. else if clicked slot is 20:
  128. set {ban.%{_target}%} to now
  129. set {ban.%{_target}%.unban} to now
  130. set {ban.%{_target}%.time} to 7 seconds
  131. set {ban.%{_target}%.reason} to "&cClient Modifications"
  132.  
  133. add {ban.%{_target}%.time} to {ban.%{_target}%.unban}
  134. close player's inventory
  135. send "{@logo} You have banned &c%{_target}% &7for &c%{ban.%{_target}%.time}%&7. &8(&c%{ban.%{_target}%.reason}%&8)"
  136. kick {_target} due to "&9&lBANNED%nl%&cClient Modifications%nl%%nl%&7Banned at&8: &7%{ban.%{_target}%}%%nl%&7Unban at&8: &7%{ban.%{_target}%.unban}%"
Advertisement
Add Comment
Please, Sign In to add comment