-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathBloxburg.lua
More file actions
1923 lines (1604 loc) · 74.2 KB
/
Copy pathBloxburg.lua
File metadata and controls
1923 lines (1604 loc) · 74.2 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 Services = sharedRequire('../utils/Services.lua');
local library = sharedRequire('../UILibrary.lua');
local Maid = sharedRequire('../utils/Maid.lua');
local prettyPrint = sharedRequire('../utils/prettyPrint.lua');
local column1, column2 = unpack(library.columns);
local Players, ReplicatedStorage, HttpService, PathfindingService, RunService, TweenService = Services:Get(
'Players',
'ReplicatedStorage',
'HttpService',
'PathfindingService',
'RunService',
'TweenService'
);
local LocalPlayer = Players.LocalPlayer;
local Heartbeat = RunService.Heartbeat;
do -- // Functions
local framework = require(ReplicatedStorage:WaitForChild('Framework'));
framework = getupvalue(framework, 3);
local modules;
local network;
local jobManager;
local guiHandler;
repeat
task.wait();
modules = framework.Modules;
if (not modules) then continue end;
network = framework.net;
if (not network) then continue end;
jobManager = modules.JobHandler;
if (not jobManager) then continue end;
guiHandler = modules.GUIHandler;
if (not guiHandler) then continue end;
until modules and network and jobManager and guiHandler;
local saveHouse;
local loadHouse;
if (not isfolder('Aztup Hub V3/Bloxburg Houses')) then
makefolder('Aztup Hub V3/Bloxburg Houses');
end;
hookfunction(getfenv(network.FireServer).i, function()
print('Ban attempt lel');
end);
-- if(not debugMode) then
guiHandler:AlertBox(
'If you encounter any bugs using the auto farm make sure you post them in the discord #bug-reports channel.In all case to not get banned make sure that you buy a car after you finished your shift and make sure that you dont farm overnight.\n\nWe are not responsible in any shape of form if you get banned!',
'Warning',
0.5
);
-- end;
function saveHouse(player)
local plot = workspace.Plots[string.format("Plot_%s", player.Name)];
local ground = plot.Ground;
local saveData = {};
saveData.Walls = {};
saveData.Paths = {};
saveData.Floors = {};
saveData.Roofs = {};
saveData.Pools = {};
saveData.Fences = {};
saveData.Ground = {};
saveData.Ground.Counters = {};
saveData.Ground.Objects = {};
saveData.Basements = {};
local objects = {};
local counters = {};
local function getRotation(object)
return tostring(plot.PrimaryPart.CFrame:ToObjectSpace(object));
--local rot = -math.atan2(object.lookVector.z, object.lookVector.x) - math.pi * 0.5;
--if(rot < 0) then
-- rot = 2 * math.pi + rot;
--end;
-- return rot;
end;
local function getFloor(position)
local currentFloor, currentFloorDistance = nil, math.huge;
for i, v in next, plot.House.Floor:GetChildren() do
if((v.Part.Position - position).Magnitude <= currentFloorDistance) then
currentFloor = v;
currentFloorDistance = (v.Part.Position - position).Magnitude;
end;
end;
return currentFloor;
end;
local function getPolePosition(pole)
pole = pole.Value;
if(pole.Parent:IsA('BasePart')) then
return pole.Parent.Position;
else
return pole.Parent.Value;
end;
return error('something went wrong!');
end;
for _, object in next, plot.House.Objects:GetChildren() do
local floor = getFloor(object.Position) or plot;
local objectData = {};
objectData.Name = object.Name;
objectData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(object);
objectData.Rot = getRotation(object.CFrame);
objectData.Position = tostring(ground.CFrame:PointToObjectSpace(object.Position));
if(not objects[floor]) then
objects[floor] = {};
end;
if(object:FindFirstChild('ItemHolder')) then
for _, item in next, object.ItemHolder:GetChildren() do
if(item:FindFirstChild('RailingSegment')) then
if(not objectData.Fences) then
objectData.Fences = {};
end;
local _, from = framework.Shared.FenceService:GetEdgePositions(item);
local offSetFrom = ground.CFrame:PointToObjectSpace(from);
local itemData = {};
itemData.Name = item.Name;
itemData.From = tostring(offSetFrom);
itemData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item);
itemData.Segment = item.RailingSegment.Value.Name;
table.insert(objectData.Fences, itemData);
else
if(not objectData.Items) then
objectData.Items = {};
end;
local itemData = {};
itemData.Name = item.Name;
itemData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item);
itemData.Rot = getRotation(item.CFrame);
itemData.Position = tostring(ground.CFrame:PointToObjectSpace(item.Position));
table.insert(objectData.Items, itemData);
end;
end;
end;
table.insert(objects[floor], objectData);
end;
for _, counter in next, plot.House.Counters:GetChildren() do
local floor = getFloor(counter.Position) or plot;
local counterData = {};
counterData.Name = counter.Name;
counterData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(counter);
counterData.Rot = getRotation(counter.CFrame);
counterData.Position = tostring(ground.CFrame:PointToObjectSpace(counter.Position));
if(not counters[floor]) then
counters[floor] = {};
end;
if(counter:FindFirstChild('ItemHolder')) then
for _, item in next, counter.ItemHolder:GetChildren() do
if(not counterData.Items) then
counterData.Items = {};
end;
local itemData = {};
itemData.Name = item.Name;
itemData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item);
itemData.Rot = getRotation(item.CFrame);
itemData.Position = tostring(ground.CFrame:PointToObjectSpace(item.Position));
table.insert(counterData.Items, itemData);
end;
end;
table.insert(counters[floor], counterData);
end;
for _, wall in next, plot.House.Walls:GetChildren() do
if(wall.Name ~= 'Poles') then
local offSetFrom, offSetTo = ground.CFrame:PointToObjectSpace(getPolePosition(wall.BPole)), ground.CFrame:PointToObjectSpace(getPolePosition(wall.FPole));
local wallData = {};
wallData.From = tostring(offSetFrom);
wallData.To = tostring(offSetTo);
wallData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(wall);
wallData.Items = {};
if(wall:FindFirstChild('ItemHolder')) then
for _, item in next, wall.ItemHolder:GetChildren() do
local itemData = {};
itemData.Name = item.Name;
itemData.Position = tostring(ground.CFrame:PointToObjectSpace(item.Position));
itemData.Side = item:FindFirstChild("SideValue") and item.SideValue.Value == -1 or nil;
itemData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item);
local itemConfig = framework.Items:GetItem(item.Name);
if(itemConfig.Type ~= 'Windows' and itemConfig.Type ~= 'Doors') then
itemData.Rot = getRotation(item.CFrame);
end;
if(item:FindFirstChild('ItemHolder')) then
itemData.Items = {};
for _, item2 in next, item.ItemHolder:GetChildren() do
local itemData2 = {};
itemData2.Name = item2.Name;
itemData2.Rot = getRotation(item2.CFrame);
itemData2.Position = tostring(ground.CFrame:PointToObjectSpace(item2.Position));
itemData2.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item2);
table.insert(itemData.Items, itemData2);
end;
end;
table.insert(wallData.Items, itemData);
end;
end;
table.insert(saveData.Walls, wallData);
end;
end;
for _, floor in next, plot.House.Floor:GetChildren() do
local floorData = {};
floorData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(floor);
floorData.Points = {};
floorData.Objects = objects[floor] or {};
floorData.Counters = counters[floor] or {};
for i, v in next, floor.PointData:GetChildren() do
table.insert(floorData.Points, tostring(v.Value));
end;
table.insert(saveData.Floors, floorData);
end;
for _, roof in next, plot.House.Roof:GetChildren() do
local roofData = {};
roofData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(roof);
roofData.Name = roof.Name;
roofData.Points = {};
roofData.Items = {};
for i, v in next, roof.PointData:GetChildren() do
table.insert(roofData.Points, tostring(v.Value));
end;
if(roof:FindFirstChild('ItemHolder')) then
for _, item in next, roof.ItemHolder:GetChildren() do
local itemData = {};
itemData.Name = item.Name;
itemData.Position = tostring(ground.CFrame:PointToObjectSpace(item.Position));
itemData.Rot = getRotation(item.CFrame);
itemData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item);
table.insert(roofData.Items, itemData);
end;
end;
table.insert(saveData.Roofs, roofData);
end;
for _, path in next, plot.House.Paths:GetChildren() do
if(path.Name ~= 'Poles') then
local offSetFrom, offSetTo = ground.CFrame:PointToObjectSpace(getPolePosition(path.BPole)), ground.CFrame:PointToObjectSpace(getPolePosition(path.FPole));
local floorData = {};
floorData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(path);
floorData.From = tostring(offSetFrom);
floorData.To = tostring(offSetTo);
table.insert(saveData.Paths, floorData);
end;
end;
for _, pool in next, plot.House.Pools:GetChildren() do
local poolData = {};
poolData.Position = tostring(ground.CFrame:ToObjectSpace(pool.HitBox.CFrame));
poolData.Size = tostring(Vector2.new(pool.HitBox.Size.X, pool.HitBox.Size.Z));
poolData.Type = pool.Name;
table.insert(saveData.Pools, poolData);
end;
for _, basement in next, plot.House.Basements:GetChildren() do
local basementData = {};
basementData.Position = tostring(ground.CFrame:ToObjectSpace(basement.HitBox.CFrame));
basementData.Size = tostring(Vector2.new(basement.HitBox.Size.X, basement.HitBox.Size.Z));
basementData.Type = basement.Name;
table.insert(saveData.Basements, basementData);
end;
for _, fence in next, plot.House.Fences:GetChildren() do
if(fence.Name ~= 'Poles') then
local to, from = framework.Shared.FenceService:GetEdgePositions(fence);
local offSetTo, offSetFrom = ground.CFrame:PointToObjectSpace(to), ground.CFrame:PointToObjectSpace(from);
local fenceData = {};
fenceData.To = tostring(offSetTo);
fenceData.From = tostring(offSetFrom);
fenceData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(fence);
fenceData.Name = fence.Name;
fenceData.Items = {};
if(fence:FindFirstChild('ItemHolder')) then
for _, item in next, fence.ItemHolder:GetChildren() do
local itemData = {};
itemData.AppearanceData = framework.Shared.ObjectService:GetAppearanceData(item);
itemData.Name = item.Name;
itemData.Rot = getRotation(item.CFrame);
itemData.Position = tostring(ground.CFrame:PointToObjectSpace(item.Position));
table.insert(fenceData.Items, itemData);
end;
end;
table.insert(saveData.Fences, fenceData);
end;
end;
if(objects[plot]) then
saveData.Ground.Objects = objects[plot];
end;
if(counters[plot]) then
saveData.Ground.Counters = counters[plot]
end;
local playerHouses = ReplicatedStorage.Stats[player.Name].Houses;
local playerHouse;
for _, v in next, ReplicatedStorage.Stats[player.Name].Houses:GetChildren() do
if(v.Value == playerHouses.Value) then
playerHouse = v;
end;
end;
saveData.totalValue = playerHouse.TotalValue.Value or 'Unknown';
saveData.bsValue = playerHouse.BSValue.Value or 'Unknown';
writefile(string.format('Aztup Hub V3/Bloxburg Houses/%s.json', player.Name), HttpService:JSONEncode(saveData))
end;
function loadHouse(houseData)
local myPlot = workspace.Plots['Plot_' .. Players.LocalPlayer.Name];
local myGround = myPlot.Ground;
local placements = 0;
local oldFramework = framework;
local streamRefTypes = {
'PlaceObject',
'PlaceWall',
'PlaceFloor',
'PlacePath',
'PlaceRoof'
};
local framework = {
net = setmetatable({
InvokeServer = function(self, data)
placements = placements + 1;
if(placements >= 4) then
placements = 0;
task.wait(3);
end;
local dataType = data.Type;
local returnData = {oldFramework.net:InvokeServer(data)};
if (table.find(streamRefTypes, dataType)) then
returnData[1] = typeof(returnData[1]) == 'Instance' and returnData[1].Value;
end;
return unpack(returnData);
end;
}, {__index = oldFramework.net});
};
local position = framework.net:InvokeServer({
Type = 'ToPlot',
Player = LocalPlayer;
});
LocalPlayer.Character:SetPrimaryPartCFrame(position);
framework.net:InvokeServer({
Type = 'EnterBuild',
Plot = myPlot
})
local function convertToVector3(vectorString)
return myGround.CFrame:PointToWorldSpace(Vector3.new(unpack(vectorString:split(','))));
end;
local function convertPoints(points)
local newPoints = {};
for i, v in next, points do
table.insert(newPoints, convertToVector3(v));
end;
return newPoints;
end;
local function convertRot(cf)
if(not cf) then
return;
end;
local newCf = myGround.CFrame:ToWorldSpace(CFrame.new(unpack(cf:split(','))));
local rot = -math.atan2(newCf.lookVector.z, newCf.lookVector.x) - math.pi * 0.5;
if(rot < 0) then
rot = 2 * math.pi + rot;
end;
return rot;
end
local count = 0;
local totalCount = 0;
for i, v in next, houseData do
if(typeof(v) == 'table') then
totalCount = totalCount + #v;
end;
end;
print('starting for', count);
for _, wallData in next, houseData.Walls do
local offSetFrom, offSetTo = convertToVector3(wallData.From), convertToVector3(wallData.To);
local wall = framework.net:InvokeServer({
Type = 'PlaceWall',
From = offSetFrom,
To = offSetTo
})
for _, itemData in next, wallData.Items do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData.Name,
TargetModel = wall,
Rot = convertRot(itemData.Rot),
Pos = convertToVector3(itemData.Position),
});
if(itemData.Items) then
for _, itemData2 in next, itemData.Items do
local item2 = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData2.Name,
TargetModel = item,
Rot = convertRot(itemData2.Rot),
Pos = convertToVector3(itemData2.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item2,
UseMaterials = true,
Data = itemData2.AppearanceData
})
end;
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = itemData.AppearanceData
})
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = wall,
UseMaterials = true,
Data = {wallData.AppearanceData[1], {}, {}, {}},
Side = 'R'
})
framework.net:InvokeServer({
Type = 'ColorObject',
Object = wall,
UseMaterials = true,
Data = {wallData.AppearanceData[2], {}, {}, {}},
Side = 'L'
})
end;
for _, floorData in next, houseData.Floors do
local floor = framework.net:InvokeServer({
Type = 'PlaceFloor',
Points = convertPoints(floorData.Points)
});
for _, itemData in next, floorData.Objects or {} do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData.Name,
TargetModel = floor,
Rot = convertRot(itemData.Rot),
Pos = convertToVector3(itemData.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = itemData.AppearanceData
})
if(itemData.Fences and item) then
for _, fenceData in next, itemData.Fences do
local fence = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = fenceData.Name,
Pos = convertToVector3(fenceData.From),
RailingSegment = item.ObjectModel.Railings[fenceData.Segment]
});
if(not fence and debugMode) then
warn(fence);
error('failed to place fence');
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = fence,
UseMaterials = true,
Data = fenceData.AppearanceData
})
end;
end;
if(itemData.Items) then
for _, itemData2 in next, itemData.Items do
local item2 = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData2.Name,
TargetModel = item,
Rot = convertRot(itemData2.Rot),
Pos = convertToVector3(itemData2.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item2,
UseMaterials = true,
Data = itemData2.AppearanceData
})
end;
end;
end;
for _, counterData in next, floorData.Counters or {} do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = counterData.Name,
TargetModel = floor,
Rot = convertRot(counterData.Rot),
Pos = convertToVector3(counterData.Position),
});
if(counterData.Items) then
for _, itemData in next, counterData.Items do
local item2 = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData.Name,
TargetModel = item,
Rot = convertRot(itemData.Rot),
Pos = convertToVector3(itemData.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item2,
UseMaterials = true,
Data = itemData.AppearanceData
})
end;
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = counterData.AppearanceData
})
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = floor,
UseMaterials = true,
Data = floorData.AppearanceData
})
end;
for _, pathData in next, houseData.Paths do
local path = framework.net:InvokeServer({
Type = 'PlacePath',
To = convertToVector3(pathData.To),
From = convertToVector3(pathData.From)
})
framework.net:InvokeServer({
Type = 'ColorObject',
Object = path,
UseMaterials = true,
Data = pathData.AppearanceData
})
end;
for _, roofData in next, houseData.Roofs do
local roof = framework.net:InvokeServer({
Type = 'PlaceRoof',
Points = convertPoints(roofData.Points),
Start = convertToVector3(roofData.Points[1]),
Settings = {
IsPreview = true,
Type = roofData.Name,
RotateNum = 0
}
});
for _, itemData in next, roofData.Items or {} do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData.Name,
TargetModel = roof,
Rot = convertRot(itemData.Rot),
Pos = convertToVector3(itemData.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = itemData.AppearanceData
})
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = roof,
UseMaterials = true,
Data = roofData.AppearanceData
})
end;
for _, poolData in next, houseData.Pools do
framework.net:InvokeServer({
Type = 'PlacePool',
Size = Vector2.new(unpack(poolData.Size:split(','))),
Center = CFrame.new(unpack(poolData.Position:split(','))),
ItemType = poolData.Type
});
count = count + 1;
end;
for _, basementData in next, houseData.Basements do
framework.net:InvokeServer({
Type = 'PlaceBasement',
ItemType = 'Basements',
Size = Vector2.new(unpack(basementData.Size:split(','))),
Center = CFrame.new(unpack(basementData.Position:split(','))) - Vector3.new(0, -12.49, 0)
});
end;
for _, fenceData in next, houseData.Fences do
local fence = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = fenceData.Name,
StartPos = convertToVector3(fenceData.From),
Pos = convertToVector3(fenceData.To),
ItemType = fenceData.Name
})
for _, itemData in next, fenceData.Items do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData.Name,
TargetModel = fence,
Rot = convertRot(itemData.Rot),
Pos = convertToVector3(itemData.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = itemData.AppearanceData
})
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = fence,
UseMaterials = true,
Data = fenceData.AppearanceData
})
end;
for _, groundItem in next, houseData.Ground.Objects do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = groundItem.Name,
TargetModel = myPlot.GroundParts.Ground,
Rot = convertRot(groundItem.Rot),
Pos = convertToVector3(groundItem.Position),
})
if(groundItem.Fences and item) then
for _, fenceData in next, groundItem.Fences do
local fence = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = fenceData.Name,
Pos = convertToVector3(fenceData.From),
RailingSegment = item.ObjectModel.Railings[fenceData.Segment]
})
framework.net:InvokeServer({
Type = 'ColorObject',
Object = fence,
UseMaterials = true,
Data = fenceData.AppearanceData
})
end;
end;
if(groundItem.Items) then
for _, itemData2 in next, groundItem.Items do
local item2 = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData2.Name,
TargetModel = item,
Rot = convertRot(itemData2.Rot),
Pos = convertToVector3(itemData2.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item2,
UseMaterials = true,
Data = itemData2.AppearanceData
})
end;
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = groundItem.AppearanceData
})
end;
for _, counterItem in next, houseData.Ground.Counters do
local item = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = counterItem.Name,
Pos = convertToVector3(counterItem.Position),
Rot = convertRot(counterItem.Rot),
TargetModel = myPlot.GroundParts.Ground,
})
if(counterItem.Items) then
for _, itemData in next, counterItem.Items do
local item2 = framework.net:InvokeServer({
Type = 'PlaceObject',
Name = itemData.Name,
TargetModel = item,
Rot = convertRot(itemData.Rot),
Pos = convertToVector3(itemData.Position),
});
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item2,
UseMaterials = true,
Data = itemData.AppearanceData
})
end;
end;
framework.net:InvokeServer({
Type = 'ColorObject',
Object = item,
UseMaterials = true,
Data = counterItem.AppearanceData
})
end;
framework.net:FireServer({
Type = 'ExitBuild'
});
end;
do -- // Remote Spy
local oldFireServer = network.FireServer;
local blacklistedTypes = {'LookDir', 'GetServerTime', 'CheckOwnsAsset', 'VehicleUpdate'};
oldFireServer = hookfunction(network.FireServer, function(self, data, ...)
if (data.Type == 'EndShift' and library.flags.pizzaDelivery) then return end;
if (not table.find(blacklistedTypes, data.Type)) then
print(prettyPrint({
data = data,
traceback = debug.traceback()
}));
end;
return pcall(oldFireServer, self, data, ...);
end);
local oldInvokeServer = network.InvokeServer;
oldInvokeServer = hookfunction(network.InvokeServer, function(self, data, ...)
local fireType = data.Type;
local returnData = {select(2, pcall(oldInvokeServer, self, data, ...))};
if (not table.find(blacklistedTypes, fireType)) then
print(prettyPrint({
returnData = returnData,
data = data,
type = fireType,
traceback = debug.traceback()
}))
end;
return unpack(returnData);
end);
end;
local function findCurrentWorkstation(workStations, justFindIt)
local closestDistance, currentWorkstation = math.huge, nil;
local rootPart = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
if(not rootPart) then
return
end;
for i, v in next, workStations:GetChildren() do
local distance = (rootPart.Position - v.PrimaryPart.Position).Magnitude;
if(distance <= closestDistance and (v.InUse.Value == nil or v.InUse.Value == LocalPlayer)) then
closestDistance, currentWorkstation = distance, v;
end;
end;
return currentWorkstation;
end;
local function findCurrentWorkstationBens(workStations)
for i,v in next, workStations:GetChildren() do
local customer = v.Occupied.Value;
if(customer and customer.Order.Value == '') then
return v;
end;
end;
end
local function tweenTeleport(position)
local rootPart = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
if(not rootPart) then
return warn('no root part for tween tp :/');
end;
local path = PathfindingService:CreatePath();
path:ComputeAsync(rootPart.Position, position);
local waypoints = path:GetWaypoints();
local cfValue = Instance.new('CFrameValue');
local connection;
cfValue.Value = rootPart.CFrame;
connection = cfValue:GetPropertyChangedSignal('Value'):Connect(function()
LocalPlayer.Character:SetPrimaryPartCFrame(cfValue.Value);
end);
for i, v in next, waypoints do
local tweenInfo = TweenInfo.new((rootPart.Position - v.Position).Magnitude / 20, Enum.EasingStyle.Linear);
local tween = TweenService:Create(cfValue, tweenInfo, {Value = CFrame.new(v.Position + Vector3.new(0, 4, 0))});
tween:Play();
tween.Completed:Wait();
end
connection:Disconnect();
connection = nil;
cfValue:Destroy();
cfValue = nil;
path.Blocked:Connect(function()
warn('BLOCKED IN PATH!');
end);
end;
local function getOrder()
local box = workspace.Environment.Locations.PizzaPlanet.Conveyor.MovingBoxes:WaitForChild('Box_1');
local rootPart = LocalPlayer.Character and LocalPlayer.Character.PrimaryPart;
if(not rootPart) then
return print('No root part :/');
end;
if((box.Position - rootPart.Position).Magnitude <= 8) then
local order = framework.net:InvokeServer({
Type = "TakePizzaBox",
Box = box
});
if(order) then
return order;
else
return getOrder();
end;
else
print('tween teleport');
tweenTeleport(Vector3.new(1171.3407, 13.6576843, 273.778717));
return getOrder();
end;
end;
function copyPlayerHousePrompt(targetPlayer)
task.wait();
if(not guiHandler:ConfirmBox(string.format('\nThis will copy the house of %s into your executor workspace folder with the name Bloxburg_House.json.\nIf you want to copy this house simply press Yes (Make sure you can see the house you want to copy or use the teleport to player plot otherwise save house won\'t work properly)\n', targetPlayer.Name, targetPlayer.Name), 'House Copier')) then
return;
end;
saveHouse(targetPlayer);
return guiHandler:MessageBox(string.format('House of %s has been copied', targetPlayer.Name), 'Success')
end;
function loadPlayerHousePrompt(house)
task.wait();
local success, houseData = pcall(readfile, string.format('Aztup Hub V3/Bloxburg Houses/%s', house));
if(not success) then
return guiHandler:AlertBox('There was an error.','Error');
end;
houseData = HttpService:JSONDecode(houseData);
local bsValue = houseData.bsValue;
local totalValue = houseData.totalValue - (bsValue * 20);
if(not guiHandler:ConfirmBox(string.format('\nAre you sure? You are about to load an house.\nMoney Required: %s\nBloxBux Required: %s\nIf you clicked on this button by mistake simply press No.\n', totalValue, bsValue), 'House Loader', 5)) then
return;
end;
loadHouse(houseData);
end
local oldNamecall;
oldNamecall = hookmetamethod(game, '__namecall', function(...)
SX_VM_CNONE();
local args = {...};
local self = args[1];
if(typeof(self) ~= 'Instance') then return oldNamecall(...) end;
if (checkcaller() and getnamecallmethod() == 'FireServer' and args[2].Order and args[2].Workstation) then
if (args[2].Workstation.Parent.Name == 'HairdresserWorkstations' and library.flags.stylezHairDresser) then
args[2].Order = {
args[2].Workstation.Occupied.Value.Order.Style.Value,
args[2].Workstation.Occupied.Value.Order.Color.Value
}
elseif (args[2].Workstation.Parent.Name == 'CashierWorkstations' and library.flags.bloxyBurgers) then
args[2].Order = {
args[2].Workstation.Occupied.Value.Order.Burger.Value,
args[2].Workstation.Occupied.Value.Order.Fries.Value,
args[2].Workstation.Occupied.Value.Order.Cola.Value
}