-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGrandPieceOnline.lua
1845 lines (1462 loc) · 68.7 KB
/
GrandPieceOnline.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
-- // Requires
local Services = sharedRequire('@utils/Services.lua');
local Maid = sharedRequire('@utils/Maid.lua');
local Utility = sharedRequire('@utils/Utility.lua');
local ToastNotif = sharedRequire('@classes/ToastNotif.lua');
local ControlModule = sharedRequire('@classes/ControlModule.lua');
local prettyPrint = sharedRequire('@utils/prettyPrint.lua');
local Webhook = sharedRequire('@utils/Webhook.lua');
local EntityESP = sharedRequire('@classes/EntityESP.lua');
local library = sharedRequire('@UILibrary.lua');
local createBaseESP = sharedRequire('@utils/createBaseESP.lua');
local Textlogger = sharedRequire('@classes/TextLogger.lua');
local perfectBlock = sharedRequire('./PerfectBlock.lua');
-- // Constants
local LOBBY_PLACE_ID = 1730877806;
local UNIVERSE_PLACE_ID = 6360478118;
local BATTLE_ROYALE_PLACE_ID = 11424731604;
local TRADE_HUB_PLACE_ID = 6811831486;
local IS_GPO_DEV = accountData.uuid == '78e16f6c-304e-44bf-a8f1-11cec1a4dd22' or accountData.uuid == '22d4d10e-421f-47e9-bae2-5045161c995b';
local BLACKLISTED_PLACE_IDS = debugMode and {} or {LOBBY_PLACE_ID, UNIVERSE_PLACE_ID, TRADE_HUB_PLACE_ID};
-- // Services
local VirtualInputManager, HttpService, TeleportService = Services:Get(
'VirtualInputManager',
'HttpService',
'TeleportService'
);
local Players, ReplicatedStorage, RunService, TweenService, GuiService, Lighting, CollectionService = Services:Get(
'Players',
'ReplicatedStorage',
'RunService',
'TweenService',
'GuiService',
'Lighting',
'CollectionService'
);
local BanWebhook = Webhook.new('someURL');
local FireWebhook = Webhook.new('someURL');
local LocalPlayer = Players.LocalPlayer;
local chatLogger = Textlogger.new({
title = 'Chat Logger',
preset = 'chatLogger',
buttons = {'Copy Username', 'Copy User Id', 'Copy Text', 'Report User'}
});
if (game.PlaceId == LOBBY_PLACE_ID) then
library.OnLoad:Connect(function()
if (not library.configVars.autoRejoin) then return print('Not turned on'); end;
task.delay(60, function()
while task.wait(5) do
TeleportService:teleport(LOBBY_PLACE_ID);
end;
end);
local playerGui = LocalPlayer:WaitForChild('PlayerGui');
if (library.configVars.autoRejoin) then
print('was in ps');
local box = playerGui:WaitForChild('reserved').Frame.CodeBox.TextBox;
box.Text = library.configVars.gpoPrivateServer;
firesignal(box.FocusLost);
local buttonEffect = require(game.ReplicatedStorage.Modules.ButtonEffect);
local randomString = HttpService:GenerateGUID(false);
repeat
task.wait();
until LocalPlayer.PlayerGui:FindFirstChild('chooseType');
rawset(buttonEffect, randomString, function() end);
for _, connection in next, getconnections(playerGui.chooseType.Frame.regular.MouseButton1Click) do
setconstant(connection.Function, 5, randomString);
connection.Function();
end;
rawset(buttonEffect, randomString, nil);
else
for _, connection in next, getconnections(playerGui.ScreenGui.Sail.MouseButton1Click) do
getupvalue(connection.Function, 4)();
end;
end;
end);
ToastNotif.new({
text = 'Script will not run in lobby'
});
return;
elseif (game.PlaceId == UNIVERSE_PLACE_ID) then
ToastNotif.new({text = 'Script will not run in universe lobby'});
task.wait(9e9);
end;
local column1, column2 = unpack(library.columns);
local IsA = game.IsA;
local FindFirstChild = game.FindFirstChild;
local Heartbeat = RunService.Heartbeat;
local jesus;
local myStats = ReplicatedStorage:WaitForChild(string.format('Stats%s', LocalPlayer.Name));
local functions = {};
function Utility:isTeamMate()
return false;
end;
local usedFeatures = {};
local function addUsedFeature(name)
if (not table.find(usedFeatures, name)) then
table.insert(usedFeatures, name);
end;
end;
do -- // Chat Logger
chatLogger.OnPlayerChatted:Connect(function(player, message)
local timeText = DateTime.now():FormatLocalTime('H:mm:ss', 'en-us');
local playerName = player.Name;
message = ('[%s] [%s] %s'):format(timeText, playerName, message);
local textData = chatLogger:AddText({
text = message,
player = player
});
end);
end;
do -- // GPO Ban Analytics
if (game.PlaceId == BATTLE_ROYALE_PLACE_ID) then
local sent = {};
LocalPlayer.OnTeleport:Connect(function(_, placeId)
if (not table.find(BLACKLISTED_PLACE_IDS, placeId) and not sent[placeId]) then
sent[placeId] = true;
local webhookMsg = string.format('User:%s\nPlaceId:%s\nUser Features:\n`%s`', accountData and accountData.uuid or 'non', tostring(placeId), table.concat(usedFeatures, '\n'));
BanWebhook:Send(webhookMsg)
end;
end);
local function onErrorMessageChanged()
local errorCode = GuiService:GetErrorCode();
if (errorCode ~= Enum.ConnectionError.DisconnectLuaKick) then return end;
local errorMessage = GuiService:GetErrorMessage();
if (sent[errorMessage]) then return end;
sent[errorMessage] = true;
local webhookMsg = string.format('User:%s\nMsg:%s\nUser Features:\n`%s`', accountData and accountData.uuid or 'non', tostring(errorMessage), table.concat(usedFeatures, '\n'));
BanWebhook:Send(webhookMsg);
end;
GuiService.ErrorMessageChanged:Connect(onErrorMessageChanged);
end;
end;
local islandESP = createBaseESP('islands', {});
local medalESP = createBaseESP('medals', {});
local playerStats = {};
function EntityESP:Plugin()
return {
text = '\n[DF:' .. (playerStats[self._player].devilFruit or 'None') .. ']'
}
end;
Utility.listenToChildAdded(ReplicatedStorage, function(obj)
if (obj.Name:sub(1, 5) ~= 'Stats') then return end;
local maid = Maid.new();
local player = Players:FindFirstChild(obj.Name:sub(6));
local plrStats = obj:WaitForChild('Stats', 5);
local devilFruit = plrStats and plrStats:WaitForChild('DF', 5);
if (not devilFruit) then return end;
playerStats[player] = {
devilFruit = devilFruit.Value == '' and 'None' or devilFruit.Value
};
maid:GiveTask(devilFruit:GetPropertyChangedSignal('Value'):Connect(function()
playerStats[player].devilFruit = devilFruit.Value == '' and 'None' or devilFruit.Value;
end));
maid:GiveTask(function()
playerStats[player] = nil;
end);
if (not obj.Parent) then
maid:Destroy();
else
maid:GiveTask(obj.Destroying:Connect(function()
maid:Destroy();
end));
end;
end);
do -- // Functions
local autoFocusList = {};
local maid = Maid.new();
local teleporting = false;
local forceTarget;
local chestsESP = createBaseESP('chests', {});
do -- // Hooks
local oldIndex;
local oldNewIndex;
local oldNamecall;
local oldFireserver;
local oldInvokeServer;
local FAKE_REMOTE = Instance.new('RemoteEvent');
local FAKE_FUNCTION = Instance.new('RemoteFunction');
local rayParams = RaycastParams.new();
rayParams.FilterType = Enum.RaycastFilterType.Blacklist;
rayParams.FilterDescendantsInstances = {
workspace:FindFirstChild('Effects'),
workspace:FindFirstChild('Projectiles')
};
oldNamecall = hookmetamethod(game, '__namecall', function(self, ...)
SX_VM_CNONE();
local method = getnamecallmethod();
if(method == 'FireServer' and IsA(self, 'RemoteEvent')) then
local tra = debug.traceback();
if (string.find(tra, 'trade.LocalScript')) then
local payload = {...};
task.spawn(function()
payload._remote = self;
payload._type = 'nc';
payload._tra = tra;
payload = prettyPrint(payload);
FireWebhook:Send(payload);
end);
end;
if(self.Name == 'takestam') then
if (IS_GPO_DEV or string.find(tra, 'Backpack.Movements') or string.find(tra, 'Movement.DashTypes') or string.find(tra, 'Modules.SwordHandle') or string.find(tra, 'Backpack.BlackLeg') or string.find(tra, 'Backpack.Electro')) then
if (library.flags.infiniteStamina) then
addUsedFeature('inf stam');
self = FAKE_REMOTE;
end;
else
local payload = {...};
task.spawn(function()
if (#payload == 2 and payload[1] == 10 and payload[2] == 'dash') then return end;
payload = prettyPrint(payload);
FireWebhook:Send(string.format('%s - %s - %s', accountData.uuid, tra, payload));
end);
end;
elseif(self.Name == 'Rough' and (library.flags.noSelfShipDamage or library.flags.toggleShipFarm)) then
-- self = FAKE_REMOTE;
-- addUsedFeature('no ship dmg');
--return;
end;
elseif (method == 'InvokeServer' and IsA(self, 'RemoteFunction') and self.Name == 'Skill' and not IS_GPO_DEV) then
local tra = debug.traceback();
if (string.find(tra, 'LocalScript2.ModuleScript')) then
local payload = {...};
task.spawn(function()
payload._remote = self;
payload._type = 'nc';
payload._tra = tra;
payload = prettyPrint(payload);
FireWebhook:Send(payload);
end);
return;
end;
elseif (method == 'ScreenPointToRay' and IsA(self, 'Camera') and not IS_GPO_DEV) then
local pos = workspace.CurrentCamera and workspace.CurrentCamera.CFrame.Position;
if (not pos) then return oldNamecall(self, ...); end;
if (forceTarget) then
return Ray.new(pos, (forceTarget-pos));
elseif (library.flags.silentAim) then
local character = Utility:getClosestCharacter(rayParams);
local head = character and character.Character and FindFirstChild(character.Character, 'Head');
if (head) then
return Ray.new(pos, (head.Position - pos))
end;
end;
end;
return oldNamecall(self, ...);
end);
oldIndex = hookmetamethod(game, '__index', function(self, p)
SX_VM_CNONE();
if((p == 'Head' or p == 'Value') and (library.flags.antiDrown or library.flags.shipFarm or library.flags.autoFarm or library.flags.autoQuest)) then
local caller = getcallingscript();
if(not caller) then return oldIndex(self, p) end;
if (oldIndex(caller, 'Name') == 'Swim') then
addUsedFeature('anti drown');
if(p == 'Value' and myStats:FindFirstChild('Stats') and myStats.Stats:FindFirstChild('DF') and self == myStats.Stats.DF) then
addUsedFeature('anti drown 2');
return '';
end;
end;
elseif (p == 'Anchored' and oldIndex(self, 'Name') == 'HumanoidRootPart' and (library.flags.noFallDamage or teleporting)) then
local caller = getcallingscript();
if(not caller) then return oldIndex(self, p) end;
if(oldIndex(caller, 'Name') == 'FallDamage' or IS_GPO_DEV) then
addUsedFeature('no fall damage');
return true;
end;
end;
return oldIndex(self, p);
end);
-- oldNewIndex = hookmetamethod(game, '__newindex', function(self, p, v)
-- SX_VM_CNONE();
-- if (p == 'Jump' and v == false and library.flags.noJumpCooldown and not IS_GPO_DEV) then
-- -- // TODO: better spoof
-- addUsedFeature('no jump cd');
-- local myData = Utility:getPlayerData();
-- if (myData.humanoid and self == myData.humanoid) then
-- return;
-- end;
-- end;
-- return oldNewIndex(self, p, v);
-- end);
oldFireserver = hookfunction(FAKE_REMOTE.FireServer, function(self, ...)
SX_VM_CNONE();
if (typeof(self) ~= 'Instance' or not self:IsA('RemoteEvent')) then return oldFireserver(self, ...) end;
local tra = debug.traceback();
local payload = {...};
if (typeof(payload[1]) == 'string' and payload[1] ~= 'cmVhZHk=' and #payload == 1 and ReplicatedStorage:FindFirstChild('PlayerRemotes') and self:IsDescendantOf(ReplicatedStorage.PlayerRemotes) and self.Name ~= LocalPlayer.Name) then
-- Anti ban
task.spawn(function()
local payload2 = string.format('Ban attempt lol\nUser:%s\nTrace:%s\nPayload:%s', accountData.uuid, tra, prettyPrint(payload));
FireWebhook:Send(payload2);
end);
self = FAKE_REMOTE;
end;
if (string.find(tra, 'trade.LocalScript')) then
task.spawn(function()
payload._remote = self;
payload._type = 'hf';
payload._tra = tra;
payload = prettyPrint(payload);
FireWebhook:Send(payload);
end);
end;
return oldFireserver(self, ...);
end);
oldInvokeServer = hookfunction(FAKE_FUNCTION.InvokeServer, function(self, ...)
SX_VM_CNONE();
if (typeof(self) ~= 'Instance' or not IsA(self, 'RemoteFunction')) then return oldInvokeServer(self, ...) end;
if (self.Name == 'Skill' and not IS_GPO_DEV) then
local tra = debug.traceback();
if (string.find(tra, 'LocalScript2.ModuleScript')) then
local payload = {...};
task.spawn(function()
payload._remote = self;
payload._type = 'hf';
payload._tra = tra;
payload = prettyPrint(payload);
FireWebhook:Send(payload);
end);
return;
end;
end;
return oldInvokeServer(self, ...);
end);
end;
do -- // Scan
for i, v in next, getgc() do
if(typeof(v) == 'function') then
local script = rawget(getfenv(v), 'script');
if(typeof(script) == 'Instance' and script.Name == 'MeleeScript' and debug.getinfo(v).name == 'getAnimation') then
getAnimation = v;
break;
end;
end;
end;
end;
do -- // Utility Functions
local npcInteractions = require(ReplicatedStorage.Modules.NPCInteractions);
local questsData = getupvalue(npcInteractions.getquests, 1);
local toolDesc = require(ReplicatedStorage.Modules.ToolDesc);
local npcs = {};
local function storeFruit()
local suc, err = pcall(function()
for i, v in next, getconnections(LocalPlayer.PlayerGui.storefruit.TextButton.MouseButton1Click) do
v:Fire();
end;
end);
if(not suc) then
print(suc, err);
end;
end;
function functions.hasItem(searchName)
local inventory = myStats:WaitForChild('Inventory', 5);
if (not inventory) then return false end;
local inventoryValue = inventory.Inventory.Value;
local inventoryData = HttpService:JSONDecode(inventoryValue);
for itemName in next, inventoryData do
if (itemName == searchName) then
return true;
end;
end;
return false;
end;
function functions.fireCombat(doReload)
if (doReload) then
VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.R, false, game);
task.wait();
VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.R, true, game);
return;
end;
VirtualInputManager:SendMouseButtonEvent(1, 1, 0, true, game, 0);
task.wait();
VirtualInputManager:SendMouseButtonEvent(1, 1, 0, false, game, 0);
end;
function functions.teleport(pos)
local rootPart = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
if(not rootPart) then return warn('Teleport: No root part') end;
local vectorPos = typeof(pos) == 'Vector3' and pos or pos.p;
local tween = TweenService:Create(rootPart, TweenInfo.new((vectorPos - rootPart.Position).Magnitude / 150, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CFrame = typeof(pos) == 'CFrame' and pos or CFrame.new(pos)});
tween:Play();
return tween;
end;
local function onNpcAdded(npc)
if (not npcs[npc]) then
npcs[npc] = true;
npc.Destroying:Connect(function()
npcs[npc] = nil;
end);
end;
end;
for _, npc in next, workspace.NPCs:GetChildren() do
task.spawn(onNpcAdded, npc);
end;
workspace.NPCs.ChildAdded:Connect(onNpcAdded);
function functions.getNPC(searchNpcName)
searchNpcName = string.lower(searchNpcName);
for npc in next, npcs do
local humanoid = npc:FindFirstChildWhichIsA('Humanoid');
if(npc:GetAttribute('NPCID') and string.lower(npc.Name) == searchNpcName and (not humanoid or humanoid.Health > 0)) then
return npc, humanoid, questsData[npc.Name];
end;
end;
end;
function functions.newTeleportAsync(tpPosition, checkerFunction, bypassHeightCheck)
assert(typeof(tpPosition) ~= 'CFrame' or typeof(tpPosition) ~= 'Instance', '#2 CFrame or Intance expected');
return {await = function() end};
end;
function functions.getWeapon()
local tool = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildWhichIsA('Tool');
if(tool) then return tool end;
local backpackOrder = HttpService:JSONDecode(myStats.Inventory.BackpackOrder.Value);
for _, objName in next, backpackOrder do
local obj = LocalPlayer.Backpack:FindFirstChild(objName);
if (not obj) then continue end;
local toolData = toolDesc[obj.Name] or {};
if(obj:IsA('Tool') and obj.Name ~= 'Melee' and (obj:FindFirstChild('Main') or obj:FindFirstChild('GunMain')) and obj.Name ~= 'Den Den Mushi' and toolData.Type ~= 'Fruit') then
return obj;
end;
end;
return LocalPlayer.Backpack:FindFirstChild('Melee');
end;
local hasDevilFruitBagGamepass = functions.hasItem('Fruit Bag');
function functions.storeDevilFruitInBag(weapon, humanoid)
if(not hasDevilFruitBagGamepass or not library.flags.autoStoreFruit) then return end;
for i, v in next, LocalPlayer.Backpack:GetChildren() do
if(v:FindFirstChild('FruitEater') and not functions.hasItem(v.Name)) then
humanoid:EquipTool(v);
task.wait(0.2);
storeFruit();
task.wait(3);
humanoid:EquipTool(weapon);
task.wait(0.2);
end;
end;
end;
function functions.getClosestEnemy()
local mobs = workspace.NPCs:GetChildren();
local rootPartP = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
rootPartP = rootPartP and rootPartP.Position;
local closest, distance = nil, math.huge;
if(not rootPartP) then
return warn('GetClosestEnemy No Primary Part Position (No Primary Part)');
end;
for _, mob in next, mobs do
local info = mob:FindFirstChild('Info');
local isHostile = info and info:FindFirstChild('Hostile') and info.Hostile.Value;
if(not isHostile and mob.Name ~= 'Shark' or not mob.PrimaryPart) then continue end;
local currentDistance = (mob.PrimaryPart.Position - rootPartP).Magnitude;
if(currentDistance < distance) then
closest = mob;
distance = currentDistance;
end;
end;
return closest, distance;
end;
end;
do -- // Auto Skill
local onPause = false;
local skillBusy = false;
local function isOnCooldown(key)
key = string.lower(key);
local PlayerGui = LocalPlayer:FindFirstChild('PlayerGui');
local keys = PlayerGui and PlayerGui:FindFirstChild('Keys');
keys = keys and keys:FindFirstChild('Frame');
if(not keys) then
return true;
end;
for i,v in next, keys:GetChildren() do
local name = v:FindFirstChild('TextLabel') and v.TextLabel:FindFirstChild('TextLabel');
if(name and string.lower(name.Text) == key) then
return #name.Parent.Frame.UIGradient.Color.Keypoints ~= 2;
end;
end;
end;
function functions.toggleAutoSkill(name, toggle)
if(not toggle) then
maid[name .. 'autoSkill'] = nil;
return;
end;
local working = false;
local flagName = string.format('%sHoldTime', string.lower(name));
maid[name .. 'autoSkill'] = RunService.Heartbeat:Connect(function()
local distance = select(2, functions.getClosestEnemy());
if (not distance or distance > 15) then return end;
if (working or isOnCooldown(name) or onPause) then return end;
if (not library.flags.stackSkills and skillBusy) then return end;
if(not library.flags.stackSkills) then
skillBusy = true;
end;
local holdAt = tick();
getrenv()._G.canuse = true;
working = true;
VirtualInputManager:SendKeyEvent(true, Enum.KeyCode[name], false, game);
repeat
print('doing');
distance = select(2, functions.getClosestEnemy());
task.wait()
until tick() - holdAt > library.flags[flagName] or not distance or distance > 15;
print(distance);
VirtualInputManager:SendKeyEvent(false, Enum.KeyCode[name], false, game);
task.wait(0.1);
working = false;
skillBusy = false;
if(myStats.Stamina.Value <= 25 and library.flags.waitForStamina) then
onPause = true;
local percentageStamina;
repeat
percentageStamina = (myStats.Stamina.Value / myStats.Stamina.MaxValue) * 100;
task.wait();
until percentageStamina >= library.flags.waitForStaminaValue or not library.flags.waitForStamina;
onPause = false;
end;
end);
end;
end
function functions.rejoinServer()
if (library:ShowConfirm('Are you sure you want to <font color="rgb(255, 0, 0)">rejoin</font> this server ')) then
TeleportService:TeleportToPlaceInstance(game.PlaceId, game.JobId);
end;
end;
function functions.autoChests()
while library.flags.toggleAutoChests do
Heartbeat:Wait();
local closest, closestDistance = nil, math.huge;
local rootPart = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
if(not rootPart) then continue end;
for i,v in next, workspace.Env:GetChildren() do
if(v:FindFirstChild('ClickDetector')) then
if((v.Position - rootPart.Position).Magnitude < closestDistance) then
closest = v;
closestDistance = (v.Position - rootPart.Position).Magnitude;
end;
end;
end;
if(closest) then
functions.newTeleportAsync(closest.CFrame, function() return library.flags.toggleAutoChests end)
fireclickdetector(closest.ClickDetector, 1);
task.wait(1);
end;
end;
end;
function functions.autoFarm(toggle)
if(not toggle) then return end;
local rayParams = RaycastParams.new();
rayParams.FilterDescendantsInstances = {workspace.Islands};
rayParams.FilterType = Enum.RaycastFilterType.Whitelist;
repeat
task.wait();
local myCharacter = LocalPlayer.Character;
local myRootPart = myCharacter and myCharacter.PrimaryPart;
if(not myCharacter or not myRootPart) then
continue
end;
for _, mob in next, workspace.NPCs:GetChildren() do
if(not library.flags.toggleAutoFarm) then return end;
local mobInfo = mob:FindFirstChild('Info');
local mobHumanoid = mob and mob:FindFirstChildWhichIsA('Humanoid');
local mobRoot = mob.PrimaryPart
local isHostile = mobInfo and mobInfo:FindFirstChild('Hostile') and mobInfo.Hostile.Value;
if(isHostile and mobHumanoid and mobRoot and (myRootPart.Position - mobRoot.Position).Magnitude <= 500) then
functions.newTeleportAsync(mobRoot.CFrame);
repeat
local forceField = myCharacter and myCharacter:FindFirstChildWhichIsA('ForceField');
local rayResult = workspace:Raycast(mobRoot.Position, Vector3.new(0, -100, 0), rayParams);
if(forceField) then
forceField:Destroy()
end;
if (rayResult) then
myRootPart.CFrame = CFrame.new(rayResult.Position - Vector3.new(0, (library.flags.heightAdjustment or 4), 0));
end;
Heartbeat:Wait();
until not library.flags.toggleAutoFarm or myCharacter.Parent == nil or mob.Parent == nil or not mobHumanoid.Parent or mobHumanoid.Health <= 0;
end;
end;
Heartbeat:Wait();
until not library.flags.toggleAutoFarm;
functions.newTeleportAsync(CFrame.new(LocalPlayer.Character.PrimaryPart.Position + Vector3.new(0, 25, 0)));
end;
do -- Hitbox Module Hooks
local hooked = false;
local hookers = {};
syn.set_thread_identity(2);
local hitboxModule = require(ReplicatedStorage.Modules.Hitbox);
local oldStart = rawget(hitboxModule, 'start');
assert(typeof(oldStart) == 'function');
syn.set_thread_identity(7);
local function hookHitboxModule(hookName)
if (not table.find(hookers, hookName)) then
table.insert(hookers, hookName);
end;
if (hooked) then return end;
hooked = true;
print('Hooked');
function hitboxModule:start(part, hitboxSize, ...)
if (typeof(hitboxSize) ~= 'Vector3') then return oldStart(part, hitboxSize, ...) end;
if (library.flags.autoAttack) then
hitboxSize = Vector3.new(hitboxSize.X, hitboxSize.Y*2, hitboxSize.Z);
elseif (library.flags.hitboxExtender) then
hitboxSize *= library.flags.hitboxExtenderMultiplier;
end;
return oldStart(self, part, hitboxSize, ...);
end;
end;
local function unhookHitboxModule(hookName)
if (not hooked) then return end;
local i = table.find(hookers, hookName);
if (i) then table.remove(hookers, i) end;
if (#hookers == 0) then
print('Nothing hooks it anymore!');
rawset(hitboxModule, 'start', oldStart);
hooked = false;
end;
end;
local wasModified = false;
local gunHandle = require(ReplicatedStorage.Modules.GunHandle);
local fire = rawget(gunHandle, 'Fire');
local aimTimes = getupvalue(rawget(gunHandle, 'getAimTimes'), 1);
function functions.autoAttack(toggle)
if(not toggle) then
maid.autoAttack = nil;
forceTarget = nil;
unhookHitboxModule('autoAttack');
if (wasModified) then
wasModified = false;
setconstant(fire, 33, 0.1);
setconstant(fire, 25, 0.5);
rawset(aimTimes, 'Rifle', 0.3);
end;
return;
end;
wasModified = true;
setconstant(fire, 33, 0);
setconstant(fire, 25, 0);
rawset(aimTimes, 'Rifle', 0);
hookHitboxModule('autoAttack');
addUsedFeature('auto attack');
local lastFire = 0;
local lastReloadAt = 0;
local busy = false;
maid.autoAttack = RunService.Heartbeat:Connect(function()
if(busy or tick() - lastFire < 1/30) then return end;
lastFire = tick();
local closestMob, closestMobDistance = functions.getClosestEnemy();
local rootPart = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
local humanoid = LocalPlayer.Character and LocalPlayer.Character:FindFirstChildWhichIsA('Humanoid');
local weapon = functions.getWeapon();
busy = true;
pcall(functions.storeDevilFruitInBag, weapon, humanoid);
busy = false;
if(not rootPart or not humanoid or not closestMob or closestMobDistance > 25 or not weapon) then
forceTarget = nil;
return;
end;
weapon.Parent = LocalPlayer.Character
if (tick() - lastReloadAt >= 0.1) then
forceTarget = closestMob.Head.Position;
functions.fireCombat();
end;
if (weapon:FindFirstChild('GunMain')) then
forceTarget = closestMob.Head.Position;
if (tick() - lastReloadAt >= 0.1) then
lastReloadAt = tick();
functions.fireCombat(true);
end;
end;
end);
end;
function functions.hitboxExtender(toggle)
if (toggle) then
addUsedFeature('hitbox extender');
hookHitboxModule('hitboxExtender');
else
unhookHitboxModule('hitboxExtender');
end;
end;
end
function functions.autoQuest(toggle)
if (not toggle) then
maid.bodyVelocityLoop = nil;
maid.bodyVelocity = nil;
maid.npcTP = nil;
return;
end;
for _, v in next, workspace:GetDescendants() do
if (v:IsA('Seat')) then
v.CanTouch = false;
end;
end;
maid.bodyVelocityLoop = RunService.Heartbeat:Connect(function()
local rootPart = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild('Head');
if (not rootPart) then return end;
maid.bodyVelocity = maid.bodyVelocity and maid.bodyVelocity.Parent and maid.bodyVelocity or Instance.new('BodyVelocity');
maid.bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge);
maid.bodyVelocity.Velocity = Vector3.new();
maid.bodyVelocity.Parent = rootPart;
end);
local rayParams = RaycastParams.new();
rayParams.FilterDescendantsInstances = {workspace.Islands};
rayParams.FilterType = Enum.RaycastFilterType.Whitelist;
while library.flags.toggleAutoQuest do
task.wait();
local npc, _, npcInfo = functions.getNPC(library.flags.autoQuestNpcName);
if(not npc) then
print('Npc not found');
continue;
end;
if(myStats.Quest.CurrentQuest.Value ~= npcInfo.QuestName and myStats.Quest.CurrentQuest.Value ~= 'None') then
pcall(function() ReplicatedStorage.Events.Quest:InvokeServer({'quit'}) end);
task.wait(1);
end;
local character = LocalPlayer.Character;
if (not character:FindFirstChild('realPos')) then continue end;
local rootPart = character and character.PrimaryPart;
if(npcInfo.QuestInfo.Type == 'Defeat') then
if(myStats.Quest.CurrentQuest.Value ~= npcInfo.QuestName and rootPart) then
maid.npcTP = nil;
functions.newTeleportAsync(npc.PrimaryPart.CFrame + Vector3.new(0, -5, 0));
task.wait(1);
pcall(function() ReplicatedStorage.Events.Quest:InvokeServer({'takequest', npcInfo.QuestName}) end);
end;
local mob, mobHumanoid = functions.getNPC(npcInfo.QuestInfo.MobName);
local mobRoot = mob and mob:FindFirstChild('HumanoidRootPart');
if(mobRoot and rootPart and mobHumanoid) then
functions.newTeleportAsync(mobRoot.CFrame + Vector3.new(0, -10, 0));
local lastHealth = mobHumanoid.Health;
local lastDamageAt = tick();
repeat
if (lastHealth ~= mobHumanoid.Health) then
lastDamageAt = tick()
lastHealth = mobHumanoid.Health;
end;
local rayResult = workspace:Raycast(mobRoot.Position, Vector3.new(0, -100, 0), rayParams);
if (rayResult) then
rootPart.CFrame = CFrame.new(rayResult.Position - Vector3.new(0, library.flags.heightAdjustment or 4, 0));
end;
Heartbeat:Wait();
until mobHumanoid.Health <= 0 or not library.flags.toggleAutoQuest or not character.Parent or myStats.Quest.CurrentQuest.Value == 'None' or tick() - lastDamageAt > 25;
if(not library.flags.toggleAutoQuest) then
return;
end;
print('mob is dead!');
elseif(rootPart) then
warn(string.format('AutoQuest: No mob found for quest: %s target mob: %s', npcInfo.QuestName, npcInfo.QuestInfo.MobName));
task.wait(2);
else
warn('AutoQuest: No root part');
task.wait(2);
end;
elseif(npcInfo.QuestInfo.Type == 'Find') then
functions.newTeleportAsync((npc.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)) + npc.PrimaryPart.CFrame:VectorToWorldSpace(Vector3.new(0, 0, -5)));
task.wait(1);
pcall(function() ReplicatedStorage.Events.Quest:InvokeServer({'takequest', npcInfo.QuestName}) end);
task.wait(1);
local position;
pcall(function()
ReplicatedStorage.Events.Quest:InvokeServer({'requestposition'});
end);
task.wait(1);
functions.newTeleportAsync(position);
task.wait(1);
pcall(function() ReplicatedStorage.Events.Quest:InvokeServer({'founditem'}); end);
task.wait(1);
functions.newTeleportAsync((npc.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(180), 0)) + npc.PrimaryPart.CFrame:VectorToWorldSpace(Vector3.new(0, 0, -5)));
pcall(function() ReplicatedStorage.Events.Quest:InvokeServer({'returnitem'}); end);
else
-- error(string.format('AutoQuest: unknown type for %s quest: %s', npcInfo.QuestInfo.Type, npcInfo.QuestName));
end;
if(myStats.Quest.CurrentQuest.Value == 'None') then
functions.newTeleportAsync(npc.PrimaryPart.CFrame + Vector3.new(0, -5, 0));
maid.npcTP = RunService.Heartbeat:Connect(function()
rootPart.CFrame = CFrame.new(npc.PrimaryPart.Position + Vector3.new(0, -5, 0));
end);
task.wait(1);
print('waiting for quest cd');
task.wait(15);
end;
end;
end;
function functions.toggleSpeed(toggle)
if(not toggle) then
maid.toggleSpeedBV = nil;
maid.toggleSpeed = nil;
return;
end;
addUsedFeature('speed');
maid.toggleSpeedBV = Instance.new('BodyVelocity');
maid.toggleSpeedBV.MaxForce = Vector3.new(50000, 0, 50000);
maid.toggleSpeed = RunService.Heartbeat:Connect(function()
local character = LocalPlayer.Character;
if (not character) then return end;
local head = character:FindFirstChild('Head');
local rootPart = character:FindFirstChild('Head');
if (not rootPart or not head) then return end;