-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fate Admin.lua
8392 lines (7517 loc) · 318 KB
/
Fate Admin.lua
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
--[[
fates admin - 8/2/2022
]]
local game = game
local GetService = game.GetService
if (not game.IsLoaded(game)) then
local Loaded = game.Loaded
Loaded.Wait(Loaded);
end
local _L = {}
_L.start = start or tick();
local Debug = true
do
local F_A = getgenv().F_A
if (F_A) then
local Notify, GetConfig = F_A.Utils.Notify, F_A.GetConfig
local UserInputService = GetService(game, "UserInputService");
local CommandBarPrefix = GetConfig().CommandBarPrefix
local StringKeyCode = UserInputService.GetStringForKeyCode(UserInputService, Enum.KeyCode[CommandBarPrefix]);
return Notify(nil, "Loaded", "fates admin is already loaded... use 'killscript' to kill", nil),
Notify(nil, "Your Prefix is", string.format("%s (%s)", StringKeyCode, CommandBarPrefix));
end
end
--IMPORT [var]
local Services = {
Workspace = GetService(game, "Workspace");
UserInputService = GetService(game, "UserInputService");
ReplicatedStorage = GetService(game, "ReplicatedStorage");
StarterPlayer = GetService(game, "StarterPlayer");
StarterPack = GetService(game, "StarterPack");
StarterGui = GetService(game, "StarterGui");
TeleportService = GetService(game, "TeleportService");
CoreGui = GetService(game, "CoreGui");
TweenService = GetService(game, "TweenService");
HttpService = GetService(game, "HttpService");
TextService = GetService(game, "TextService");
MarketplaceService = GetService(game, "MarketplaceService");
Chat = GetService(game, "Chat");
Teams = GetService(game, "Teams");
SoundService = GetService(game, "SoundService");
Lighting = GetService(game, "Lighting");
ScriptContext = GetService(game, "ScriptContext");
Stats = GetService(game, "Stats");
}
setmetatable(Services, {
__index = function(Table, Property)
local Ret, Service = pcall(GetService, game, Property);
if (Ret) then
Services[Property] = Service
return Service
end
return nil
end,
__mode = "v"
});
local GetChildren, GetDescendants = game.GetChildren, game.GetDescendants
local IsA = game.IsA
local FindFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, WaitForChild =
game.FindFirstChild,
game.FindFirstChildOfClass,
game.FindFirstChildWhichIsA,
game.WaitForChild
local GetPropertyChangedSignal, Changed =
game.GetPropertyChangedSignal,
game.Changed
local Destroy, Clone = game.Destroy, game.Clone
local Heartbeat, Stepped, RenderStepped;
do
local RunService = Services.RunService;
Heartbeat, Stepped, RenderStepped =
RunService.Heartbeat,
RunService.Stepped,
RunService.RenderStepped
end
local Players = Services.Players
local GetPlayers = Players.GetPlayers
local JSONEncode, JSONDecode, GenerateGUID =
Services.HttpService.JSONEncode,
Services.HttpService.JSONDecode,
Services.HttpService.GenerateGUID
local Camera = Services.Workspace.CurrentCamera
local Tfind, sort, concat, pack, unpack;
do
local table = table
Tfind, sort, concat, pack, unpack =
table.find,
table.sort,
table.concat,
table.pack,
table.unpack
end
local lower, upper, Sfind, split, sub, format, len, match, gmatch, gsub, byte;
do
local string = string
lower, upper, Sfind, split, sub, format, len, match, gmatch, gsub, byte =
string.lower,
string.upper,
string.find,
string.split,
string.sub,
string.format,
string.len,
string.match,
string.gmatch,
string.gsub,
string.byte
end
local random, floor, round, abs, atan, cos, sin, rad;
do
local math = math
random, floor, round, abs, atan, cos, sin, rad =
math.random,
math.floor,
math.round,
math.abs,
math.atan,
math.cos,
math.sin,
math.rad
end
local InstanceNew = Instance.new
local CFrameNew = CFrame.new
local Vector3New = Vector3.new
local Inverse, toObjectSpace, components
do
local CalledCFrameNew = CFrameNew();
Inverse = CalledCFrameNew.Inverse
toObjectSpace = CalledCFrameNew.toObjectSpace
components = CalledCFrameNew.components
end
local Connection = game.Loaded
local CWait = Connection.Wait
local CConnect = Connection.Connect
local Disconnect;
do
local CalledConnection = CConnect(Connection, function() end);
Disconnect = CalledConnection.Disconnect
end
local __H = InstanceNew("Humanoid");
local UnequipTools = __H.UnequipTools
local ChangeState = __H.ChangeState
local SetStateEnabled = __H.SetStateEnabled
local GetState = __H.GetState
local GetAccessories = __H.GetAccessories
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer.PlayerGui
local Mouse = LocalPlayer.GetMouse(LocalPlayer);
local CThread;
do
local wrap = coroutine.wrap
CThread = function(Func, ...)
if (type(Func) ~= 'function') then
return nil
end
local Varag = ...
return function()
local Success, Ret = pcall(wrap(Func, Varag));
if (Success) then
return Ret
end
if (Debug) then
warn("[FA Error]: " .. debug.traceback(Ret));
end
end
end
end
local startsWith = function(str, searchString, rawPos)
local pos = rawPos or 1
return searchString == "" and true or sub(str, pos, pos) == searchString
end
local trim = function(str)
return gsub(str, "^%s*(.-)%s*$", "%1");
end
local tbl_concat = function(...)
local new = {}
for i, v in next, {...} do
for i2, v2 in next, v do
new[i] = v2
end
end
return new
end
local indexOf = function(tbl, val)
if (type(tbl) == 'table') then
for i, v in next, tbl do
if (v == val) then
return i
end
end
end
end
local forEach = function(tbl, ret)
for i, v in next, tbl do
ret(i, v);
end
end
local filter = function(tbl, ret)
if (type(tbl) == 'table') then
local new = {}
for i, v in next, tbl do
if (ret(i, v)) then
new[#new + 1] = v
end
end
return new
end
end
local map = function(tbl, ret)
if (type(tbl) == 'table') then
local new = {}
for i, v in next, tbl do
local Value, Key = ret(i, v);
new[Key or #new + 1] = Value
end
return new
end
end
local deepsearch;
deepsearch = function(tbl, ret)
if (type(tbl) == 'table') then
for i, v in next, tbl do
if (type(v) == 'table') then
deepsearch(v, ret);
end
ret(i, v);
end
end
end
local deepsearchset;
deepsearchset = function(tbl, ret, value)
if (type(tbl) == 'table') then
local new = {}
for i, v in next, tbl do
new[i] = v
if (type(v) == 'table') then
new[i] = deepsearchset(v, ret, value);
end
if (ret(i, v)) then
new[i] = value(i, v);
end
end
return new
end
end
local flat = function(tbl)
if (type(tbl) == 'table') then
local new = {}
deepsearch(tbl, function(i, v)
if (type(v) ~= 'table') then
new[#new + 1] = v
end
end)
return new
end
end
local flatMap = function(tbl, ret)
if (type(tbl) == 'table') then
local new = flat(map(tbl, ret));
return new
end
end
local shift = function(tbl)
if (type(tbl) == 'table') then
local firstVal = tbl[1]
tbl = pack(unpack(tbl, 2, #tbl));
tbl.n = nil
return tbl
end
end
local keys = function(tbl)
if (type(tbl) == 'table') then
local new = {}
for i, v in next, tbl do
new[#new + 1] = i
end
return new
end
end
local function clone(toClone, shallow)
if (type(toClone) == 'function' and clonefunction) then
return clonefunction(toClone);
end
local new = {}
for i, v in pairs(toClone) do
if (type(v) == 'table' and not shallow) then
v = clone(v);
end
new[i] = v
end
return new
end
local setthreadidentity = setthreadidentity or syn_context_set or setthreadcontext
local getthreadidentity = getthreadidentity or syn_context_get or getthreadcontext
--END IMPORT [var]
local GetCharacter = GetCharacter or function(Plr)
return Plr and Plr.Character or LocalPlayer.Character
end
local Utils = {}
--IMPORT [extend]
local SocialService = game:GetService("SocialService")
local firetouchinterest, hookfunction, getconnections;
do
local GEnv = getgenv();
local touched = {}
firetouchinterest = GEnv.firetouchinterest or function(part1, part2, toggle)
if (part1 and part2) then
if (toggle == 0) then
touched[1] = part1.CFrame
part1.CFrame = part2.CFrame
else
part1.CFrame = touched[1]
touched[1] = nil
end
end
end
local newcclosure = newcclosure or function(f)
return f
end
hookfunction = GEnv.hookfunction or function(func, newfunc, applycclosure)
if (replaceclosure) then
replaceclosure(func, newfunc);
return func
end
func = applycclosure and newcclosure or newfunc
return func
end
local CachedConnections = setmetatable({}, {
__mode = "v"
});
getconnections = function(Connection, FromCache, AddOnConnect)
local getconnections = GEnv.getconnections
if (not getconnections) then
return {}
end
local CachedConnection;
for i, v in next, CachedConnections do
if (i == Connection) then
CachedConnection = v
break;
end
end
if (CachedConnection and FromCache) then
return CachedConnection
end
local Connections = GEnv.getconnections(Connection);
CachedConnections[Connection] = Connections
return Connections
end
end
local getrawmetatable = getrawmetatable or function()
return setmetatable({}, {});
end
local getnamecallmethod = getnamecallmethod or function()
return ""
end
local checkcaller = checkcaller or function()
return false
end
local Hooks = {
AntiKick = false,
AntiTeleport = false,
NoJumpCooldown = false,
}
local mt = getrawmetatable(game);
local OldMetaMethods = {}
setreadonly(mt, false);
for i, v in next, mt do
OldMetaMethods[i] = v
end
setreadonly(mt, true);
local MetaMethodHooks = {}
local ProtectInstance, SpoofInstance, SpoofProperty;
local UnSpoofInstance;
local ProtectedInstances = setmetatable({}, {
__mode = "v"
});
do
local SpoofedInstances = setmetatable({}, {
__mode = "v"
});
local SpoofedProperties = {}
Hooks.SpoofedProperties = SpoofedProperties
ProtectInstance = function(Instance_)
if (not Tfind(ProtectedInstances, Instance_)) then
ProtectedInstances[#ProtectedInstances + 1] = Instance_
end
end
SpoofInstance = function(Instance_, Instance2)
if (not SpoofedInstances[Instance_]) then
SpoofedInstances[Instance_] = Instance2 and Instance2 or Clone(Instance_);
end
end
UnSpoofInstance = function(Instance_)
if (SpoofedInstances[Instance_]) then
SpoofedInstances[Instance_] = nil
end
end
local ChangedSpoofedProperties = {}
SpoofProperty = function(Instance_, Property, NoClone)
if (SpoofedProperties[Instance_]) then
local SpoofedPropertiesForInstance = SpoofedProperties[Instance_]
local Properties = map(SpoofedPropertiesForInstance, function(i, v)
return v.Property
end)
if (not Tfind(Properties, Property)) then
SpoofedProperties[Instance_][#SpoofedPropertiesForInstance + 1] = {
SpoofedProperty = SpoofedPropertiesForInstance.SpoofedProperty,
Property = Property,
};
end
else
local Cloned;
if (not NoClone and IsA(Instance_, "Instance") and not Services[tostring(Instance_)] and Instance_.Archivable) then
local Success, Ret = pcall(Clone, Instance_);
if (Success) then
Cloned = Ret
end
end
SpoofedProperties[Instance_] = {{
SpoofedProperty = Cloned and Cloned or {[Property]=Instance_[Property]},
Property = Property,
}}
ChangedSpoofedProperties[Instance_] = {}
end
end
local GetAllParents = function(Instance_, NIV)
if (typeof(Instance_) == "Instance") then
local Parents = {}
local Current = NIV or Instance_
if (NIV) then
Parents[#Parents + 1] = Current
end
repeat
local Parent = Current.Parent
Parents[#Parents + 1] = Parent
Current = Parent
until not Current
return Parents
end
return {}
end
local Methods = {
"FindFirstChild",
"FindFirstChildWhichIsA",
"FindFirstChildOfClass",
"IsA"
}
MetaMethodHooks.Namecall = function(...)
local __Namecall = OldMetaMethods.__namecall;
local Args = {...}
local self = Args[1]
local Method = getnamecallmethod() or "";
if (Method ~= "") then
local Success = pcall(OldMetaMethods.__index, self, Method);
if (not Success) then
return __Namecall(...);
end
end
if (Hooks.AntiKick and lower(Method) == "kick") then
local Player, Message = self, Args[2]
if (Hooks.AntiKick and Player == LocalPlayer) then
local Notify = Utils.Notify
local Context;
if (setthreadidentity) then
Context = getthreadidentity();
setthreadidentity(3);
end
if (Notify and Context) then
Notify(nil, "Attempt to kick", format("attempt to kick %s", (Message and type(Message) == 'number' or type(Message) == 'string') and ": " .. Message or ""));
setthreadidentity(Context);
end
return
end
end
if (Hooks.AntiTeleport and Method == "Teleport" or Method == "TeleportToPlaceInstance") then
local Player, PlaceId = self, Args[2]
if (Hooks.AntiTeleport and Player == LocalPlayer) then
local Notify = Utils.Notify
local Context;
if (setthreadidentity) then
Context = getthreadidentity();
setthreadidentity(3);
end
if (Notify and Context) then
Notify(nil, "Attempt to teleport", format("attempt to teleport to place %s", PlaceId and PlaceId or ""));
setthreadidentity(Context);
end
return
end
end
if (checkcaller()) then
return __Namecall(...);
end
if (Tfind(Methods, Method)) then
local ReturnedInstance = __Namecall(...);
if (Tfind(ProtectedInstances, ReturnedInstance)) then
return Method == "IsA" and false or nil
end
end
if (lower(Method) == "getchildren" or lower(Method) == "getdescendants") then
return filter(__Namecall(...), function(i, v)
local Protected = false
for i2 = 1, #ProtectedInstances do
local ProtectedInstance = ProtectedInstances[i2]
local Success = pcall(tostring, ProtectedInstance)
Protected = ProtectedInstance == v or (Success and v.IsDescendantOf(v, ProtectedInstance));
if (Protected) then
break;
end
end
return not Protected
end)
end
if (Method == "GetFocusedTextBox") then
local Protected = false
for i = 1, #ProtectedInstances do
local ProtectedInstance = ProtectedInstances[i]
Protected = not Tfind(ProtectedInstances, FocusedTextBox) or FocusedTextBox.IsDescendantOf(FocusedTextBox, ProtectedInstance);
end
if (Protected) then
return nil
end
end
if (Hooks.NoJumpCooldown and Method == "GetState" or Method == "GetStateEnabled") then
local State = __Namecall(...);
if (Method == "GetState" and (State == Enum.HumanoidStateType.Jumping or State == "Jumping")) then
return Enum.HumanoidStateType.RunningNoPhysics
end
if (Method == "GetStateEnabled" and (self == Enum.HumanoidStateType.Jumping or self == "Jumping")) then
return false
end
end
return __Namecall(...);
end
local AllowedIndexes = {
"RootPart",
"Parent"
}
local AllowedNewIndexes = {
"Jump"
}
MetaMethodHooks.Index = function(...)
local __Index = OldMetaMethods.__index;
if (checkcaller()) then
return __Index(...);
end
local Instance_, Index = ...
local SanitisedIndex = Index
if (typeof(Instance_) == 'Instance' and type(Index) == 'string') then
SanitisedIndex = gsub(sub(Index, 0, 100), "%z.*", "");
end
local SpoofedInstance = SpoofedInstances[Instance_]
local SpoofedPropertiesForInstance = SpoofedProperties[Instance_]
if (SpoofedInstance) then
if (Tfind(AllowedIndexes, SanitisedIndex)) then
return __Index(Instance_, Index);
end
return __Index(SpoofedInstance, Index);
end
if (SpoofedPropertiesForInstance) then
for i, SpoofedProperty in next, SpoofedPropertiesForInstance do
local SanitisedIndex = gsub(SanitisedIndex, "^%l", upper);
if (SanitisedIndex == SpoofedProperty.Property) then
local ClientChangedData = ChangedSpoofedProperties[Instance_][SanitisedIndex]
local IndexedSpoofed = __Index(SpoofedProperty.SpoofedProperty, Index);
local Indexed = __Index(Instance_, Index);
if (ClientChangedData.Caller and ClientChangedData.Value ~= Indexed) then
OldMetaMethods.__newindex(SpoofedProperty.SpoofedProperty, Index, Indexed);
OldMetaMethods.__newindex(Instance_, Index, ClientChangedData.Value);
return Indexed
end
return IndexedSpoofed
end
end
end
if (Tfind(ProtectedInstances, __Index(...))) then
return nil
end
if (Tfind(ProtectedInstances, Instance_) and SanitisedIndex == "ClassName") then
return "Part"
end
if (Hooks.NoJumpCooldown and SanitisedIndex == "Jump") then
if (IsA(Instance_, "Humanoid")) then
return false
end
end
return __Index(...);
end
MetaMethodHooks.NewIndex = function(...)
local __NewIndex = OldMetaMethods.__newindex;
local __Index = OldMetaMethods.__index;
local Instance_, Index, Value = ...
local SpoofedInstance = SpoofedInstances[Instance_]
local SpoofedPropertiesForInstance = SpoofedProperties[Instance_]
if (checkcaller()) then
if (Index == "Parent" and Value) then
local ProtectedInstance
for i = 1, #ProtectedInstances do
local ProtectedInstance_ = ProtectedInstances[i]
if (Instance_ == ProtectedInstance_ or Instance_.IsDescendantOf(Value, ProtectedInstance_)) then
ProtectedInstance = true
end
end
if (ProtectedInstance) then
local Parents = GetAllParents(Instance_, Value);
for i, v in next, getconnections(Parents[1].ChildAdded, true) do
v.Disable(v);
end
for i = 1, #Parents do
local Parent = Parents[i]
for i2, v in next, getconnections(Parent.DescendantAdded, true) do
v.Disable(v);
end
end
local Ret = __NewIndex(...);
for i = 1, #Parents do
local Parent = Parents[i]
for i2, v in next, getconnections(Parent.DescendantAdded, true) do
v.Enable(v);
end
end
for i, v in next, getconnections(Parents[1].ChildAdded, true) do
v.Enable(v);
end
return Ret
end
end
if (SpoofedInstance or SpoofedPropertiesForInstance) then
if (SpoofedPropertiesForInstance) then
ChangedSpoofedProperties[Instance_][Index] = {
Caller = true,
BeforeValue = Instance_[Index],
Value = Value
}
end
local Connections = tbl_concat(
getconnections(GetPropertyChangedSignal(Instance_, SpoofedPropertiesForInstance and SpoofedPropertiesForInstance.Property or Index)),
getconnections(Instance_.Changed),
getconnections(game.ItemChanged)
)
if (not next(Connections)) then
return __NewIndex(Instance_, Index, Value);
end
for i, v in next, Connections do
v.Disable(v);
end
local Ret = __NewIndex(Instance_, Index, Value);
for i, v in next, Connections do
v.Enable(v);
end
return Ret
end
return __NewIndex(...);
end
local SanitisedIndex = Index
if (typeof(Instance_) == 'Instance' and type(Index) == 'string') then
SanitisedIndex = gsub(sub(Index, 0, 100), "%z.*", "");
end
if (SpoofedInstance) then
if (Tfind(AllowedNewIndexes, SanitisedIndex)) then
return __NewIndex(...);
end
return __NewIndex(SpoofedInstance, Index, __Index(SpoofedInstance, Index));
end
if (SpoofedPropertiesForInstance) then
for i, SpoofedProperty in next, SpoofedPropertiesForInstance do
if (SpoofedProperty.Property == SanitisedIndex and not Tfind(AllowedIndexes, SanitisedIndex)) then
ChangedSpoofedProperties[Instance_][SanitisedIndex] = {
Caller = false,
BeforeValue = Instance_[Index],
Value = Value
}
return __NewIndex(SpoofedProperty.SpoofedProperty, Index, Value);
end
end
end
return __NewIndex(...);
end
local hookmetamethod = hookmetamethod or function(metatable, metamethod, func)
setreadonly(metatable, false);
Old = hookfunction(metatable[metamethod], func, true);
setreadonly(metatable, true);
return Old
end
OldMetaMethods.__index = hookmetamethod(game, "__index", MetaMethodHooks.Index);
OldMetaMethods.__newindex = hookmetamethod(game, "__newindex", MetaMethodHooks.NewIndex);
OldMetaMethods.__namecall = hookmetamethod(game, "__namecall", MetaMethodHooks.Namecall);
end
Hooks.OldGetChildren = hookfunction(game.GetChildren, newcclosure(function(...)
if (not checkcaller()) then
local Children = Hooks.OldGetChildren(...);
return filter(Children, function(i, v)
return not Tfind(ProtectedInstances, v);
end)
end
return Hooks.OldGetChildren(...);
end));
Hooks.OldGetDescendants = hookfunction(game.GetDescendants, newcclosure(function(...)
if (not checkcaller()) then
local Descendants = Hooks.OldGetDescendants(...);
return filter(Descendants, function(i, v)
local Protected = false
for i2 = 1, #ProtectedInstances do
local ProtectedInstance = ProtectedInstances[i2]
Protected = v and ProtectedInstance == v or v.IsDescendantOf(v, ProtectedInstance)
if (Protected) then
break;
end
end
return not Protected
end)
end
return Hooks.OldGetDescendants(...);
end));
Hooks.FindFirstChild = hookfunction(game.FindFirstChild, newcclosure(function(...)
if (not checkcaller()) then
local ReturnedInstance = Hooks.FindFirstChild(...);
if (ReturnedInstance and Tfind(ProtectedInstances, ReturnedInstance)) then
return nil
end
end
return Hooks.FindFirstChild(...);
end));
Hooks.FindFirstChildOfClass = hookfunction(game.FindFirstChildOfClass, newcclosure(function(...)
if (not checkcaller()) then
local ReturnedInstance = Hooks.FindFirstChildOfClass(...);
if (ReturnedInstance and Tfind(ProtectedInstances, ReturnedInstance)) then
return nil
end
end
return Hooks.FindFirstChildOfClass(...);
end));
Hooks.FindFirstChildWhichIsA = hookfunction(game.FindFirstChildWhichIsA, newcclosure(function(...)
if (not checkcaller()) then
local ReturnedInstance = Hooks.FindFirstChildWhichIsA(...);
if (ReturnedInstance and Tfind(ProtectedInstances, ReturnedInstance)) then
return nil
end
end
return Hooks.FindFirstChildWhichIsA(...);
end));
Hooks.IsA = hookfunction(game.IsA, newcclosure(function(...)
if (not checkcaller()) then
local Args = {...}
local IsACheck = Args[1]
if (IsACheck) then
local ProtectedInstance = Tfind(ProtectedInstances, IsACheck);
if (ProtectedInstance and Args[2]) then
return false
end
end
end
return Hooks.IsA(...);
end));
local UndetectedCmdBar;
Hooks.OldGetFocusedTextBox = hookfunction(Services.UserInputService.GetFocusedTextBox, newcclosure(function(...)
if (not checkcaller() and UndetectedCmdBar) then
local FocusedTextBox = Hooks.OldGetFocusedTextBox(...);
local Protected = false
for i = 1, #ProtectedInstances do
local ProtectedInstance = ProtectedInstances[i]
Protected = not Tfind(ProtectedInstances, FocusedTextBox) or FocusedTextBox.IsDescendantOf(FocusedTextBox, ProtectedInstance);
end
if (Protected) then
return nil
end
end
return Hooks.OldGetFocusedTextBox(...);
end));
Hooks.OldKick = hookfunction(LocalPlayer.Kick, newcclosure(function(...)
local Player, Message = ...
if (Hooks.AntiKick and Player == LocalPlayer) then
local Notify = Utils.Notify
local Context;
if (setthreadidentity) then
Context = getthreadidentity();
setthreadidentity(3);
end
if (Notify and Context) then
Notify(nil, "Attempt to kick", format("attempt to kick %s", (Message and type(Message) == 'number' or type(Message) == 'string') and ": " .. Message or ""));
setthreadidentity(Context)
end
return
end
return Hooks.OldKick(...);
end))
Hooks.OldTeleportToPlaceInstance = hookfunction(Services.TeleportService.TeleportToPlaceInstance, newcclosure(function(...)
local Player, PlaceId = ...
if (Hooks.AntiTeleport and Player == LocalPlayer) then
local Notify = Utils.Notify
local Context;
if (setthreadidentity) then
Context = getthreadidentity();
setthreadidentity(3);
end
if (Notify and Context) then
Notify(nil, "Attempt to teleport", format("attempt to teleport to place %s", PlaceId and PlaceId or ""));
setthreadidentity(Context)
end
return
end
return Hooks.OldTeleportToPlaceInstance(...);
end))
Hooks.OldTeleport = hookfunction(Services.TeleportService.Teleport, newcclosure(function(...)
local Player, PlaceId = ...
if (Hooks.AntiTeleport and Player == LocalPlayer) then
local Notify = Utils.Notify
local Context;
if (setthreadidentity) then
Context = getthreadidentity();
setthreadidentity(3);
end
if (Notify and Context) then
Notify(nil, "Attempt to teleport", format("attempt to teleport to place \"%s\"", PlaceId and PlaceId or ""));
setthreadidentity(Context);
end
return
end
return Hooks.OldTeleport(...);
end))
Hooks.GetState = hookfunction(GetState, function(...)
local Humanoid, State = ..., Hooks.GetState(...);
local Parent, Character = Humanoid.Parent, LocalPlayer.Character
if (Hooks.NoJumpCooldown and (State == Enum.HumanoidStateType.Jumping or State == "Jumping") and Parent and Character and Parent == Character) then
return Enum.HumanoidStateType.RunningNoPhysics
end
return State
end)
Hooks.GetStateEnabled = hookfunction(__H.GetStateEnabled, function(...)
local Humanoid, State = ...
local Ret = Hooks.GetStateEnabled(...);
local Parent, Character = Humanoid.Parent, LocalPlayer.Character
if (Hooks.NoJumpCooldown and (State == Enum.HumanoidStateType.Jumping or State == "Jumping") and Parent and Character and Parent == Character) then
return false
end
return Ret
end)
--END IMPORT [extend]
local GetRoot = function(Plr, Char)
local LCharacter = GetCharacter();
local Character = Char or GetCharacter(Plr);
return Plr and Character and (FindFirstChild(Character, "HumanoidRootPart") or FindFirstChild(Character, "Torso") or FindFirstChild(Character, "UpperTorso")) or LCharacter and (FindFirstChild(LCharacter, "HumanoidRootPart") or FindFirstChild(LCharacter, "Torso") or FindFirstChild(LCharacter, "UpperTorso"));
end
local GetHumanoid = function(Plr, Char)
local LCharacter = GetCharacter();
local Character = Char or GetCharacter(Plr);
return Plr and Character and FindFirstChildWhichIsA(Character, "Humanoid") or LCharacter and FindFirstChildWhichIsA(LCharacter, "Humanoid");
end
local GetMagnitude = function(Plr, Char)
local LRoot = GetRoot();
local Root = GetRoot(Plr, Char);
return Plr and Root and (Root.Position - LRoot.Position).magnitude or math.huge
end
local Settings = {
Prefix = "!",
CommandBarPrefix = "Semicolon",
ChatPrediction = false,
Macros = {},
Aliases = {},
}
local PluginSettings = {
PluginsEnabled = true,
PluginDebug = false,
DisabledPlugins = {
["PluginName"] = true
},
SafePlugins = false
}
local WriteConfig = function(Destroy)
local JSON = JSONEncode(Services.HttpService, Settings);
local PluginJSON = JSONEncode(Services.HttpService, PluginSettings);
if (isfolder("fates-admin") and Destroy) then
delfolder("fates-admin");
writefile("fates-admin/config.json", JSON);
writefile("fates/admin/pluings/plugin-conf.json", PluginJSON);
else
makefolder("fates-admin");
makefolder("fates-admin/plugins");
makefolder("fates-admin/chatlogs");
writefile("fates-admin/config.json", JSON);
writefile("fates-admin/plugins/plugin-conf.json", PluginJSON);
end
end
local GetConfig = function()
if (isfolder("fates-admin") and isfile("fates-admin/config.json")) then
return JSONDecode(Services.HttpService, readfile("fates-admin/config.json"));
else
WriteConfig();
return JSONDecode(Services.HttpService, readfile("fates-admin/config.json"));
end
end
local GetPluginConfig = function()
if (isfolder("fates-admin") and isfolder("fates-admin/plugins") and isfile("fates-admin/plugins/plugin-conf.json")) then
local JSON = JSONDecode(Services.HttpService, readfile("fates-admin/plugins/plugin-conf.json"));
return JSON