-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsuperchat.sk
332 lines (313 loc) · 13.6 KB
/
superchat.sk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
options:
#Msges:
prefix: &6&lSuperChat &8|&7
player-muted-msg: &cYou are currently muted!
server-muted-msg: &cChat is currently muted!
banned-word-msg: &cYour message contained a banned word!
nick-not-allowed: &cThis nick is not allowed!
prefix-not-allowed: &cThis prefix is not allowed!
suffix-not-allowed: &cThis suffix is not allowed!
nick-changed: &aSuccessfully changed nickname to: [nick] #Use [nick] to display the nickname
prefix-changed: &aSuccessfully changed prefix to: [prefix] #Use [prefix] to display the nickname
suffix-changed: &aSuccessfully changed suffix to: [suffix] #Use [suffix] to display the nickname
duped-msg: &cYou are not allowed to repeat the same msg twice!
#Perms:
chatcolor-perm: chatcolor.change
nick-perm: nick.change
color-nick-perm: colornick.change
prefix-perm: prefix.change
color-prefix-perm: colorprefix.change
suffix-perm: suffix.change
color-suffix-perm: colorsuffix.change
emojis-perm: emojis.use
banned-words-add: banned.add
moderatorperm: chat.moderate
#Options:
ping: &a[player] #Use [player] to display the player who has been pinged
default-chatcolor: &7
chatformat: [prefix]&e[player][suffix] &6» [message] #Use [prefix], [suffix], [player] and [message]
join-msg: &7(&a+&7) [player] #Use [player] to display the player
leave-msg: &7(&c-&7) [player] #Use [player] to display the player
duped-chat: false #Allows a player to say the same message twice in a row
on chat:
if {muted::%player's uuid%} is set:
cancel event
send "{@player-muted-msg}" to player
stop
else if {server-mute} is set:
cancel event
send "{@server-muted-msg}" to player
stop
else if {@duped-chat} is false:
if {last-msg::%player's uuid%} = message:
cancel event
send "{@duped-msg}" to player
stop
set {last-msg::%player's uuid%} to message
set {_words::*} to message split at " "
loop {_words::*}:
set {_word} to loop-value
replace all " " in {_word} with " "
if {banned-words::*} contains {_word}:
cancel event
send "{@prefix} {@banned-word-msg}" to player
stop
if {prefix::%player's uuid%} is set:
set {_prefix} to "%{prefix::%player's uuid%}% "
else:
set {_prefix} to ""
if {nickname::%player's uuid%} is set:
set {_name} to {nickname::%player's uuid%}
else:
set {_name} to "&r%player%"
if {suffix::%player's uuid%} is set:
set {_suffix} to " &r%{suffix::%player's uuid%}%"
else:
set {_suffix} to ""
if player has permission "{@emojis-perm}":
replace all "<3" in message with "&r&d❤%{chat-color::%player's uuid%}%"
replace all ":)" or "(:" in message with "&r&a☺%{chat-color::%player's uuid%}%"
replace all ":(" or "):" in message with "&r&c☹%{chat-color::%player's uuid%}%"
replace all ";)" in message with "&r&a-‿◕&7%{chat-color::%player's uuid%}%"
loop all players where [message contains "%input%"]:
set {_ping} to "{@ping}"
replace all "[player]" in {_ping} with "%loop-player%"
set {_ping} to "%{_ping}%%{chat-color::%player's uuid%}%"
replace all "%loop-player%" with {_ping} in message
play sound "entity.experience_orb.pickup" with volume 2 and pitch 16 to loop-player
set {_chat} to "{@chatformat}"
replace all "[prefix]" in {_chat} with {_prefix}
replace all "[player]" in {_chat} with {_name}
replace all "[suffix]" in {_chat} with {_suffix}
replace all "[message]" in {_chat} with "%{chat-color::%player's uuid%}%%message%"
set the chat format to {_chat}
on join:
set {_join} to "{@join-msg}"
replace all "[player]" in {_join} with "%player%"
set the join message to {_join}
if {chat-color::%player's uuid%} is not set:
set {chat-color::%player's uuid%} to "{@default-chatcolor}"
on disconnect:
set {_leave} to "{@leave-msg}"
replace all "[player]" in {_leave} with "%player%"
set the leave message to {_leave}
command /nickname [<text>] [<player>]:
permission: {@nick-perm}
aliases: /nick
trigger:
if arg-1 is set:
set {_player} to player's uuid
if arg-2 is set:
if player is op:
set {_player} to arg-2's uuid
if arg-1 is "reset":
delete {nickname::%{_player}%}
send "{@prefix} Nickname reset!" to player
stop
else if {banned-words::*} contains uncolored arg-1:
send "{@nick-not-allowed}" to player
stop
else if player has permission "{@color-nick-perm}":
set {nickname::%{_player}%} to colored arg-1
set {_nick} to "{@nick-changed}"
replace all "[nick]" in {_nick} with {nickname::%{_player}%}
send {_nick} to player
else:
set {nickname::%{_player}%} to uncolored arg-1
set {_nick} to "{@nick-changed}"
replace all "[nick]" in {_nick} with {nickname::%{_player}%}
send {_nick} to player
command /prefix [<text>] [<player>]:
permission: {@prefix-perm}
trigger:
if arg-1 is set:
set {_player} to player's uuid
if arg-2 is set:
if player is op:
set {_player} to arg-2's uuid
if arg-1 is "reset":
delete {prefix::%{_player}%}
send "{@prefix} Prefix reset!" to player
stop
else if {banned-words::*} contains uncolored arg-1:
send "{@prefix-not-allowed}" to player
stop
else if player has permission "{@color-prefix-perm}":
set {prefix::%{_player}%} to colored arg-1
set {_msg} to "{@prefix-changed}"
replace all "[prefix]" in {_msg} with {prefix::%{_player}%}
send {_msg} to player
else:
set {prefix::%{_player}%} to uncolored arg-1
set {_msg} to "{@prefix-changed}"
replace all "[prefix]" in {_msg} with {prefix::%{_player}%}
send {_msg} to player
command /suffix [<text>] [<player>]:
permission: {@suffix-perm}
trigger:
if arg-1 is set:
set {_player} to player's uuid
if arg-2 is set:
if player is op:
set {_player} to arg-2's uuid
if arg-1 is "reset":
delete {suffix::%{_player}%}
send "{@prefix} Suffix reset!" to player
stop
else if {banned-words::*} contains uncolored arg-1:
send "{@suffix-not-allowed}" to player
stop
else if player has permission "{@color-suffix-perm}":
set {suffix::%{_player}%} to colored arg-1
set {_msg} to "{@suffix-changed}"
replace all "[suffix]" in {_msg} with {suffix::%{_player}%}
send {_msg} to player
else:
set {suffix::%{_player}%} to uncolored arg-1
set {_msg} to "{@suffix-changed}"
replace all "[suffix]" in {_msg} with {suffix::%{_player}%}
send {_msg} to player
command /bannedwords [<text>] [<text>]:
permission: {@banned-words-add}
trigger:
if arg-1 is "add":
if arg-2 is set:
if {banned-words::*} contains arg-2:
send "{@prefix} This word is already banned!" to player
else:
add arg-2 to {banned-words::*}
send "{@prefix} This word has been successfully banned!" to player
else:
send "{@prefix} Usage: /bannedwords add <word>" to player
else if arg-1 is "remove":
if arg-2 is set:
if {banned-words::*} does not contain arg-2:
send "{@prefix} This word is not banned!" to player
else:
remove arg-2 from {banned-words::*}
send "{@prefix} This word has been successfully unbanned!" to player
else:
send "{@prefix} Usage: /bannedwords remove <word>" to player
else if arg-1 is "list":
send "&3&lBanned Words:" to player
loop {banned-words::*}:
send "&9[&b%loop-index%&9] &3%loop-value%" to player
else:
send "{@prefix} Usage: %newline% &7/bannedwords add <word> %newline% &7/bannedwords remove <word> %newline% &7/bannedwords list" to player
command /chat [<text>] [<text>]:
permission: {@moderatorperm}
trigger:
if arg-1 is "clear":
loop 100 times:
broadcast " "
broadcast "{@prefix} Chat was cleared by: &5&l%player%"
else if arg-1 is "mute":
if arg-2 is not set:
if {server-mute} is set:
delete {server-mute}
broadcast "{@prefix} Chat was unmuted by: &5&l%player%"
else:
set {server-mute} to true
broadcast "{@prefix} Chat was muted by: &5&l%player%"
else:
set {_player} to arg-2 parsed as offline player
set {_uuid} to {_player}'s uuid
if {muted::%{_uuid}%} is set:
delete {muted::%{_uuid}%}
broadcast "{@prefix} %{_player}% was unmuted by: &5&l%player%"
else:
set {muted::%{_uuid}%} to true
broadcast "{@prefix} %{_player}% was muted by: &5&l%player%"
else:
send "{@prefix} Usage: %newline% &7/chat clear %newline% &7/chat mute %newline% &7/chat mute [<player>]" to player
command /chatcolor:
permission: {@chatcolor-perm}
trigger:
set {_inventory} to chest inventory with 2 rows named "&3&lChatColor"
set slot 0 of {_inventory} to paper named "&0&lBlack" with lore "" and "&7Example: &0Hello!"
set slot 1 of {_inventory} to paper named "&1&lDark Blue" with lore "" and "&7Example: &1Hello!"
set slot 2 of {_inventory} to paper named "&2&lDark Green" with lore "" and "&7Example: &2Hello!"
set slot 3 of {_inventory} to paper named "&3&lDark Aqua" with lore "" and "&7Example: &3Hello!"
set slot 4 of {_inventory} to paper named "&4&lDark Red" with lore "" and "&7Example: &4Hello!"
set slot 5 of {_inventory} to paper named "&5&lDark Purple" with lore "" and "&7Example: &5Hello!"
set slot 6 of {_inventory} to paper named "&6&lGold" with lore "" and "&7Example: &6Hello!"
set slot 7 of {_inventory} to paper named "&7&lGray" with lore "" and "&7Example: &7Hello!"
set slot 8 of {_inventory} to paper named "&8&lDark Gray" with lore "" and "&7Example: &8Hello!"
set slot 9 of {_inventory} to paper named "&9&lBlue" with lore "" and "&7Example: &9Hello!"
set slot 10 of {_inventory} to paper named "&a&lGreen" with lore "" and "&7Example: &aHello!"
set slot 11 of {_inventory} to paper named "&b&lAqua" with lore "" and "&7Example: &bHello!"
set slot 12 of {_inventory} to paper named "&c&lRed" with lore "" and "&7Example: &cHello!"
set slot 13 of {_inventory} to paper named "&d&lPink" with lore "" and "&7Example: &dHello!"
set slot 14 of {_inventory} to paper named "&e&lYellow" with lore "" and "&7Example: &eHello!"
set slot 15 of {_inventory} to paper named "&f&lWhite" with lore "" and "&7Example: &fHello!"
set slot 17 of {_inventory} to barrier named "&c&lCancel" with lore "" and "&7Click to cancel!"
open {_inventory} to player
on inventory click:
if event-inventory is not player's inventory:
if event-slot is paper named "&0&lBlack" with lore "" and "&7Example: &0Hello!":
cancel event
set {chat-color::%player's uuid%} to "&0"
send "{@prefix} You changed your chat color to: &0&lBlack" to player
else if event-slot is paper named "&1&lDark Blue" with lore "" and "&7Example: &1Hello!":
cancel event
set {chat-color::%player's uuid%} to "&1"
send "{@prefix} You changed your chat color to: &1&lDark Blue" to player
else if event-slot is paper named "&2&lDark Green" with lore "" and "&7Example: &2Hello!":
cancel event
set {chat-color::%player's uuid%} to "&2"
send "{@prefix} You changed your chat color to: &2&lDark Green" to player
else if event-slot is paper named "&3&lDark Aqua" with lore "" and "&7Example: &3Hello!":
cancel event
set {chat-color::%player's uuid%} to "&3"
send "{@prefix} You changed your chat color to: &3&lDark Aqua" to player
else if event-slot is paper named "&4&lDark Red" with lore "" and "&7Example: &4Hello!":
cancel event
set {chat-color::%player's uuid%} to "&4"
send "{@prefix} You changed your chat color to: &4&lDark Red" to player
else if event-slot is paper named "&5&lDark Purple" with lore "" and "&7Example: &5Hello!":
cancel event
set {chat-color::%player's uuid%} to "&5"
send "{@prefix} You changed your chat color to: &5&lDark Purple" to player
else if event-slot is paper named "&6&lGold" with lore "" and "&7Example: &6Hello!":
cancel event
set {chat-color::%player's uuid%} to "&6"
send "{@prefix} You changed your chat color to: &6&lGold" to player
else if event-slot is paper named "&7&lGray" with lore "" and "&7Example: &7Hello!":
cancel event
set {chat-color::%player's uuid%} to "&7"
send "{@prefix} You changed your chat color to: &7&lGray" to player
else if event-slot is paper named "&8&lDark Gray" with lore "" and "&7Example: &8Hello!":
cancel event
set {chat-color::%player's uuid%} to "&8"
send "{@prefix} You changed your chat color to: &8&lDark Gray" to player
else if event-slot is paper named "&9&lBlue" with lore "" and "&7Example: &9Hello!":
cancel event
set {chat-color::%player's uuid%} to "&9"
send "{@prefix} You changed your chat color to: &9&lBlue" to player
else if event-slot is paper named "&a&lGreen" with lore "" and "&7Example: &aHello!":
cancel event
set {chat-color::%player's uuid%} to "&a"
send "{@prefix} You changed your chat color to: &a&lGreen" to player
else if event-slot is paper named "&b&lAqua" with lore "" and "&7Example: &bHello!":
cancel event
set {chat-color::%player's uuid%} to "&b"
send "{@prefix} You changed your chat color to: &b&lAqua" to player
else if event-slot is paper named "&c&lRed" with lore "" and "&7Example: &cHello!":
cancel event
set {chat-color::%player's uuid%} to "&c"
send "{@prefix} You changed your chat color to: &c&lRed" to player
else if event-slot is paper named "&d&lPink" with lore "" and "&7Example: &dHello!":
cancel event
set {chat-color::%player's uuid%} to "&d"
send "{@prefix} You changed your chat color to: &d&lPink" to player
else if event-slot is paper named "&e&lYellow" with lore "" and "&7Example: &eHello!":
cancel event
set {chat-color::%player's uuid%} to "&e"
send "{@prefix} You changed your chat color to: &e&lYellow" to player
else if event-slot is paper named "&f&lWhite" with lore "" and "&7Example: &fHello!":
cancel event
set {chat-color::%player's uuid%} to "&f"
send "{@prefix} You changed your chat color to: &f&lWhite" to player
else if event-slot is barrier named "&c&lCancel" with lore "" and "&7Click to cancel!":
cancel event
close inventory of player