Advertisement
Preceding

Untitled

Aug 9th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. command /chat [<string>] [<integer>] [<text>]:
  2. permission: command.chat
  3. permission message: §cYou do not have the required permission to use this command.
  4. trigger:
  5. if arg 1 is not set:
  6. message "&7&m--------------------------"
  7. message "&9&lChat Commands"
  8. message "&e/chat mute"
  9. message "&e/chat delay (seconds)"
  10. message "&e/chat clear"
  11. message "&7&m--------------------------"
  12. else:
  13. if arg 1 is "mute":
  14. if {chat} is false:
  15. message "&aYou have unmuted chat."
  16. loop all players:
  17. if loop-player has permission "chat.notify.action" or "*" or "chat.*" or "chat.notify.*":
  18. message "&b[S] &a%player% has unmuted the chat." to loop-player
  19. broadcast "&aThe chat has been unmuted."
  20. delete {chat}
  21. else:
  22. message "&cYou have muted chat."
  23. loop all players:
  24. if loop-player has permission "chat.notify.action" or "*" or "chat.*" or "chat.notify.*":
  25. message "&b[S] &3%player% has muted the chat." to loop-player
  26. broadcast "&cThe chat has been muted."
  27. set {chat} to false
  28. else if arg 1 is "delay":
  29. if arg 2 is not set:
  30. if {chat-delay} is set:
  31. delete {chat-delay}
  32. message "&aYou have removed chat delay."
  33. loop all players:
  34. if loop-player has permission "chat.notify.action" or "*" or "chat.*" or "chat.notify.*":
  35. message "&b[S] &3%player% has disabled chat delay." to loop-player
  36. else:
  37. message "&cChat is not delayed."
  38. else:
  39. if arg 2 is greater than 5:
  40. message "&cError: Cannot est the chat delay more than 5."
  41. else:
  42. set {chat-delay} to 5
  43. loop all players:
  44. if loop-player has permission "chat.notify.action" or "*" or "chat.*" or "chat.notify.*":
  45. message "&b[S] &3%player% has enabled chat delay. &7(%arg-2%&7s)" to loop-player
  46. else if arg 1 is "clear":
  47. loop 150 times:
  48. broadcast ""
  49. broadcast "&3The chat has been cleared."
  50. loop all players:
  51. if loop-player has permission "chat.notify.action" or "*" or "chat.*" or "chat.notify.*":
  52. message "&b[S] &3%player% has cleared the chat." to loop-player
  53.  
  54.  
  55. on load:
  56.  
  57.  
  58. on chat:
  59. if {chat} is set:
  60. if player does not have permission "chat.bypass.mute" or "*" or "chat.*" or "chat.bypass.*":
  61. cancel event
  62. message "&cThe chat is currently muted and you are unable to talk."
  63. if {chat-delay} is set:
  64. if player does not have permission "chat.bypass.delay" or "chat.*" or "*" or "chat.bypass.*":
  65. if {chat-delay.%player%} is not set:
  66. set {chat-delay.%player%} to {chat-delay}
  67. else:
  68. cancel event
  69. message "&cChat is currently delayed. You can chat in another &l%{chat-delay.%player%}% seconds&c."
  70.  
  71. every second:
  72. if {chat-delay} is set:
  73. loop all players:
  74. if {chat-delay.%loop-player%} is 1 or 2 or 3 or 4 or 5:
  75. remove 1 from {chat-delay.%loop-player%}
  76. else:
  77. delete {chat-delay.%loop-player%}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement