This repository has been archived by the owner on May 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMidnightCore.sk
528 lines (508 loc) · 18.8 KB
/
MidnightCore.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
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
#-------------------------------------------
#
# Midnight Core 1.2
#
# Created by koqel and bradleyw8_
#
# Reccomended Addons (Some Addons Will support 1.8.8+):
# Skript
# 1.16+: https://github.com/SkriptLang/Skript/releases
# SkUtils
# 1.16+: https://forums.skunity.com/resources/skutilities.26/
# SkRayFall
# 1.16+: https://sk.rayfall.net/
# SkQuery
# 1.16+: https://www.spigotmc.org/resources/skquery-1-13-1-18.36631/
# Skellet
# 1.16+: https://www.spigotmc.org/resources/skript-java-addon-skellett.34361/
# Luck Perms
# 1.16+: https://www.spigotmc.org/resources/luckperms.28140/
#
#
#
#
#-------------------------------------------
#Options (You Can Edit These!)
options: #Config
Version: 1.2 # <- Dont Edit This
Prefix: &9Midnight&5Core &7» # <- Prefix of the skript
APILink: https://raw.githubusercontent.com/Diplodocolus/MidnightCore/Master/APIVer.ver # <- DO NOT CHANGE THIS, IT IS REQUIRED FOR AUTO UPDATE
CheckForUpdates: true # <- Automatically Checks For Updates
staffPermission: Midnight.Staff # <- Staff Permission
builderPermission: Midnight.Builder # <- Builder Permission
devPermission: Midnight.Dev # <- Developer Permission
adminPermission: Midnight.Admin # <- Admin Permission
muteChatBypass: Midnight.Bypass.ChatMute # <- Mute Chat bypass permission
permissionMessage: &9Midnight&5Core &7» &cYou do not have the required permission to use this command! # <- No permission message
fileName: MidnightCore.sk # <- Name of the file
discordInvite: https://discord.gg/jDZJF8UUgE # <- Discord link
adMessage: /ad YOUR MINEHUT AD HERE # <- Helps with minehut advertisements
storeLink: YOUR STORE LINK HERE! # <- Webstore link
joinMessageEnabled: true # <- Enable/Disable custom join messages
leaveMessageEnabled: true # <- Enable/Disable custom leave messages
staffJoinMessageEnabled: false # <- Enable/Disable custom staff join messages (BETA)
staffLeaveMessageEnabled: false # <- Enable/Disable custom staff leave messages (BETA)
joinMessage: &8[&a+&8] %player% # <- Custom Join Message
leaveMessage: &8[&4-&8] %player% # <- Custom Leave Message
staffJoinMessage: &8[&cSTAFF&8]&9%player% &5joined # <- Custom Staff Join Message (Prefix Will Be Added Soon!)
staffLeaveMessage: &8[&cSTAFF&8]&9%player% &5left # <- Custom Staff Leave Message (Prefix Will Be Added Soon!)
broadcastNoReason: %player% has muted %arg 1%! # <- Mute No Reason Broadcast
broadcastWithReason: %player% has muted %arg 1% for %arg 2% # <- Mute Reason Broadcast
broadcastUnmute: %player% has unmuted %arg 1%! # <- UnMute Reason Broadcast
muteMessage: &c&lYou're Muted! # <- Mute Message
unmuteError: &c&lPlayer is not muted! # <- Mute Error
#Scoreboard options
toggleScoreboard: true #Enable/Disable Scoreboard (Requires SKRayFall)
sbName: &9MidNight&5Core
sbIP: YOUR SERVERS IP
#Custom Chat Options
enableChat: true #DISABLED
chatFormatRank: %player's prefix% &7%player's name%: %message% #Chat for people with a rank
#ScoreBoard (You can edit the parts in "")
every 1 second:
loop all players:
if {@toggleScoreboard} is false:
stop
else if {@toggleScoreboard} is true:
set {_online} to number of all players
wipe loop-player's sidebar
set name of sidebar of loop-player to "{@sbName}" #Name Of Scoreboard
set score "&7&m----------------------" in sidebar of loop-player to 9
set score "&5&lPLAYER: &9%loop-player%" in sidebar of loop-player to 8
set score "" in sidebar of loop-player to 7
set score "&5&lONLINE PLAYERS: &9%{_online}%" in sidebar of loop-player to 6
set score "" in sidebar of loop-player to 5
set score "&5&lPING: &9%ping of loop-player%" in sidebar of loop-player to 4
set score "" in sidebar of loop-player to 3
set score "{@sbIP}" in sidebar of loop-player to 2
set score "&7&m----------------------" in sidebar of loop-player to 1
#Chat
#on chat:
# if {@enableChat} is true:
# set the chat format to "{@chatFormatRank}"
#Main Code (DONT EDIT UNLESS YOU KNOW WHAT YOUR DOING!)
#
#StaffChat
command /staffchat [<text>]:
aliases: /sc
permission: {@staffPermission}
permission message: {@permissionMessage}
usage: &c/Staffchat (Message)
trigger:
if arg-1 is not set:
send "&c/Staffchat (Message)" to player
else:
loop all players:
if loop-player has permission "{@staffPermission}":
send "&7[&eSC&7] &f%player%: &e%arg-1%" to loop-player
#AdminChat
command /adminchat [<text>]:
aliases: /ac
permission: {@adminPermission}
permission message: {@permissionMessage}
usage: &c/Adminchat (Message)
trigger:
if arg-1 is not set:
send "&c/Adminchat (Message)" to player
else:
loop all players:
if loop-player has permission "{@adminPermission}":
send "&7[&cAC&7] &f%player%: &c%arg-1%" to loop-player
#BuilderChat
command /builderchat [<text>]:
aliases: /cb
permission: {@builderPermission}
permission message: {@permissionMessage}
usage: &c/Builderchat (Message)
trigger:
if arg-1 is not set:
send "&c/Builderchat (Message)" to player
else:
loop all players:
if loop-player has permission "{@builderPermission}":
send "&7[&dBC&7] &f%player%: &d%arg-1%" to loop-player
#DeveloperChat
command /devchat [<text>]:
aliases: /cd
permission: {@devPermission}
permission message: {@permissionMessage}
usage: &c/Devchat (Message)
trigger:
if arg-1 is not set:
send "&c/Devchat (Message)" to player
else:
loop all players:
if loop-player has permission "{@devPermission}":
send "&7[&bDC&7] &f%player%: &b%arg-1%" to loop-player
#DiscordCMD
command /discord:
aliases: /dc
trigger:
send "<link:{@discordInvite}>&5&lCLICK ME!<reset>" to player
#StoreCMD
command /store:
trigger:
send "{@storeLink}" to player
#Report
command /report [<player>] [<text>]:
cooldown: 10 seconds
cooldown message: &cPlease Wait 10 seconds in between reports. &7(This is to prevent spam!)
usage: &c/Report (Player) (Reason)
trigger:
if arg-1 is not set:
send "&c/Report (Player) (Reason)" to player
else if arg-2 is not set:
send "&c/Report (Player) (Reason)" to player
else if arg-1 is set:
if arg-2 is set:
send "&aThanks For Your Report Staff Are Investigating!" to player
loop all players:
if loop-player has permission "{@staffPermission}":
send "&4REPORT" to loop-players
send "&a%player% &cReported &4%arg-1%" to loop-player
send "&4Reason: %arg-2%" to loop-player
#Message
command /message [<player>] [<text>]:
usage: &c/Message (Player) (Message)
aliases: /msg, /pm, /dm, /pmsg
trigger:
if arg-1 is not set:
send "&c/Message (Player) (Message)" to player
else if arg-2 is not set:
send "&c/Message (Player) (Message)" to player
else if arg-1 is set:
if arg-2 is set:
send "&b%player% whispers: %arg-2%" to arg-1
#LoadMSG
on load:
send "&a--------------------------------------------" to console
send "&9Midnight&5Core v{@Version} has been enabled!" to console
send "&aCreated by bradleyw8_, koqel and LLayered" to console
send "&a-------------------------------------------" to console
#Join Message
on join:
if {@joinMessageEnabled} is false:
stop
else if {@joinMessageEnabled} is true:
broadcast "{@joinMessage}"
#LeaveMessage
on quit:
if {@leaveMessageEnabled} is false:
stop
else if {@leaveMessageEnabled} is true:
broadcast "{@leaveMessage}"
#StaffJoinMessage
on join:
if {@staffJoinMessageEnabled} is false:
stop
else if {@staffJoinMessageEnabled} is true:
loop all players:
if loop-player has permission "{@staffPermission}":
send "{@staffJoinMessage}" to loop-player
#StaffLeaveMessage
on quit:
if {@staffLeaveMessageEnabled} is false:
stop
else if {@staffLeaveMessageEnabled} is true:
loop all players:
if loop-player has permission "{@staffPermission}":
send "{@staffLeaveMessage}" to loop-player
#ReloadCMD
command /reload:
permission: {@adminPermission}
permission message: {@permissionMessage}
trigger:
make player execute command "/sk reload {@fileName}"
send "&aReloaded &9MidNight&5Core"
#ClearChat
command /ClearChat:
aliases: /cc, /cchat, /chatclear
permission: {@adminPermission}
permission message: {@permissionMessage}
trigger:
loop 500 times:
send " " to all players
broadcast "&6Chat cleared by &b%player%"
#MuteChat
command /MuteChat:
aliases: /mc, /mchat, /chatmute
permission: {@adminPermission}
permission message: {@permissionMessage}
trigger:
if {muteChat} is not set:
set {muteChat} to true
broadcast "&6Chat was muted by &b%player%"
stop trigger
if {muteChat} is set:
clear {muteChat}
broadcast "&6Chat was unmuted by &b%player%"
on chat:
if {muteChat} is set:
if player has permission "{@muteChatBypass}":
stop trigger
else:
cancel event
send "&cChat is currently muted!" to player
#Unban
command /unban [<OfflinePlayer>]:
aliases: /pardon, /unb
permission: {@adminPermission}
permission message: {@permissionMessage}
trigger:
if arg-1 is banned:
unban the arg-1
loop all players:
if loop-player has permission "{@staffPermission}":
send "{@Prefix} &9%player's name% &5unbanned &9%arg-1%"
log "%player's name% unbanned %arg-1% on %now%" to "plugins/MidNightCore/Logs.yml"
else:
message "{@Prefix} &9%arg-1% &5is not banned!"
#Ban
command /ban <offlineplayer> [<text>] [<timespan>]:
permission: {@adminPermission}
permission message: {@permissionMessage}
usage: &c/ban <player> <reason> <timespan>
trigger:
arg-1 is a op:
send "{@Prefix} &cYou cannot ban this person!" to player
stop
if arg-1 is banned:
send "{@Prefix} &9%arg-1%&5 is already banned!" to player
stop
if arg-2 is set:
if arg-3 is set:
broadcast " "
broadcast "{@Prefix} &9%player's name% &5banned &9%arg-1% &5for &9%arg-2% &5for &9%arg-3%"
broadcast " "
else:
broadcast " "
broadcast "{@Prefix} &9%player's name% &5banned &9%arg-1% &5for &9%arg-2%"
broadcast " "
if arg-2 is not set:
if arg-3 is set:
broadcast " "
broadcast "{@Prefix} &9%player's name% &5banned &9%arg-1% &5for &9%arg-3%"
broadcast " "
else:
broadcast " "
broadcast "{@Prefix} &9%player's name% &5banned &9%arg-1%"
broadcast " "
set {_h} to "&9%arg-1% &5was banned by &9%player's name% &5for %arg-2% &5for %arg-3% &5on %now%" if arg-3 is set
set {_h} to "&9%arg-1% &5was banned by &9%player's name% &5for %arg-2% &5for forever &5on %now%" if arg-3 is not set
add {_h} to {history::%uuid of arg-1%::*}
log "%player's name% banned %arg-1% for %arg-2% on %now%" to "plugins/MidNightCore/Logs.yml"
kick the arg-1
ban the arg-1 due to arg-2 for arg-3
#Broadcast
command /broadcast [<text>]:
aliases: /bc, /alert
permission: {@adminPermission}
permission message: {@permissionMessage}
usage: &c/broadcast (message)
trigger:
if arg-1 is not set:
send "&9Midnight&5Core &7» &cThe broadcast message is not set!" to player
if arg-1 is set:
broadcast "&4&lALERT &7» %arg-1%"
#GameMode
command /GameMode [<text>] [<player>]:
permission: {@adminPermission}
permission message: {@permissionMessage}
aliases: /gm
trigger:
if arg-1 is not set:
send "{@Prefix} &fPlease select a gamemode!"
if arg-1 is "c" or "creative":
set player's gamemode to creative
send "{@Prefix} &9Gamemode changed to &5Creative" to player
else if arg-1 is "s" or "survival":
set player's gamemode to survival
send "{@Prefix} &9Gamemode changed to &5Creative" to player
else if arg-1 is "a" or "adventure":
set player's gamemode to adventure
send "{@Prefix} &9Gamemode changed to &5Creative" to player
else if arg-1 is "sp" or "spectator":
set player's gamemode to spectator
send "{@Prefix} &9Gamemode changed to &5Creative" to player
if arg-1 is "c" or "creative":
if arg-2 is set:
set arg-2's gamemode to creative
send "{@Prefix} &5%arg-2%'s &9gamemode changed to &5Creative" to player
else if arg-1 is "s" or "survival":
if arg-2 is set:
set arg-2's gamemode to survival
send "{@Prefix} &5%arg-2%'s &9gamemode changed to &5Survival" to player
else if arg-1 is "a" or "adventure":
if arg-2 is set:
set arg-2's gamemode to adventure
send "{@Prefix} &5%arg-2%'s &9gamemode changed to &5Adventure" to player
else if arg-1 is "sp" or "spectator":
if arg-2 is set:
set arg-2's gamemode to spectator
send "{@Prefix} &5%arg-2%'s &9gamemode changed to &5Spectator" to player
#CoreCMD
command /core:
aliases: /midnight, /midnightcore, /coreinfo, /midnightinfo
permission: {@staffPermission}
permission message: {@permissionMessage}
trigger:
send "&9Midnight&5Core &7» &eThis server is running &9Midnight&5Core Version v{@Version}. You can find out more info by joining MidnightCore's Discord @ https://dsc.gg/midnightcore" to player
#Mute
command /mute [<player>] [<text>]:
permission: {@staffPermission}
permission message: {@permissionMessage}
trigger:
if arg 1 is not set:
send "Please use format: /mute [PLAYER] [REASON]"
if arg 1 is set:
if {muted.%player-argument%} is false:
if arg 2 is not set:
set {muted.%player-argument%} to true
send "&a%arg 1% is now muted!"
send "&c&lYou're now muted!" to player-argument
broadcast "{@broadcastNoReason}"
if arg 2 is set:
set {muted.%player-argument%} to true
send "&a%arg 1% is now muted for %arg 2%!"
send "&c&lYou're now muted for %arg 2%!" to player-argument
broadcast "{@broadcastWithReason}"
set {_h} to "&9%arg-1% &5was muted by &9%player's name% &5on &9%now% &5(No reason specified!)" if arg-2 is not set
set {_h} to "&9%arg-1% &5was muted by &9%player's name% &5for &9%arg-2% &5on &9%now%" if arg-2 is set
add {_h} to {history::%uuid of arg-1%::*}
add uuid of arg-1 to {muted::*}
log "%arg-1% was muted by %player's name% on %now%" to "plugins/MidNightCore/Logs.yml"
if {muted.%player-argument%} is true:
message "&c&lPlayer Already Muted!"
on chat:
if {muted.%player%} is true:
cancel event
send "{@muteMessage}"
#UnMute
command /unmute [<player>]:
permission: {@staffPermission}
permission message: {@permissionMessage}
trigger:
if arg 1 is not set:
send "Please use format: /unmute [PLAYER]"
if arg 1 is set:
if {muted.%player-argument%} is false:
send "{@unmuteError}"
else:
set {muted.%player-argument%} to false
send "&a%arg 1% is now unmuted!"
send "&c&lYou're now unmuted!" to player-argument
broadcast "{@broadcastUnmute}"
log "%arg-1% was unmuted by %player's name% on %now%" to "plugins/MidNightCore/Logs.yml"
#History
command /history <offlineplayer>:
permission: {@adminPermission}
permission message: {@permissionMessage}
usage: &c/history <player>
trigger:
send " "
send "&9History of %arg-1%&9"
loop {history::%uuid of arg-1%::*}:
send "&9%loop-index% &9- %loop-value%" to player
send " "
#DelHistory
command /delhistory <offlineplayer> <number>:
permission: {@adminPermission}
permission message: {@permissionMessage}
usage: &c/delhistory <player> <number>
trigger:
send "{@Prefix} &5You removed a punishment from &9%arg-1%"
delete {history::%uuid of arg-1%::%arg-2%}
log "%player's name% deleted history of %arg-1% on %now%" to "plugins/MidNightCore/Logs.yml"
#ClearHistory
command /clearhistory <offlineplayer>:
permission: {@adminPermission}
permission message: {@permissionMessage}
usage: &c/delhistory <player> <number>
trigger:
set {_num} to 0
send "{@Prefix} &9%arg-1%&9's &5history was cleared." to player
loop 100 times:
delete {history::%uuid of arg-1%::%{_num}%}
add 1 to {_num}
log "%player's name% cleared history of %arg-1% on %now%" to "plugins/MidNightCore/Logs.yml"
#Warn
command /warn <offlineplayer> <text>:
permission: {@staffPermission}
permission message: {@permissionMessage}
usage: &c/warn <player> <reason>
trigger:
arg-1 is a op:
send "{@Prefix} &cYou cannot warn this person!" to player
stop
broadcast " "
broadcast "{@Prefix} &9%player's name% &5warned &9%arg-1% &5for %arg-2%&5"
broadcast " "
set {_m} to "&9%player's name% &5warned &9%arg-1% &5for %arg-2%&5 on %now%"
add {_m} to {history::%uuid of arg-1%::*}
log "%player's name% warned %arg-1% for %arg-2% on %now%" to "plugins/MidNightCore/Logs.yml"
#Heal
command /heal [<player>]:
permission: {@staffPermission}
permission message: {@permissionMessage}
trigger:
if arg-1 is not set:
heal player
set food level of player to 20
send "&5You have been healed!" to player
else if arg-1 is set:
heal arg-1
set food level of arg-1 to 20
send "&5%arg-1% has been healed!" to player
send "&5You have been healed!" to arg-1
#Feed
command /feed [<player>]:
permission: {@staffPermission}
permission message: {@permissionMessage}
trigger:
if arg-1 is not set:
set food level of player to 20
send "&5You have been fed!" to player
else if arg-1 is set:
set food level of arg-1 to 20
send "&5%arg-1% has been fed!" to player
send "&5You have been fed!" to arg-1
#Kick
command /kick [<player>] [<text>]:
permission: {@adminPermission}
permission message: {@permissionMessage}
trigger:
if arg-1 is not set:
send "{@Prefix} &5Please choose a player to kick!" to player
else:
if arg-2 is not set:
kick arg-1
else:
kick arg-1 due to arg-2
set {_h} to "&9%arg-1% &5was kicked by &9%player's name% &5for %arg-2% &5on %now%" if arg-2 is set
set {_h} to "&9%arg-1% &5was kicked by &9%player's name% &5on %now% &7(No Reason Specified!)" if arg-2 is not set
add {_h} to {history::%uuid of arg-1%::*}
log "%player's name% kicked %arg-1% for %arg-2% on %now%" to "plugins/MidNightCore/Logs.yml" if arg-2 is set
log "%player's name% kicked %arg-1% on %now% (No Reason Specified!)" to "plugins/MidNightCore/Logs.yml" if arg-2 is not set
#AdCMD
command /ad:
trigger:
send "<suggest command:{@adMessage}>&5&lCLICK ME!<reset>" to player
#Auto Updater
on join:
if player is op:
if {@CheckForUpdates} is true:
set {_latestVer} to line 4 from url "{@APILink}"
if {_latestVer} is not "{@Version}":
loop all players:
if loop-player has permission "{@StaffPermission}":
send "&a&m----------------------------" to loop-player
send "&9Midnight &5Core &fhas found an update" to loop-player
send "<link:https://www.spigotmc.org/resources/midnight-core-skript.99954/>&c[Click Here to download it]<reset>" to loop-player
send "&a&m----------------------------" to loop-player
if {_latestVer} is "{@APILink}":
loop all players:
if loop-player has permission "{@StaffPermission}":
send "{@Prefix} &aNo new updates found" to loop-player
else if {@CheckForUpdates} is false:
stop
#End Of Current Code