1c7

WarnGUI - v1.0

1c7
Apr 30th, 2020
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. #
  2. # BY @ADXM#1343
  3. #
  4. # REQUIRED: Skript, Sk-Bee
  5. # Without these, it will not work!
  6.  
  7.  
  8. options:
  9.  
  10. max-warns: 3
  11.  
  12. P: &c[WarnGUI]&7
  13.  
  14. command /warn [<player>] [<text>]:
  15. trigger:
  16. if arg-1 is set:
  17. if arg-2 is set:
  18. add 1 to {warn-count::%arg-1's uuid%}
  19. add arg-2 to {warns::%arg-1's uuid%::*}
  20. set {warns::time::%arg-1's uuid%::%arg-2%} to time
  21. set {warns::staff::%arg-1's uuid%::%arg-2%} to player
  22. log "%arg-1% has been warned by %player% for %arg-2%" to "WarnGUI"
  23. send "{@P} &3%arg-1%&7 has been warned for &3%arg-2%&7." to player
  24. send "{@P} You have been warned for &3%arg-2%&7." to arg-1
  25. if {warn-count::%arg-1's uuid%} = {@max-warns}:
  26. set {warn-count::%arg-1's uuid%} to 0
  27. send "{@P} &3%arg-1%&7 has been kicked for reaching their maximum warnings &3({@max-warns})&7." to player
  28. kick arg-1 due to "{@P} You have reached your maximum warnings."
  29. else:
  30. send "{@P} Usage: /warn [player] [reason]"
  31. else:
  32. send "{@P} Usage: /warn [player] [reason]"
  33.  
  34.  
  35. command /history [<player>]:
  36. trigger:
  37. if arg-1 is set:
  38. if {warns::%arg-1's uuid%::*} is set:
  39. set {gui::%player's uuid%} to arg-1
  40. set {_inventory} to chest inventory with 5 rows named "{@P} &3%arg-1%&8's history"
  41. set slot 44 of {_inventory} to barrier named "&3RESET PLAYERS HISTORY" with lore "&7&oClick to completely reset this player's history."
  42. set {_slot} to -1
  43. loop {warns::%arg-1's uuid%::*}:
  44. add 1 to {_slot}
  45. if {_slot} != 44:
  46. set slot {_slot} of {_inventory} to oak sign named "&7REASON: &3%loop-value%" with lore "&7STAFF MEMBER: &3%{warns::staff::%arg-1's uuid%::%loop-value%}%" and "&7TIME: &3%{warns::time::%arg-1's uuid%::%loop-value%}%"
  47. open {_inventory} to player
  48. else:
  49. send "{@P} This user has no history."
  50. else:
  51. send "{@P} Usage: /history [player]"
  52.  
  53. on inventory click:
  54. if custom name of player's current inventory is "{@P} &3%{gui::%player's uuid%}%&8's history":
  55. cancel event
  56. if clicked slot is 44:
  57. set {_U} to {gui::%player's uuid%}'s uuid
  58. clear {warns::%{_U}%::*}
  59. set {warn-count::%{_U}%} to 0
  60. send "{@P} Cleared &3%{gui::%player's uuid%}%&7's history!"
  61. close player's inventory
Advertisement
Add Comment
Please, Sign In to add comment