forked from Epix-Incorporated/Adonis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModerators.luau
More file actions
7535 lines (6835 loc) · 245 KB
/
Moderators.luau
File metadata and controls
7535 lines (6835 loc) · 245 KB
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
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
return function(Vargs, env)
local server = Vargs.Server;
local service = Vargs.Service;
local Settings = server.Settings
local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps
if env then setfenv(1, env) end
local Routine = env.Routine
local Pcall = env.Pcall
return {
Kick = {
Prefix = Settings.Prefix;
Commands = {"kick"};
Args = {"player", "optional reason"};
Filter = true;
Description = "Disconnects the target player from the server";
AdminLevel = "Moderators";
Dangerous = true;
Function = function(plr: Player, args: {string}, data: {})
for _, v in service.GetPlayers(plr, assert(args[1], "Missing target player (argument #1)"), {IsKicking = true}) do
if Admin.CheckAuthority(plr, v, "kick") then
local playerName = service.FormatPlayer(v)
if not service.Players:FindFirstChild(v.Name) then
Remote.Send(v, "Function", "Kill")
else
v:Kick(args[2])
end
Functions.LogAdminAction(plr, "Kick", v.Name, args[2] or "No reason provided")
Functions.Hint(`Kicked {playerName}`, {plr})
end
end
end
};
ESP = {
Prefix = Settings.Prefix;
Commands = {"esp", "xray"};
Args = {"target (optional)", "brickcolor (optional)"};
Filter = true;
Description = "Allows you to see <target> (or all humanoids if no target is supplied) through walls";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string}, data: {})
Remote.Send(plr, "Function", "CharacterESP", false)
if args[1] then
for _2, v2 in service.GetPlayers(plr, args[1]) do
if not v2.Character then
continue
end
Remote.Send(plr, "Function", "CharacterESP", true, v2.Character, args[2] and BrickColor.new(args[2]).Color)
end
else
Remote.Send(plr, "Function", "CharacterESP", true)
end
end
};
UnESP = {
Prefix = Settings.Prefix;
Commands = {"unesp", "unxray"};
Args = {};
Filter = true;
Description = "Removes ESP";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string}, data: {})
Remote.Send(plr, "Function", "CharacterESP", false)
end
};
Thru = {
Prefix = Settings.Prefix;
Commands = {"thru", "pass", "through"};
Args = {"distance? (default: 5)"};
Description = "Lets you pass through an object or a wall";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
local rawDistance = tonumber(args[1] or 5)
assert(rawDistance, "Invalid distance value (must be a number)")
local distance = rawDistance * -1
if plr.Character:FindFirstChild("HumanoidRootPart") then
if plr.Character.Humanoid.SeatPart~=nil then
Functions.RemoveSeatWelds(plr.Character.Humanoid.SeatPart)
end
if plr.Character.Humanoid.Sit then
plr.Character.Humanoid.Sit = false
plr.Character.Humanoid.Jump = true
end
Variables.ReturnPoints[plr] = plr.Character.HumanoidRootPart.CFrame
task.wait()
plr.Character:PivotTo(plr.Character:GetPivot() * CFrame.new(0, 0, distance))
end
end
};
TimeBanList = {
Prefix = Settings.Prefix;
Commands = {"timebanlist", "timebanned", "timebans"};
Args = {};
Description = "Shows you the list of time banned users";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
local variables = Core.Variables
local timeBans = variables.TimeBans or {}
local tab = table.create(#timeBans)
for ind, v in timeBans do
local timeLeft = v.EndTime - os.time()
local minutes = Functions.RoundToPlace(timeLeft / 60, 2)
if timeLeft <= 0 then
table.remove(variables.TimeBans, ind)
else
table.insert(tab, {
Text = `{v.Name}:{v.UserId}`,
Desc = string.format("Issued by: %s | Reason: %s | Minutes left: %d", v.Moderator or "%UNKNOWN%", v.Reason, minutes)
})
end
end
Remote.MakeGui(plr, "List", {Title = "Time Bans", Tab = tab})
end
};
Notification = {
Prefix = Settings.Prefix;
Commands = {"notify", "notification", "notice"};
Args = {"player", "message"};
Description = "Sends the player a notification";
Filter = true;
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
assert(args[2], "Missing message")
for _, v in service.GetPlayers(plr, assert(args[1], "Missing player name")) do
if v.UserId ~= plr.UserId then
local success, canUserChatData = pcall(service.TextChatService.CanUsersDirectChatAsync, service.TextChatService, plr.UserId, {v.UserId})
if not success then
Functions.Hint(`Unable to send {service.FormatPlayer(v)} a notification due an error.`, {plr})
continue
end
if #canUserChatData == 0 then
Functions.Hint(`Unable to send {service.FormatPlayer(v)} a notification due to chat restrictions.`, {plr})
continue
end
end
Functions.Notification("Notification", service.Filter(args[2], plr, v), {v})
end
end
};
SlowMode = {
Prefix = Settings.Prefix;
Commands = {"slowmode"};
Args = {"seconds or \"disable\""};
Description = "Chat Slow Mode";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
local num = args[1] and tonumber(args[1]) --math.min(tonumber(args[1]), 120)
if num then
Admin.SlowMode = num;
Functions.Hint(`Chat slow mode enabled ({num}s)`, service.GetPlayers())
else
Admin.SlowMode = nil;
table.clear(Admin.SlowCache)
Functions.Hint("Chat slow mode disabled", {plr})
end
end
};
Countdown = {
Prefix = Settings.Prefix;
Commands = {"countdown", "timer", "cd"};
Args = {"time (in seconds)"};
Description = "Countdown";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
local num = assert(tonumber(args[1]), "Missing or invalid time value (must be a number)")
assert(num <= 1000, "Countdown cannot be longer than 1000 seconds.")
assert(num >= 0, "Countdown cannot be negative.")
for _, v in service.GetPlayers() do
Remote.MakeGui(v, "Countdown", {
Time = math.round(num);
})
end
end
};
CountdownPM = {
Prefix = Settings.Prefix;
Commands = {"countdownpm", "timerpm", "cdpm"};
Args = {"player", "time (in seconds)"};
Description = "Countdown on a target player(s) screen.";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing target player and time value!")
local num = assert(tonumber(args[2]), "Missing or invalid time value (must be a number)")
assert(num <= 1000, "Countdown cannot be longer than 1000 seconds.")
assert(num >= 0, "Countdown cannot be negative.")
for _, v in service.GetPlayers(plr, args[1]) do
Remote.MakeGui(v, "Countdown", {
Time = math.round(num);
})
end
end
};
HintCountdown = {
Prefix = Settings.Prefix;
Commands = {"hcountdown", "hc"};
Args = {"time"};
Description = "Hint Countdown";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
local num = math.min(assert(tonumber(args[1]), "Time must be a number"), 120)
local loop
loop = service.StartLoop("HintCountdown", 1, function()
if num < 1 then
loop.Running = false
else
Functions.Hint(num, service.GetPlayers(), 2.5)
num -= 1
end
end)
end
};
StopCountdown = {
Prefix = Settings.Prefix;
Commands = {"stopcountdown", "stopcd"};
Args = {};
Description = "Stops all currently running countdowns";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Remote.RemoveGui(v, "Countdown")
end
service.StopLoop("HintCountdown")
end
};
TimeMessage = {
Prefix = Settings.Prefix;
Commands = {"tm", "timem", "timedmessage", "timemessage"};
Args = {"time", "message"};
Filter = true;
Description = "Make a message and makes it stay for the amount of time (in seconds) you supply";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
Functions.Message(`Message from {service.FormatPlayer(plr)}`, service.BroadcastFilter(assert(args[2], "Missing message"), plr), service.GetPlayers(), true, assert(tonumber(args[1]), "Invalid time amount (must be number)"))
end
};
Message = {
Prefix = Settings.Prefix;
Commands = {"m", "message"};
Args = {"message"};
Filter = true;
Description = "Makes a message";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
Functions.Message(plr, `Message from {service.FormatPlayer(plr)}`, service.BroadcastFilter(assert(args[1], "Missing message"), plr), nil, service.GetPlayers(), true)
end
};
MessagePM = {
Prefix = Settings.Prefix;
Commands = {"mpm", "messagepm"};
Args = {"player", "message"};
Filter = true;
Description = "Makes a private message on the target player(s) screen.";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing player name")
assert(args[2], "Missing message")
local Sender = string.format("Message from %s", service.FormatPlayer(plr))
for _, v in service.GetPlayers(plr, args[1]) do
if v.UserId ~= plr.UserId then
local success, canUserChatData = pcall(service.TextChatService.CanUsersDirectChatAsync, service.TextChatService, plr.UserId, {v.UserId})
if not success then
Functions.Hint(`Unable to private message {service.FormatPlayer(v)} due an error.`, {plr})
continue
end
if #canUserChatData == 0 then
Functions.Hint(`Unable to private message {service.FormatPlayer(v)} due to chat restrictions.`, {plr})
continue
end
end
Functions.Message(Sender, service.Filter(args[2], plr, v), {v}, true)
end
end
};
Notify = {
Prefix = Settings.Prefix;
Commands = {"n", "smallmessage", "nmessage", "nmsg", "smsg", "smessage"};
Args = {"message"};
Filter = true;
Description = "Makes a small message";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
Functions.Notify(`Message from @{plr.Name}`, service.BroadcastFilter(assert(args[1], "Missing message"), plr), service.GetPlayers(), nil, plr)
end
};
CustomNotify = {
Prefix = Settings.Prefix;
Commands = {"cn", "customsmallmessage", "cnmessage"};
Args = {"title", "message"};
Filter = true;
Description = `Same as {Functions.GetMainPrefix()}n but says whatever you want the title to be instead of your name.`;
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
Functions.Notify(service.BroadcastFilter(assert(args[1], "Missing title"), plr), service.BroadcastFilter(assert(args[2], "Missing message") , plr), service.GetPlayers())
end
};
NotifyPM = {
Prefix = Settings.Prefix;
Commands = {"npm", "smallmessagepm", "nmessagepm", "nmsgpm", "npmmsg", "smsgpm", "spmmsg", "smessagepm"};
Args = {"player", "message"};
Filter = true;
Description = "Makes a small private message on the target player(s) screen.";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing player name")
assert(args[2], "Missing message")
for _, v in service.GetPlayers(plr, args[1]) do
if v.UserId ~= plr.UserId then
local success, canUserChatData = pcall(service.TextChatService.CanUsersDirectChatAsync, service.TextChatService, plr.UserId, {v.UserId})
if not success then
Functions.Hint(`Unable to private message {service.FormatPlayer(v)} due an error.`, {plr})
continue
end
if #canUserChatData == 0 then
Functions.Hint(`Unable to private message {service.FormatPlayer(v)} due to chat restrictions.`, {plr})
continue
end
end
Remote.RemoveGui(v, "Notify")
Functions.Notify(`Message from {service.FormatPlayer(plr)}`, service.Filter(args[2], plr, v), {v})
end
end
};
Hint = {
Prefix = Settings.Prefix;
Commands = {"h", "hint"};
Args = {"message"};
Filter = true;
Description = "Makes a hint";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing message")
Functions.Hint(string.format("%s: %s", service.FormatPlayer(plr), service.BroadcastFilter(args[1], plr)), service.GetPlayers(), nil, service.FormatPlayer(plr), `rbxthumb://type=AvatarHeadShot&id={plr.UserId}&w=48&h=48`)
end
};
TimeHint = {
Prefix = Settings.Prefix;
Commands = {"th", "timehint", "thint"};
Args = {"time", "message"};
Filter = true;
Description = "Makes a hint and make it stay on the screen for the specified amount of time";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
Functions.Hint(service.BroadcastFilter(assert(args[2], "Missing message"), plr), service.GetPlayers(), assert(tonumber(args[1]), "Invalid time amount (must be a number)"), service.FormatPlayer(plr), `rbxthumb://type=AvatarHeadShot&id={plr.UserId}&w=48&h=48`)
end
};
Warn = {
Prefix = Settings.Prefix;
Commands = {"warn", "warning"};
Args = {"player/user", "reason"};
Filter = true;
Dangerous = true;
Description = "Warns players";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string}, data: {})
assert(args[1], "Missing target player(s) (argument #1)")
local reason = assert(args[2], "Missing reason (argument #2)")
for _, v in service.GetPlayers(plr, args[1], {
DontError = false;
IsServer = false;
IsKicking = false;
UseFakePlayer = true;
})
do
if Admin.CheckAuthority(plr, v, "warn", false) then
local playerData = Core.GetPlayer(v)
table.insert(playerData.Warnings, {
From = plr.Name;
Message = reason;
Time = os.time();
})
Functions.LogAdminAction(plr, "Warned", v.Name, reason)
service.Events.WarningAdded:Fire(v, args[2], plr)
--// Check if its a fake player, this should allow it to save.
if service.Wrapped(v) then
task.defer(Core.SavePlayerData, v, playerData)
end
Remote.RemoveGui(v, "Notify")
Functions.Notify(`Warning from {service.FormatPlayer(plr)}`, reason, {v})
Functions.Notification("Notification", `Warned {service.FormatPlayer(v)}`, {plr}, 5, "MatIcons://Shield", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Functions.GetMainPrefix()}warnings {v.Name}')`))
end
end
end
};
KickWarn = {
Prefix = Settings.Prefix;
Commands = {"kickwarn", "kwarn", "kickwarning"};
Args = {"player/user", "reason"};
Filter = true;
Dangerous = true;
Description = "Warns & kicks a player";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string}, data: {})
assert(args[1], "Missing target player(s) (argument #1)")
local reason = assert(args[2], "Missing reason (argument #2)")
for _, v in service.GetPlayers(plr, args[1], {IsKicking = true}) do
if Admin.CheckAuthority(plr, v, "kick-warn", false) then
local playerData = Core.GetPlayer(v)
table.insert(playerData.Warnings, {
From = plr.Name;
Message = reason;
Time = os.time();
})
Functions.LogAdminAction(plr, "Kick Warning", v.Name, reason)
service.Events.WarningAdded:Fire(v, reason, plr)
if typeof(v) == "Instance" then
v:Kick(string.format("\n[Warning from %s]\nReason: %s", service.FormatPlayer(plr), reason))
else
Core.CrossServer("RemovePlayer", tonumber(v.UserId), `Warning from {service.FormatPlayer(plr)}`, reason)
end
Functions.Notification("Notification", `Kick-warned {service.FormatPlayer(v)}`, {plr}, 5, "MatIcons://Shield", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Functions.GetMainPrefix()}warnings {v.Name}')`))
end
end
end
};
RemoveWarning = {
Prefix = Settings.Prefix;
Commands = {"removewarning", "unwarn"};
Args = {"player/user", "warning reason"};
Description = "Removes the specified warning from the target player";
AdminLevel = "Moderators";
Dangerous = true;
Function = function(plr: Player, args: {string}, data: {})
assert(args[1], "Missing target player(s) (argument #1)")
local reason = string.lower(assert(args[2], "Missing warning reason (argument #2)"))
for _, v in service.GetPlayers(plr, args[1], {
DontError = false;
IsServer = false;
IsKicking = false;
UseFakePlayer = true;
})
do
if Admin.CheckAuthority(plr, v, "remove warning(s) from") then
local playerData = Core.GetPlayer(v)
local playerWarnings = playerData.Warnings
local count = 0
--// remove warnings by index
local indexReason = tonumber(reason)
if indexReason and playerWarnings[indexReason] then
service.Events.PlayerWarningRemoved:Fire(v, playerWarnings[indexReason].Message, plr)
table.remove(playerWarnings, indexReason)
count += 1
else
for i, playerWarning in playerWarnings do
if string.match(string.lower(playerWarning.Message), `^{reason}`) then
service.Events.PlayerWarningRemoved:Fire(v, playerWarning.Message, plr)
table.remove(playerWarnings, i)
count += 1
end
end
end
Functions.LogAdminAction(plr, "Removed Warning", v.Name, `Reason: {reason}`)
--// Check if its a fake player, this should allow it to save.
if service.Wrapped(v) then
task.defer(Core.SavePlayerData, v, playerData)
end
Functions.Notification("Notification", string.format("Removed %d warning%s from %s.", count, count == 1 and "" or "s", service.FormatPlayer(v)), {plr}, 5, "MatIcons://Shield", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}warnings {v.Name}')`))
end
end
end
};
ClearWarnings = {
Prefix = Settings.Prefix;
Commands = {"clearwarnings", "clearwarns"};
Args = {"player"};
Dangerous = true;
Description = "Clears any warnings on a player";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1], {UseFakePlayer = true}) do
local playerData = Core.GetPlayer(v)
table.clear(playerData.Warnings)
--// Check if its a fake player, this should allow it to save.
if service.Wrapped(v) then
task.defer(Core.SavePlayerData, v, playerData)
end
Functions.LogAdminAction(plr, "Clear Warnings", v.Name, "Warnings cleared")
Functions.Notification("Notification", `Cleared warning(s) for {service.FormatPlayer(v)}`, {plr}, 5, "MatIcons://Shield", Core.Bytecode(`client.Remote.Send('ProcessCommand','{Settings.Prefix}warnings {v.Name}')`))
end
end
};
ShowWarnings = {
Prefix = Settings.Prefix;
Commands = {"warnings", "showwarnings", "warns", "showwarns", "warnlist"};
Args = {"player"};
Description = "Shows a list of warnings a player has";
AdminLevel = "Moderators";
ListUpdater = function(plr: Player, target: Player)
local data = Core.GetPlayer(target)
local tab = table.create(#(data.Warnings or {}))
for k, m in data.Warnings or {} do
table.insert(tab, {
Text = `[{k}] {m.Message}`;
Desc = `Issued by: {m.From}; {m.Message}`;
Time = m.Time;
})
end
return tab
end,
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1], {
DontError = false;
IsServer = false;
IsKicking = false;
UseFakePlayer = true;
})
do
--// For fake players
local fake_data
if service.Wrapped(v) then
fake_data = {UserId = v.UserId, Name = v.Name}
end
Remote.MakeGui(plr, "List", {
Title = `Warnings - {service.FormatPlayer(v)}`;
Icon = server.MatIcons.Gavel;
Table = Logs.ListUpdaters.ShowWarnings(plr, v);
Update = "ShowWarnings";
UpdateArg = fake_data or v;
TimeOptions = {
WithDate = true;
}
})
end
end
};
ChatNotify = {
Prefix = Settings.Prefix;
Commands = {"chatnotify", "chatmsg"};
Args = {"player", "message"};
Filter = true;
Description = "Makes a message in the target player(s)'s chat window";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string}, data: {any})
for _, v in service.GetPlayers(plr, args[1]) do
if v.UserId ~= plr.UserId then
local success, canUserChatData = pcall(service.TextChatService.CanUsersDirectChatAsync, service.TextChatService, plr.UserId, {v.UserId})
if not success then
Functions.Hint(`Unable to send {service.FormatPlayer(v)} a chat message due an error.`, {plr})
continue
end
if #canUserChatData == 0 then
Functions.Hint(`Unable to send {service.FormatPlayer(v)} a chat message due to chat restrictions.`, {plr})
continue
end
end
if service.TextChatService and service.TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
local TextToUse = args[2]
if data.Options.Chat ~= true then
TextToUse = service.SanitizeXML(args[2] or "Hello world!")
end
Remote.Send(v, "Function", "DisplaySystemMessageInTextChat", nil, `<font color="rgb(255, 64, 77)">{service.Filter(TextToUse, plr, v)}</font>`)
else
Remote.Send(v, "Function", "ChatMessage", service.Filter(args[2], plr, v), Color3.fromRGB(255, 64, 77))
end
end
end
};
ForceField = {
Prefix = Settings.Prefix;
Commands = {"ff";"forcefield";};
Args = {"player", "visible? (default: true)"};
Description = "Gives a force field to the target player(s)";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
if v.Character then
service.New("ForceField", v.Character).Visible = if args[2] and args[2]:lower() == "false" then false else true
end
end
end
};
UnForcefield = {
Prefix = Settings.Prefix;
Commands = {"unff", "unforcefield"};
Args = {"player"};
Description = "Removes force fields on the target player(s)";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
if v.Character then
Routine(function()
for _, c in v.Character:GetChildren() do
if c:IsA("ForceField") and c.Name ~= "ADONIS_FULLGOD" then
c:Destroy()
end
end
end)
end
end
end
};
Punish = {
Prefix = Settings.Prefix;
Commands = {"punish"};
Args = {"player"};
Description = "Removes the target player(s)'s character";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local char = v.Character
if char then
Remote.LoadCode(v, [[service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)]])
char.Parent = service.UnWrap(Settings.Storage)
end
end
end
};
UnPunish = {
Prefix = Settings.Prefix;
Commands = {"unpunish"};
Args = {"player"};
Description = "UnPunishes the target player(s)";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local char = v.Character
if char then
char.Parent = workspace
char:MakeJoints()
Remote.LoadCode(v, [[service.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)]])
end
end
end
};
Freeze = {
Prefix = Settings.Prefix;
Commands = {"freeze"};
Args = {"player"};
Description = "Freezes the target player(s)";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Routine(function()
if v.Character then
for a, obj in v.Character:GetChildren() do
if obj:IsA("BasePart") and obj.Name ~= "HumanoidRootPart" then obj.Anchored = true end
end
end
end)
end
end
};
Thaw = {
Prefix = Settings.Prefix;
Commands = {"thaw", "unfreeze", "unice"};
Args = {"player"};
Description = "UnFreezes the target players, thaws them out";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Routine(function()
if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
local ice = v.Character:FindFirstChild("Adonis_Ice")
local plate
if ice then
plate = service.New("Part", {
Parent = v.Character;
Name = "Adonis_Water";
Anchored = true;
CanCollide = false;
TopSurface = "Smooth";
BottomSurface = "Smooth";
Size = Vector3.new(0.2, 0.2, 0.2);
BrickColor = BrickColor.new("Steel blue");
Transparency = ice.Transparency;
CFrame = v.Character.HumanoidRootPart.CFrame * CFrame.new(0, -3, 0);
})
service.New("CylinderMesh", plate)
for i = 0.2, 3, 0.2 do
ice.Size = Vector3.new(5, ice.Size.Y - i, 5)
ice.CFrame = v.Character.HumanoidRootPart.CFrame * CFrame.new(0, -i, 0)
plate.Size = Vector3.new(i + 5, 0.2, i + 5)
wait()
end
ice:Destroy()
end
for _, obj in v.Character:GetChildren() do
if obj:IsA("BasePart") and obj.Name ~= "HumanoidRootPart" and obj ~= plate then
obj.Anchored = false
end
end
wait(3)
pcall(function() plate:Destroy() end)
end
end)
end
end
};
AFK = {
Prefix = Settings.Prefix;
Commands = {"afk"};
Args = {"player"};
Description = "FFs, Gods, Names, Freezes, and removes the target player's tools until they jump.";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
Routine(function()
local ff = service.New("ForceField", v.Character)
local hum = v.Character.Humanoid
local orig = hum.MaxHealth
local tools = service.New("Model")
hum.MaxHealth = math.huge
wait()
hum.Health = hum.MaxHealth
for k, t in v.Backpack:GetChildren() do
t.Parent = tools
end
Admin.RunCommand(`{Functions.GetMainPrefix()}name`, v.Name, `-AFK-_{service.FormatPlayer(v)}_-AFK-`)
local torso = v.Character.HumanoidRootPart
local pos = torso.CFrame
local running=true
local event
event = v.Character.Humanoid.Jumping:Connect(function()
running = false
ff:Destroy()
hum.Health = orig
hum.MaxHealth = orig
for k, t in tools:GetChildren() do
t.Parent = v.Backpack
end
Admin.RunCommand(`{Functions.GetMainPrefix()}unname`, v.Name)
event:Disconnect()
end)
repeat torso.CFrame = pos wait() until not v or not v.Character or not torso or not running or not torso.Parent
end)
end
end
};
Heal = {
Prefix = Settings.Prefix;
Commands = {"heal"};
Args = {"player"};
Description = "Heals the target player(s) (Regens their health)";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local hum = v.Character and v.Character:FindFirstChildOfClass("Humanoid")
if hum then
hum.Health = hum.MaxHealth
end
end
end
};
God = {
Prefix = Settings.Prefix;
Commands = {"god", "immortal"};
Args = {"player"};
Description = "Makes the target player(s) immortal, makes their health so high that normal non-explosive weapons can't kill them";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local hum = v.Character and v.Character:FindFirstChildOfClass("Humanoid")
if hum then
hum.MaxHealth = math.huge
hum.Health = 9e9
if Settings.CommandFeedback then
Functions.Notification("God mode", "Character God mode has been enabled. You will not take damage from non-explosive weapons.", {v}, 15, "Info")
end
end
end
end
};
UnGod = {
Prefix = Settings.Prefix;
Commands = {"ungod", "mortal", "unfullgod", "untotalgod"};
Args = {"player"};
Description = "Makes the target player(s) mortal again";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local hum = v.Character and v.Character:FindFirstChildOfClass("Humanoid")
if hum then
hum.MaxHealth = 100
hum.Health = hum.MaxHealth
local fullGodFF = v.Character:FindFirstChild("ADONIS_FULLGOD")
if fullGodFF and fullGodFF:IsA("ForceField") then
fullGodFF:Destroy()
end
if Settings.CommandFeedback then
Functions.Notification("God Mode", "Character god mode has been disabled.", {v}, 15, "Info")
end
end
end
end
};
FullGod = {
Prefix = Settings.Prefix;
Commands = {"fullgod", "totalgod"};
Args = {"player"};
Description = `Same as {Functions.GetMainPrefix()}god, but also provides blast protection`;
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, v in service.GetPlayers(plr, args[1]) do
local hum = v.Character and v.Character:FindFirstChildOfClass("Humanoid")
if hum then
hum.MaxHealth = math.huge
hum.Health = 9e9
service.New("ForceField", {
Parent = hum.Parent;
Name = "ADONIS_FULLGOD";
Visible = false;
})
if Settings.CommandFeedback then
Functions.Notification("God Mode", "Character god mode has been enabled. You will not take any damage.", {v}, 15, "Info")
end
end
end
end
};
RemoveHats = {
Prefix = Settings.Prefix;
Commands = {"removehats", "nohats", "clearhats", "rhats"};
Args = {"player"};
Description = "Removes any hats the target is currently wearing and from their HumanoidDescription.";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, p in service.GetPlayers(plr, args[1]) do
local humanoid: Humanoid? = p.Character and p.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
local humanoidDesc: HumanoidDescription = humanoid:GetAppliedDescription()
local DescsToRemove = {"HatAccessory","HairAccessory","FaceAccessory","NeckAccessory","ShouldersAccessory","FrontAccessory","BackAccessory","WaistAccessory"}
for _, prop in DescsToRemove do
humanoidDesc[prop] = ""
end
humanoid:ApplyDescription(humanoidDesc, Enum.AssetTypeVerification.Always)
end
end
end
};
RemoveHat = {
Prefix = Settings.Prefix;
Commands = {"removehat", "rhat"};
Args = {"player", "accessory name"};
Description = "Removes specific hat(s) the target is currently wearing";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
-- TODO: HumanoidDescription
assert(args[2], "Argument(s) missing or nil")
for _, p in service.GetPlayers(plr, args[1]) do
if not p.Character then continue end
for _, v in p.Character:GetChildren() do
if v:IsA("Accessory") and v.Name:lower() == args[2]:lower() then
v:Destroy()
end
end
end
end
};
RemoveLayeredClothings = {
Prefix = Settings.Prefix;
Commands = {"removelayeredclothings"};
Args = {"player"};
Description = "Remvoes layered clothings from their HumanoidDescription.";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
for _, p in service.GetPlayers(plr, args[1]) do
local humanoid: Humanoid? = p.Character and p.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
local humanoidDesc: HumanoidDescription = humanoid:GetAppliedDescription()
local accessoryBlob = humanoidDesc:GetAccessories(false)
for i=#accessoryBlob, 1, -1 do -- backwards loop due to table.remove
local blobItem = accessoryBlob[i]
if blobItem.IsLayered then
table.remove(accessoryBlob, i)
end
end
humanoidDesc:SetAccessories(accessoryBlob, false)
humanoid:ApplyDescription(humanoidDesc, Enum.AssetTypeVerification.Always)
end
end
end
};
PrivateChat = {
Prefix = Settings.Prefix;
Commands = {"privatechat", "dm", "pchat"};
Args = {"player", "message (optional)"};
Filter = true;
Description = "Send a private message to a player";
AdminLevel = "Moderators";
Function = function(plr: Player, args: {string})
assert(args[1], "Missing player name")
local sessionName = service.HttpService:GenerateGUID(false) --// Used by the private chat windows
local newSession = Remote.NewSession("PrivateChat")
local history = {}
newSession.Data.History = history
local function getPeerList()
local peers = {}
for peer in newSession.Users do
table.insert(peers, {
Name = peer.Name;
DisplayName = peer.DisplayName;
UserId = peer.UserId;
--Instance = service.UnWrap(peer);
})
end
return peers
end
local function getFilteredHistory(player)
local canUsersDirectChatAsyncCache = {}
local newHistory = {}
for _, historyItem in history do
local canUsersChat = false
local newHistoryItem = {
Message = nil,
Sender = {
Name = historyItem.Sender.Name,
DisplayName = historyItem.Sender.DisplayName,
UserId = historyItem.Sender.UserId,
Icon = historyItem.Sender.Icon
}
}
if player.UserId == historyItem.Sender.UserId or historyItem.Sender.UserId == 0 then
canUsersChat = true