-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathVoxlBlade.lua
More file actions
1317 lines (1052 loc) · 45.5 KB
/
VoxlBlade.lua
File metadata and controls
1317 lines (1052 loc) · 45.5 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
local Utility = sharedRequire('@utils/Utility.lua');
local Maid = sharedRequire('@utils/Maid.lua');
local Services = sharedRequire('@Utils/Services.lua');
local ToastNotif = sharedRequire('@classes/ToastNotif.lua');
local basicsHelpers = sharedRequire('@utils/helpers/basics.lua');
local Webhook = sharedRequire('@utils/Webhook.lua');
local makeESP = sharedRequire('@utils/makeESP.lua');
local library = sharedRequire('@UILibrary.lua');
local column1, column2 = unpack(library.columns);
local mobfarmUtility = sharedRequire('@utils/helpers/mobfarm.lua');
local funcs = {};
local ReplicatedStorage, Players, RunService, MemStorageService, CollectionService, PathfindingService, TeleportService = Services:Get('ReplicatedStorage', 'Players', 'RunService', 'MemStorageService', 'CollectionService', 'PathfindingService', 'TeleportService');
local LocalPlayer = Players.LocalPlayer;
local allMobs = {};
local allCraft = {};
local allMobsDistances = {};
local allItemTypes = {};
local mobTypes = {'Crimson', 'Magical', 'Corrupt', 'Legendary', 'Bloody'};
local getNPCNameNonCorrupt;
local dungeonsData = require(ReplicatedStorage.Data.DungeonData);
local notifsQueue = {};
local addNotif, removeNotif;
local mobFarmLocationLabel;
local playerGui = LocalPlayer:WaitForChild('PlayerGui', math.huge);
local coreUI = playerGui:WaitForChild('Core', math.huge);
local loadingScreen = coreUI:WaitForChild('LoadingScreen', math.huge);
repeat
task.wait();
until not loadingScreen.Visible;
-- Funcs
do
local maid = Maid.new();
local NPCsFolder = workspace.NPCS;
local interactables = workspace.Interactables;
local others = workspace.Others;
local infusers = workspace.Infusers;
local events = ReplicatedStorage.Events;
local swingSword = events.SwingSword;
local equipWeapon = events.EquipWeapon;
local zonesFolder = ReplicatedStorage.MusicZone;
local weaponArt = events.WeaponArt;
local rune = events.Rune;
local dialogEffect = events.DialogEffect;
local craftItem = events.CraftItem;
local destroyItem = events.DestroyItem;
local startLobby = events.StartLobby;
local playGame = events.PlayGame;
local equipArmor = events.EquipArmor;
local swapSet = events.SwapSet;
local charHandler = require(LocalPlayer.PlayerScripts.Core.Controllers.CharHandler);
local craftData = require(ReplicatedStorage.Data.CraftingData);
local itemsData = require(ReplicatedStorage.Data.ItemData);
for name in next, craftData do
table.insert(allCraft,name);
end;
for _, itemData in next, itemsData do
if (not table.find(allItemTypes, itemData.Type)) then
table.insert(allItemTypes, itemData.Type);
end;
end;
table.sort(allCraft, function(a, b) return a < b; end);
table.sort(allItemTypes, function(a, b) return a < b; end);
local healNpcs = {};
local function isMobDead(mob)
if (not mob) then return false; end;
if (not library.flags.mobAutoFarm) then return true; end;
return not mob.Parent or mob:GetAttribute('Dead');
end;
local function getMobRoot(mob)
return mob;
end;
local function onNPCAdded(obj, espConstructor)
local npcName = obj:GetAttribute('NPCName');
if (not npcName) then return end;
if (obj:GetAttribute('AIType')) then return end; -- All NPCs and Mobs have a tag called NPC
espConstructor.new(obj, npcName, nil, true);
end;
local function onMobAdded(obj, espConstructor)
if (not obj:GetAttribute('AIType')) then return end;
local mobType = obj:GetAttribute('Type');
local mobName, corrupted = getNPCNameNonCorrupt(obj:GetAttribute('NPCAppearance'));
local notifData;
-- For whatever reason CName are corrupted but their Type is Basic
if (corrupted) then
mobType = 'Corrupt';
end;
if (mobType ~= 'Basic') then
mobName = string.format('%s(%s)', mobName, mobType);
notifData = { name = 'Variant', text = string.format('%s has spawned turn on the ESP to see it', mobName) }
addNotif(notifData);
end;
local esp = espConstructor.new(obj, {displayName = mobName, tag = mobType});
local con;
con = obj:GetPropertyChangedSignal('Parent'):Connect(function()
if (obj.Parent) then return end;
esp:Destroy();
con:Disconnect();
if (notifData) then
removeNotif(notifData);
end;
end);
if (mobName == 'IronSlayer') then
notifData = { name = 'Iron Slayer', text = string.format('%s has spawned turn on the ESP to see it', mobName) };
addNotif(notifData);
end;
end;
local function getNameOfArea(obj)
local nameOfArea;
if (obj.Name == '???') then
nameOfArea = 'Vampire Cave';
elseif (obj:FindFirstChild('Configs')) then
nameOfArea = obj.Configs.NameOfArea.Value;
elseif (obj:FindFirstChild('Linked')) then
return getNameOfArea(obj.Linked.Value);
end;
return nameOfArea;
end
local function onAreaAdded(obj, espConstructor)
local nameOfArea = getNameOfArea(obj);
if (not nameOfArea) then return; end;
espConstructor.new(obj, nameOfArea);
end;
local function onShopItemAdded(obj, espConstructor)
local shop = obj:FindFirstChild('Shop');
if (not shop or not shop:IsA('ProximityPrompt')) then return end;
espConstructor.new(obj, string.format('%s - %s$', obj:GetAttribute('Shop'), obj:GetAttribute('Cost')), nil, true);
end;
local function onDungeonAdded(obj, espConstructor)
if (not obj:FindFirstChild('Dungeon')) then return end;
espConstructor.new(obj, string.format('%s Dungeon', obj.Name:match('(.+)Dungeon')), nil, true);
end;
local function onInfuserAdded(obj, espConstructor)
espConstructor.new(obj:FindFirstChildWhichIsA('BasePart', true), obj.Name, nil, true);
end;
local function oncraftingStationAdded(obj, espConstructor)
espConstructor.new(obj, 'Crafting Station', nil, true);
end;
local function onShrineAdded(obj, espConstructor)
local primaryPart = obj.PrimaryPart;
if (not primaryPart) then return end;
espConstructor.new(primaryPart, obj.Name, nil, true);
end;
local function onRiftAdded(obj, espConstructor)
local union = obj:findFirstChild('Union');
if (not union) then return end;
local espObject;
local function onUnionTransparencyChanged()
if (union.Transparency == 1 and espObject) then
espObject:Destroy();
espObject = nil;
elseif (union.Transparency == 0) then
espObject = espConstructor.new(union, 'Rift', nil, true);
end;
end;
union:GetPropertyChangedSignal('Transparency'):Connect(onUnionTransparencyChanged);
onUnionTransparencyChanged();
end;
makeESP({
sectionName = 'NPCs',
type = 'tagAdded',
args = 'NPC',
callback = onNPCAdded
});
makeESP({
sectionName = 'Crafting Stations',
type = 'tagAdded',
args = 'Crafting',
callback = oncraftingStationAdded
});
makeESP({
sectionName = 'Shrines',
type = 'childAdded',
args = workspace.Shrines,
callback = onShrineAdded
});
makeESP({
sectionName = 'Areas',
type = 'childAdded',
args = zonesFolder,
callback = onAreaAdded
});
makeESP({
sectionName = 'Buyables',
type = 'childAdded',
args = interactables,
callback = onShopItemAdded
});
makeESP({
sectionName = 'Dungeons',
type = 'childAdded',
args = others,
callback = onDungeonAdded
});
makeESP({
sectionName = 'Infusers',
type = 'childAdded',
args = infusers,
callback = onInfuserAdded
});
makeESP({
sectionName = 'Rifts',
type = 'childAdded',
args = interactables,
callback = onRiftAdded
});
makeESP({
sectionName = 'Mobs',
type = 'tagAdded',
args = 'NPC',
callback = onMobAdded,
onLoaded = function(section)
local list = {};
section:AddToggle({
text = 'Show Health',
flag = 'Mobs Show Health'
});
for _, mobType in next, mobTypes do
table.insert(list, section:AddColor({
text = string.format('%s Mob Color', mobType),
flag = string.format('%s Color', mobType)
}));
end;
return {list = list};
end
});
do -- Grab Health NPCs
local dialogTable = require(LocalPlayer.PlayerScripts.Core.Controllers.DialogTable);
local function findDialogue(text)
local result = {};
for npcName, dialogData in next, dialogTable do
local textFunc = rawget(dialogData, 'Text');
if (typeof(textFunc) ~= 'function') then continue end;
for _, v2 in next, getconstants(textFunc) do
if (typeof(v2) == 'string' and v2:find(text)) then
table.insert(result, {
npcName = npcName,
choice = v2
});
break;
end;
end;
end;
return result;
end;
healNpcs = findDialogue('Heal %[');
end;
local lastFireAt = 0;
local forcedHeightAdjust = 0;
local explodingBombers = {};
local effectsData = {};
local isDungeon = false;
-- Used for Bomber NPCs cause they make you take damage when they explode
function effectsData.BomberGlow(effectData)
table.insert(explodingBombers, effectData.Target);
task.delay(10, function()
local exists = table.find(explodingBombers, effectData.Target);
if (not exists) then return end;
table.remove(explodingBombers, exists);
-- We would assume that after 10 sec the mob is dead
end);
end;
function effectsData.PlayAnimation(effectData)
table.foreach(effectData, warn);
if (effectData.Animation == 'Breath' and getNPCNameNonCorrupt(effectData.Target:GetAttribute('NPCName')) == 'Dragigator' and isDungeon and library.flags.mobAutoFarm) then
print('DRAGIGATOR???');
local heightAdjust = 15;
local rootPart = Utility:getPlayerData().rootPart;
if (rootPart.Position.Y >= 240) then
print('adjust higher');
-- If we are too high then we go down this is so we don't get kicked for being out of bounds
heightAdjust = -heightAdjust;
end;
-- We need to do this cause our character is sometimes rotated and sometimes not
print('go up');
task.wait(1);
rootPart.CFrame = CFrame.new(-49.80000305175781, 3, -1483.300048828125)
task.wait(1.5);
print('go down');
end;
end;
local blacklistedEffects = {'PlayAnimation', 'Punch', 'Damage', 'WindSlash', 'Notify', 'Alert', 'Death', 'Stun', 'HeavyPunch', 'Screenshake'};
library.unloadMaid:GiveTask(events.Effect.OnClientEvent:Connect(function(effectData)
if (effectData.Name and not table.find(blacklistedEffects, effectData.Name)) then
-- print('-------------');
-- table.foreach(effectData, warn);
end;
if (not effectData.Name or not effectsData[effectData.Name]) then return end;
effectsData[effectData.Name](effectData);
end));
local function doHealLogic(closestNpc, distance2)
local rootPart = Utility:getPlayerData().rootPart;
if (library.flags.autoHealUsePotion) then
-- If we find a potion use it instead
for itemId, item in next, charHandler.Inventory do
if (item.ItemName == 'ThrowableHealingPotion' or item.ItemName == 'HealthPotion') then
forcedHeightAdjust += 20;
rootPart.CFrame = CFrame.new(rootPart.CFrame.Position + Vector3.new(0, 20, 0)) * rootPart.CFrame.Rotation;
equipArmor:InvokeServer(itemId, false); -- 2nd arg true is for cosmetics
task.delay(1, function()
forcedHeightAdjust -= 20;
rootPart.CFrame = CFrame.new(rootPart.CFrame.Position + Vector3.new(0, -20, 0)) * rootPart.CFrame.Rotation;
end);
task.wait(1);
return true;
end;
end;
end;
-- If we find a NPC to Heal then go to it
if (closestNpc) then
mobfarmUtility:tweenTeleport(CFrame.new(closestNpc.Position));
if (distance2 <= 5) then
local humanoid = Utility:getPlayerData().humanoid;
if (not humanoid) then return true; end;
local lastHealth = humanoid.Health;
dialogEffect:FireServer(closestNpc, 'Heal');
local startedAt = tick();
repeat
task.wait();
until humanoid.Health ~= lastHealth or tick() - startedAt > 5;
end;
return true;
end;
end;
local function attackMob(rateLimit)
if (tick() - lastFireAt < (rateLimit or 0.05)) then return end;
if (not LocalPlayer:GetAttribute('EquippedSword')) then
equipWeapon:InvokeServer();
task.wait(0.5);
end;
lastFireAt = tick();
swingSword:FireServer(library.flags.useM2 and 'R' or 'L');
if (library.flags.useSkill) then
weaponArt:FireServer();
end;
if (library.flags.useRune) then
rune:FireServer();
end;
end;
local cachedPath;
local queenBeeSetup;
local lastCachedPathUpdateAt = 0;
local SHRINE_ACTIVE_COLOR = Color3.fromRGB(255, 0, 0);
local function beeDungeonLogic(dungeon, arena)
if (arena or not dungeon:FindFirstChild('Start')) then return end;
local prompts = CollectionService:GetTagged('Prompt');
local chest, chestDistance = mobfarmUtility:getClosest(prompts, {
getRoot = function(obj) return obj.Parent:IsA('BasePart') and obj.Parent end,
filter = function(obj) return obj.Name == 'HoneyChest' end,
isAlive = function(obj)
if (obj:GetAttribute('Cooldown')) then return false; end;
local rootPart = obj.Parent;
local top = rootPart.Parent:FindFirstChild('Top');
return top and rootPart and (rootPart.Position - top.Position).Magnitude < 3.5;
end,
});
if (chest) then
mobfarmUtility:tweenTeleport(CFrame.new(chest.Parent.Position + Vector3.new(0, 5, 0)), {
instant = true
});
if (chestDistance <= 20) then
fireproximityprompt(chest);
end;
return true;
end;
local endPart = dungeon:FindFirstChild('End');
if not endPart then
LocalPlayer:Kick("The maze was bugged, no end.");
TeleportService:Teleport(8651781069);
end;
-- We force path finding service to update path every 0.5s incase there was an issue
if (not cachedPath or tick() - lastCachedPathUpdateAt > 0.5) then
lastCachedPathUpdateAt = tick();
local START_POSITION = Vector3.new(14.394362449645996, 2.487703323364258, 8.34000015258789);
local path = PathfindingService:CreatePath();
print('Waiting for path to be completed');
for _, v in next, dungeon:GetChildren() do
if (v:FindFirstChild('DoorHitbox')) then
v.Door.CanCollide = false;
v.DoorHitbox.CanCollide = false;
end;
if (v:FindFirstChild('Fountain')) then
for i,v in next, v.Fountain:GetChildren() do
if not v:IsA("BasePart") then continue; end
v.CanCollide = false;
end;
end;
end;
for _, v in next, endPart.Hole:GetChildren() do
if (v:IsA('BasePart')) then
v.CanCollide = false; -- Fix the issue where Hole is blocking path finding service?
end;
end;
local ranSince = tick();
repeat
path:ComputeAsync(START_POSITION, endPart.Position + Vector3.new(0, 9, 0)); -- Fix the issue where endPart is too below ground?
print(path.Status);
until path.Status == Enum.PathStatus.Success or tick() - ranSince > 1;
cachedPath = path;
print('Got path');
end;
local npcs = CollectionService:GetTagged('NPC');
for _, waypoint in next, cachedPath:GetWaypoints() do
print(waypoint);
if (debugMode) then
local p = Instance.new("Part",workspace);
p.CanCollide = false;
p.Anchored = true;
p.Size = Vector3.new(1,1,1);
p.CFrame = CFrame.new(waypoint.Position);
end;
local doorNearby = mobfarmUtility:getClosest(npcs, {
filter = function(obj) return obj.Name == 'DoorHitbox' end,
getRoot = function(obj) return obj end,
rootOverride = waypoint,
maxDistance = 15
});
if (not doorNearby) then continue end;
local breakingStartedAt = tick();
repeat
if not library.flags.mobAutoFarm then break; end
mobfarmUtility:tweenTeleport(doorNearby.CFrame*CFrame.new( 8, 7, 0) * CFrame.Angles(0, math.rad(90),0), {
instant = true
});
attackMob(0.2);
task.wait();
until not doorNearby.Parent or tick() - breakingStartedAt > 8;
-- We believe path finding service Path is most likely broken so we'll recompute it
if (tick() - breakingStartedAt > 8) then
break;
end;
end;
if (library.flags.destroyShrines) then
while true do
local shrine = mobfarmUtility:getClosest(npcs, {
getRoot = function(obj) return obj; end,
filter = function(obj)
return obj.Parent and obj.Parent.Name == 'Shrine' and obj.Parent.Eyes.Color ~= SHRINE_ACTIVE_COLOR;
end
});
if (not shrine) then
warn('no shrine found!');
break;
end;
repeat
if not library.flags.mobAutoFarm then break; end
mobfarmUtility:tweenTeleport(CFrame.new(shrine.Position - Vector3.new(3, 0, 0), shrine.Position), {
instant = true
});
attackMob(0.2);
task.wait();
until shrine.Parent.Eyes.Color == SHRINE_ACTIVE_COLOR or not library.flags.dungeonAutoFarm;
end;
end;
if not library.flags.mobAutoFarm then return; end
mobfarmUtility:tweenTeleport(endPart.Position, {
instant = true
});
task.wait(5);
cachedPath = nil;
return true;
end;
function funcs.mobAutoFarm(toggle)
local placeId = game.PlaceId;
local isDungeonLocal, dungeonName = Utility.find(dungeonsData, function(v) return tonumber(v.ID) == placeId; end);
isDungeon = isDungeonLocal;
if (not toggle) then
maid.mobNoclip = nil;
mobfarmUtility.turnOffAutoFarm();
local humanoid = Utility:getPlayerData().humanoid;
if not humanoid then return; end
humanoid.JumpPower = 50;
return;
end;
maid.mobNoclip = RunService.Stepped:Connect(function()
local playerData = Utility:getPlayerData();
local humanoid = playerData.humanoid;
local rootPart = playerData.rootPart;
if (not humanoid or not rootPart) then return end;
-- This is required cause spamming jump make you fall to the ground with noclip
rootPart.AssemblyLinearVelocity = Vector3.new(0, 0.95, 0);
for _, part in next, playerData.parts do
part.CanCollide = false;
end;
humanoid:ChangeState('Jumping');
humanoid.JumpPower = 0;
end);
local lastMobSpawnedAt = tick();
while true do
task.wait();
if (not library.flags.mobAutoFarm) then break end;
local useFixedZone = library.flags.useFixedZone;
local fixedZoneRange = library.flags.fixedZoneRange;
local fixedZonePosition = library.configVars.voxlbladeAutoFarmLocation;
fixedZonePosition = fixedZonePosition and Vector3.new(unpack(fixedZonePosition:split(',')));
local dungeon = isDungeon and workspace.Map:FindFirstChild('Dungeon');
local arena = workspace.Map:FindFirstChild('Arena');
-- Arena is the end of the Queen Bee Dungeon
local mob = mobfarmUtility:getClosest(NPCsFolder, {
getRoot = getMobRoot,
isAlive = function(obj) return not isMobDead(obj) end,
prioritize = function(obj)
if (isDungeon and getNPCNameNonCorrupt(obj:GetAttribute('NPCName')) == 'Dragigator') then
return true;
end;
end,
filter = function(mob)
-- If bee dungeon force mob auto farm to ONLY attack QueenBee
if (arena) then
local isQueenBee = getNPCNameNonCorrupt(mob:GetAttribute('NPCName')) == 'QueenBee';
if (isQueenBee and not queenBeeSetup) then
queenBeeSetup = true;
mob:GetAttributeChangedSignal('HP'):Connect(function()
if (mob:GetAttribute('HP') <= 0 and library.flags.infiniteDungeon) then
print('IT DIED');
task.wait(1);
LocalPlayer:Kick();
TeleportService:Teleport(8651781069);
print(game.Players.LocalPlayer:GetAttribute('BeeDungeonCD'));
end;
end);
end;
return isQueenBee;
end;
-- Filters should not run in Dungeons to prevent breaking it lol
if (isDungeon) then return true; end;
local filterPassed = false;
filterPassed = not library.flags.enableMobFilter or library.flags.mobFilter[mob:GetAttribute('NPCAppearance')];
filterPassed = filterPassed and (not library.flags.enableMobTypesFilter or library.flags.mobTypesFilter[mob:GetAttribute('Type')]);
if (useFixedZone) then
filterPassed = filterPassed and (mob.Position - fixedZonePosition).Magnitude <= fixedZoneRange;
end;
return filterPassed;
end
});
-- Dungeon Logic
if (isDungeon) then
if (dungeonName == 'BeeDungeon' and beeDungeonLogic(dungeon, arena)) then
continue;
end;
end;
if (mob) then
lastMobSpawnedAt = tick();
end;
-- If no mobs for 30 seconds and we have use fixed zone turned on and we are not in dungeon tp to the fixed zone position
if (tick() - lastMobSpawnedAt > 30 and library.flags.useFixedZone and fixedZonePosition and not isDungeon) then
mobfarmUtility:tweenTeleport(CFrame.new(fixedZonePosition));
continue;
end;
repeat
task.wait();
-- If we are not in a dungeon but dungeonAutoFarm is turned on do nothing
if (not isDungeon and library.flags.dungeonAutoFarm) then break; end;
if (not mob or not library.flags.mobAutoFarm) then break end;
local playerData = Utility:getPlayerData();
local rootPart, humanoid = playerData.rootPart, playerData.humanoid;
if (not rootPart or not humanoid) then continue end;
local distance = Utility:roundVector(mob.Position - rootPart.Position).Magnitude;
local mobName = getNPCNameNonCorrupt(mob:GetAttribute('NPCName'));
local shouldHeal = library.flags.autoHeal and (humanoid.Health / humanoid.MaxHealth) * 100 <= library.flags.autoHealPercentage;
if (shouldHeal) then
local closestNpc, distance2 = mobfarmUtility:getClosest(interactables, {
getRoot = getMobRoot,
filter = function(npc)
return Utility.find(healNpcs, function(v) return v.npcName == npc.Name end)
end
});
local dialogData = Utility.find(healNpcs, function(v) return v.npcName == closestNpc:GetAttribute('NPCName'); end);
local amountNeeded = dialogData and tonumber(dialogData.choice:match('%p(%d+)')) or 0;
if ((LocalPlayer:GetAttribute('Voxos') or 0) >= amountNeeded) then
doHealLogic(closestNpc, distance2);
continue;
end;
end;
local mobHeight = library.flags.useGlobalDistance and library.flags.globalDistance or library.flags[string.format('%sHeight', mobName:lower())] or 10;
mobHeight += forcedHeightAdjust;
mobfarmUtility:tweenTeleport(CFrame.new(mob.Position), {
offset = CFrame.new(0, mobHeight, 0) * CFrame.Angles(math.rad(-90), 0, 0),
instant = isDungeon
});
-- We round Vector it so it should work fine
if (distance <= 2.5) then
attackMob();
end;
until isMobDead(mob);
end;
end;
function funcs.noKnockback(toggle)
if (not toggle) then
maid.noKnockback = nil;
return;
end;
maid.noKnockback = RunService.Stepped:Connect(function()
local rootPart = Utility:getPlayerData().rootPart;
if (not rootPart or not rootPart:FindFirstChild('Knockback')) then return end;
rootPart.Knockback:Destroy();
end);
end;
local lastShown;
function funcs.mobDistances()
local mobSelected = library.flags.mobDistances;
if (lastShown) then
lastShown.main.Visible = false;
end;
lastShown = allMobsDistances[mobSelected];
lastShown.main.Visible = true;
end;
function funcs.itemCrafter()
local toCraft = library.flags.itemName;
local _, distance = mobfarmUtility:getClosest(interactables, {
filter = function(obj) return obj.Name == 'Crafting' end,
getRoot = function(obj) return obj end
});
if (distance >= 20) then
ToastNotif.new({text = 'You are too far away from a crafting table'});
return;
end;
for _ = 1, library.flags.craftAmount do
task.spawn(function()
craftItem:InvokeServer(toCraft);
end);
end;
end;
function funcs.autoSell()
local _, distance = mobfarmUtility:getClosest(interactables, {
filter = function(obj) return CollectionService:HasTag(obj, 'Shopkeeper') end,
getRoot = function(obj) return obj; end
});
if (distance >= 20) then
ToastNotif.new({text = 'You are too far away from a shop keeper.'});
return;
end;
local toSell = {};
local foundItems = false;
for i, item in next, charHandler.Inventory do
local itemData = itemsData[item.ItemName];
local isEnchanted = #item.Enchantments > 0;
if (isEnchanted and library.flags.doNotSellEnchantedItem) then continue end;
if (not library.flags.autoSellTypes[itemData.Type]) then continue end;
toSell[i] = item.Amount or 1;
foundItems = true;
end;
if (not foundItems) then return end;
destroyItem:InvokeServer(toSell);
end;
function funcs.setFixedZonePosition()
local rootPart = Utility:getPlayerData().rootPart;
if (not rootPart) then return end;
library.configVars.voxlbladeAutoFarmLocation = tostring(rootPart.Position);
mobFarmLocationLabel.Text = string.format('Position: %d,%d,%d', math.floor(rootPart.Position.X), math.floor(rootPart.Position.Y), math.floor(rootPart.Position.Z));
end;
local oldSet;
function funcs.setDataloss(t)
if (not oldSet) then
oldSet = LocalPlayer:GetAttribute('Set') or '1';
end;
originalFunctions.invokeServer(swapSet, t and string.char(128) or oldSet);
ToastNotif.new({
text = t and 'Dataloss set!' or 'Dataloss unset!'
});
end;
do -- Notifier Utils
local notifiersToUpdate = {};
function addNotif(data)
table.insert(notifsQueue, data);
for _, f in next, notifiersToUpdate do task.spawn(f); end;
end;
function removeNotif(data)
table.remove(notifsQueue, table.find(notifsQueue, data));
end;
function funcs.makeNotifier(name)
local toggled = false;
local function updateQueue()
if (not toggled) then return end;
for _, notifData in next, notifsQueue do
if (notifData.name ~= name) then continue; end;
ToastNotif.new({
text = notifData.text
});
table.remove(notifsQueue, table.find(notifsQueue, notifData));
end;
end;
table.insert(notifiersToUpdate, updateQueue);
return function (toggle)
toggled = toggle;
if (not toggle) then return end;
updateQueue();
end;
end;
library.OnLoad:Connect(function()
for _, f in next, notifiersToUpdate do task.spawn(f); end;
end);
end;
do -- Dungeon Auto Farm
local function canDoDungeon(dungeonName)
return ReplicatedStorage.Clock.Value > LocalPlayer:GetAttribute(dungeonName .. 'CD');
end;
function funcs.dungeonAutoFarm(toggle)
if (not toggle) then
mobfarmUtility.turnOffAutoFarm();
return;
end;
if (library.OnLoad) then
library.OnLoad:Wait(); -- Wait for library to be loaded to get actual dropdown value
end;
-- Grab dungeon data
local dungeonToFarm = library.flags.dungeonToFarm;
local dungeonData, dungeonName = Utility.find(dungeonsData, function(v) return v.TrueName == dungeonToFarm end);
local additionalMods = {};
-- If we are in a Dungeon do not run this code it's only used to start the dungeon
if (game.PlaceId == tonumber(dungeonData.ID)) then
return;
end;
local dungeonLocation = others:WaitForChild(dungeonName, 5);
if (not dungeonLocation) then return error('No dungeon found? ' .. dungeonToFarm); end;
-- Spawn in character
if (not LocalPlayer:GetAttribute('Loaded')) then
if (not MemStorageService:HasItem('Slot')) then
ToastNotif.new({
text = 'Please spawn in first!'
});
else
playGame:InvokeServer(MemStorageService:GetItem('Slot'));
end;
repeat task.wait(); until LocalPlayer:GetAttribute('Loaded');
end;
local rootPart;
repeat
rootPart = Utility:getPlayerData().rootPart;
task.wait();
until rootPart;
local distance = (rootPart.Position - dungeonLocation.Position).Magnitude;
if (distance > 20) then
ToastNotif.new({
text = 'Too far from dungeon. Teleporting to it'
});
rootPart.CFrame = CFrame.new(Utility:roundVector(rootPart.CFrame.Position) + Vector3.new(0, dungeonLocation.Position.Y + 2000, 0));
repeat
task.wait();
distance = Utility:roundVector(rootPart.Position - dungeonLocation.Position).Magnitude;
mobfarmUtility:tweenTeleport(CFrame.new(dungeonLocation.Position), {
tweenSpeedIgnoreY = true,
offset = CFrame.new(0, 2000, 0)
});
until distance <= 5 or not library.flags.dungeonAutoFarm;
end;
mobfarmUtility.destroyTweens();
-- User toggled if off we don't do anything
if (not library.flags.dungeonAutoFarm) then return end;
rootPart.CFrame = dungeonLocation.CFrame;
task.wait(1);
if (library.flags.doCorruptDungeon and not dungeonLocation:GetAttribute('Corrupted') and dungeonName == 'FroggDungeon') then
local bindedCorruption = Utility.find(charHandler.Inventory, function(v) return v.ItemName == 'BindedCorruption' end);
if (bindedCorruption and bindedCorruption.Amount > 0) then
-- TP to frogg status
local froggStatue = interactables.CorruptFroggShrine.FroggStatue;
local tween = mobfarmUtility:tweenTeleport(froggStatue.CFrame * CFrame.new(0, 0, 10));
tween.Completed:Wait();
dialogEffect:FireServer(froggStatue, 'SlotBinded');
task.wait(1);
mobfarmUtility:tweenTeleport(CFrame.new(dungeonLocation.Position));
end;
end;
if (dungeonLocation:GetAttribute('Corrupted')) then
table.insert(additionalMods, 'Corrupt');
end;
-- Wait for cooldown to go away or toggle to go off
if (not canDoDungeon(dungeonName) and library.flags.dungeonAutoFarm) then
ToastNotif.new({text = string.format('You are on cooldown for %s. The script will wait for the cooldown to finish.', dungeonToFarm)});
repeat task.wait(); until canDoDungeon(dungeonName) or not library.flags.dungeonAutoFarm;
end;
-- User toggled if off we don't do anything
if (not library.flags.dungeonAutoFarm) then return end;
MemStorageService:SetItem('DungeonFarmPlaceId', dungeonData.ID);
MemStorageService:SetItem('Slot', LocalPlayer.Slot.Value);
-- Start dungeon with specific options as Solo (2nd arg)
-- Need to be spammed cause roblox moment
while true do
if (not library.flags.dungeonAutoFarm) then return end;
originalFunctions.invokeServer(startLobby, {
Difficulty = library.flags.dungeonDifficulty,
DungeonType = dungeonName,
FriendsOnly = false,
DailyChallenge = false,
AdditionalMods = additionalMods,
Players = {
[LocalPlayer.Name] = LocalPlayer
}
}, true);
task.wait(5);
end;
end;
library.OnLoad:Connect(function()
if (not MemStorageService:HasItem('DungeonFarmPlaceId')) then return end;