Advertisement
Zeldaboy111

Bans Af ]|[ Skript #306

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