Repository navigation
Expand file tree
/
Copy pathPatchmahubtestmod.lua
More file actions
3948 lines (3714 loc) · 237 KB
/
Copy pathPatchmahubtestmod.lua
File metadata and controls
3948 lines (3714 loc) · 237 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
--[[
patchma hub by MyWorld
lets get the party started
IDs of paid accessories:
-for arms 11159410305,11263254795 or 14255556501,14255554762 or 12344545199,12344591101 or 13839976999,13831200263
-for legs 14768693948,14768701869 or 11159483910,12652786974 or 17401151565,17387616772
-for torso 14255528083 or 13421786478 or 14768678294
or anything else that covers ur torso. examples:
14532301415,13423624885,11502853991,14053485259,13779879140,14443132226,17163407577,16297156693,17180496303,17171230401
can be same stuff but different colors
there are 156 ways to make a rig with the ids above
IDs of free accessories:
3033910400,3409612660,3438342658,3398308134,4324158403,3822880197,4154538250,3443038622,4819740796
accessories for Immortality Lord:
head: 17375337078 or 17270164442 or 105058659622112
body: 121668589285446,80629770394501,127671621543010,76687571475377,120230112701079
or 132908702618809,122975605535029,115313441748457,127208207296576,131203955709755
or 17270178857,17270001635,17269952801,17269983359,17269998373
wings: 17270231731,17270225913
sword: 17326812233,17326800544
]]
--no need to get and index the library tables with function names every time the script uses them
local osclock=os.clock
local tspawn=task.spawn
local twait=task.wait
local schar=string.char
local ssub=string.sub
local sfind=string.find
local supper=string.upper
local mrandom=math.random
local sin=math.sin
local cos=math.cos
local abs=math.abs
local min=math.min
local clamp=math.clamp
local tinsert=table.insert
local tclear=table.clear
local tclone=table.clone
local tfind=table.find
--the script doesnt have to read global varaibles every time to get them
--why not have them saved in local varaibles for faster access times
local next=next
local pcall=pcall
local xpcall=xpcall
local type=type
local typeof=typeof
local game=game
local replicatesignal=replicatesignal
local i=Instance.new
local v2=Vector2.new
local v3=Vector3.new
local c3=Color3.new
local cf=CFrame.new
local cfl=CFrame.lookAt
local angles=CFrame.fromEulerAngles --faster than .Angles
local u2=UDim2.new
local e=Enum
local rp=RaycastParams.new
local cs=ColorSequence.new
local csk=ColorSequenceKeypoint.new
local sine=osclock()
local deltaTime=0
local v3_0=v3()
local v3_101=v3(1,0,1)
local v3_010=v3(0,1,0)
local cf_0=cf()
local v3_xz=v3_101*10
local v3_xzL=v3_101*250.1
local v3_net=v3_010*25.01
local pdloadedtime=nil
--not "local function rs" to not assign debug names
local rs=function()
local s=""
for i=1,mrandom(8,15) do
if mrandom(2)==2 then
s=s..schar(mrandom(65,90))
else
s=s..schar(mrandom(97,122))
end
end
return s
end
--it runs even faster if u call __index and __newindex metamethods directly
local getMetamethodFromErrorStack=function(userdata,f,test)
local ret=nil
xpcall(f,function()
ret=debug.info(2,"f")
end,userdata,nil,0)
if (type(ret)~="function") or not test(ret) then
return f
end
return ret
end
local insSet=getMetamethodFromErrorStack(game,function(a,b,c) a[b]=c end,function(f) local a=i("Folder") local b=rs() f(a,"Name",b) return a.Name==b end)
local insGet=getMetamethodFromErrorStack(game,function(a,b) return a[b] end,function(f) local a=i("Folder") local b=rs() a.Name=b return f(a,"Name")==b end)
local cfGet=getMetamethodFromErrorStack(cf_0,function(a,b) return a[b] end,function(f) return f(cf(1,2,3),"Position")==v3(1,2,3) end)
local cfMul=getMetamethodFromErrorStack(cf_0,function(a,b) return a*b end,function(f) return angles(1,2,3)*angles(1,2,3)==f(angles(1,2,3),angles(1,2,3)) end)
local cfAdd=getMetamethodFromErrorStack(cf_0,function(a,b) return a+b end,function(f) return cf(1,2,3)+v3(1,2,3)==f(cf(1,2,3),v3(1,2,3)) end)
local v3Get=getMetamethodFromErrorStack(v3_0,function(a,b) return a[b] end,function(f) return v3(1,2,3).Unit==f(v3(1,2,3),"Unit") end)
--multiplying and adding vector3 is faster if you use the * and + operators
--no need to index instances every time to call their functions
local Clone=insGet(game,"Clone")
local ClearAllChildren=insGet(game,"ClearAllChildren")
local Destroy=insGet(game,"Destroy")
local IsA=insGet(game,"IsA")
local FindFirstChildOfClass=insGet(game,"FindFirstChildOfClass")
local FindFirstChildWhichIsA=insGet(game,"FindFirstChildWhichIsA")
local GetChildren=insGet(game,"GetChildren")
local GetDescendants=insGet(game,"GetDescendants")
local IsDescendantOf=insGet(game,"IsDescendantOf")
local GetPropertyChangedSignal=insGet(game,"GetPropertyChangedSignal")
--findfirstchildofclass faster than getservice
local plrs=FindFirstChildOfClass(game,"Players")
local rus=FindFirstChildOfClass(game,"RunService")
local ws=FindFirstChildOfClass(game,"Workspace")
local uis=FindFirstChildOfClass(game,"UserInputService")
local gs=FindFirstChildOfClass(game,"GuiService")
local sg=FindFirstChildOfClass(game,"StarterGui")
local lp=insGet(plrs,"LocalPlayer")
local pg=FindFirstChildOfClass(lp,"PlayerGui")
local mouse=insGet(lp,"GetMouse")(lp)
local cdsb=insGet(lp,"ConnectDiedSignalBackend")
local rst=insGet(plrs,"RespawnTime")+0.07 --1/15
local preanimation=insGet(rus,"PreAnimation")
local heartbeat=insGet(rus,"Heartbeat")
local renderstepped=insGet(rus,"RenderStepped")
local GetPlayers=insGet(plrs,"GetPlayers")
local SetCoreGuiEnabled=insGet(sg,"SetCoreGuiEnabled")
local GetCoreGuiEnabled=insGet(sg,"GetCoreGuiEnabled")
local Raycast=insGet(ws,"Raycast")
local Connect=heartbeat.Connect
local Disconnect=Connect(GetPropertyChangedSignal(game,"CreatorId"),type).Disconnect
local Wait=heartbeat.Wait
local GetMouseLocation=insGet(uis,"GetMouseLocation")
local GetFocusedTextBox=insGet(uis,"GetFocusedTextBox")
local GetMouseDelta=insGet(uis,"GetMouseDelta")
local IsMouseButtonPressed=insGet(uis,"IsMouseButtonPressed")
local IsKeyDown=insGet(uis,"IsKeyDown")
local Inverse=cfGet(cf_0,"Inverse")
local Lerp=cfGet(cf_0,"Lerp")
local guiTheme={
guiTitle="patchma hub",
windowTitleColor=c3(0,0,1),
windowTopColor=c3(0,0,0),
windowBottomColor=c3(0,0,0.584314),
windowMinimizedSize={X=220,Y=22},
windowRegularSize={X=220,Y=290},
buttonsTextColor=c3(0.0941177,0.317647,0.878431),
labelsTextColor=c3(0.560784,0.560784,0.560784),
listTopColor=c3(0,0,0),
listBottomColor=c3(0.0705882,0.0705882,0.0705882)
}
local accessorylimbs={
{meshid="117287001096396",textureid="",C0=cf_0,Name="Left Arm"},
{meshid="117287001096396",textureid="",C0=cf_0,Name="Right Arm"},
{meshid="90736849096372",textureid="",C0=angles(0,0,1.5707963267948966),Name="Left Arm"},
{meshid="105141400603933",textureid="",C0=angles(0,0,1.5707963267948966),Name="Right Arm"},
{meshid="125405780718494",textureid="136752500636691",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
{meshid="125405780718494",textureid="136752500636691",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
{meshid="14255522247",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
{meshid="14255522247",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
{meshid="17374767929",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Arm"},
{meshid="17374767929",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Arm"},
{meshid="12344207333",textureid="",C0=angles(2,0,0),Name="Left Arm"},
{meshid="12344206657",textureid="",C0=angles(2,0,0),Name="Right Arm"},
{meshid="13831073174",textureid="",C0=cf(0.017,0,-0.23)*angles(-1.4835298641951802,-0.15707963267948966,2.199114857512855),Name="Left Arm"},
{meshid="13839903766",textureid="",C0=cf(0,-0.62,-0.01)*angles(1.6580627893946132,0.15707963267948966,-2.199114857512855),Name="Right Arm"},
{meshid="121304376791439",textureid="",C0=cf_0,Name="Left Leg"},
{meshid="121304376791439",textureid="",C0=cf_0,Name="Right Leg"},
{meshid="11159370334",textureid="11159285454",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Leg"},
{meshid="12652772399",textureid="12652775021",C0=cf(0,-0.125,0),Name="Right Leg"},
{meshid="125405780718494",textureid="",C0=angles(0,0,1.5707963267948966),Name="Left Leg"},
{meshid="125405780718494",textureid="",C0=angles(0,0,1.5707963267948966),Name="Right Leg"},
{meshid="17387586286",textureid="",C0=angles(1.5707963267948966,0,1.5707963267948966),Name="Left Leg"},
{meshid="17387586286",textureid="",C0=angles(-1.5707963267948966,0,1.5707963267948966),Name="Right Leg"},
{meshid="14768666349",textureid="",C0=cf_0,Name="Torso"},
{meshid="110684113028749",textureid="",C0=cf_0,Name="Torso"},
{meshid="13421774668",textureid="",C0=cf_0,Name="Torso"},
{meshid="110684113028749",textureid="",C0=cf_0,Name="Torso"},
{meshid="127552124837034",textureid="",C0=angles(0,0,1.5707963267948966),Name="Torso"},
{meshid="4324138105",textureid="4324138210",C0=angles(-1.6144295580947547,1.5707963267948966,0)*cf(-0.125,0.3,0),Name="Left Arm"},
{meshid="4154474745",textureid="4154474807",C0=angles(1.5271630954950384,-1.5707963267948966,0)*cf(-0.125,-0.3,0),Name="Left Arm"},
{meshid="3030546036",textureid="3650191503",C0=angles(1.5271630954950384,1.5707963267948966,0)*cf(0.125,-0.3,0),Name="Right Arm"},
{meshid="3030546036",textureid="3443321249",C0=angles(-1.6144295580947547,-1.5707963267948966,0)*cf(0.125,0.3,0),Name="Right Arm"},
{meshid="3030546036",textureid="3360974849",C0=angles(1.5271630954950384,1.5707963267948966,0)*cf(-0.125,-0.35,0),Name="Left Leg"},
{meshid="3030546036",textureid="3360978739",C0=angles(-1.6144295580947547,-1.5707963267948966,0)*cf(-0.125,0.3,0),Name="Left Leg"},
{meshid="3030546036",textureid="3033898741",C0=angles(1.5271630954950384,-1.5707963267948966,0)*cf(0.125,-0.35,0),Name="Right Leg"},
{meshid="3030546036",textureid="3409604993",C0=angles(-1.6144295580947547,1.5707963267948966,0)*cf(0.125,0.3,0),Name="Right Leg"},
{meshid="4819720316",textureid="4819722776",C0=angles(0,0,0.2617993877991494),Name="Torso"}
}
local gp=function(p,n,cl)
for i,v in next,GetChildren(p) do
if IsA(v,cl) and (insGet(v,"Name")==n) then
return v
end
end
return nil
end
local timegp=function(p,n,c,t)
t=osclock()+t
while t>osclock() do
for i,v in next,GetChildren(p) do
if IsA(v,c) and (insGet(v,"Name")==n) then
return v
end
end
Wait(preanimation)
end
return nil
end
local makeplaceholder=function(v)
if not insGet(v,"Archivable") then
insSet(v,"Archivable",true)
end
v=Clone(v)
for i,v in next,GetChildren(v) do
if IsA(v,"SpecialMesh") then
insSet(v,"Name",rs())
ClearAllChildren(v)
else
Destroy(v)
end
end
insSet(v,"Name",rs())
insSet(v,"Anchored",true)
insSet(v,"CanCollide",false)
insSet(v,"Transparency",0.25)
return v
end
local emptyfunction=function() end
local i1=i("Frame")
local i2=i("Frame")
local i3=i("Frame")
local i4=i("ScrollingFrame")
local i5=i("UIListLayout")
local i6=i("UIGradient")
local i7=i("TextBox")
local i8=i("TextButton")
local i9=i("UIGradient")
local i10=i("ScreenGui")
insSet(i1,"AnchorPoint",v2(0.5,0))
insSet(i1,"Active",true)
insSet(i1,"BorderSizePixel",0)
insSet(i1,"ClipsDescendants",true)
insSet(i1,"Position",u2(0.5,0,0.5,guiTheme.windowRegularSize.Y/-2))
insSet(i1,"Size",u2(0,guiTheme.windowRegularSize.X,0,guiTheme.windowRegularSize.Y))
insSet(i1,"Name",rs())
insSet(i1,"Parent",i10)
insSet(i2,"BackgroundColor3",c3(1,1,1))
insSet(i2,"BorderSizePixel",0)
insSet(i2,"Size",u2(0,guiTheme.windowRegularSize.X,0,guiTheme.windowRegularSize.Y))
insSet(i2,"Name",rs())
insSet(i2,"Parent",i1)
insSet(i3,"BackgroundColor3",c3(1,1,1))
insSet(i3,"BorderSizePixel",0)
insSet(i3,"Position",u2(0,5,0,guiTheme.windowMinimizedSize.Y-2))
insSet(i3,"Size",u2(1,-10,0,guiTheme.windowRegularSize.Y-guiTheme.windowMinimizedSize.Y-3))
insSet(i3,"Name",rs())
insSet(i3,"Parent",i2)
insSet(i4,"Active",true)
insSet(i4,"BackgroundTransparency",1)
insSet(i4,"BorderSizePixel",0)
insSet(i4,"Size",u2(1,-3,1,0))
insSet(i4,"AutomaticCanvasSize",e.AutomaticSize.Y)
insSet(i4,"CanvasSize",u2(0,0,0,0))
insSet(i4,"ScrollBarThickness",7)
insSet(i4,"Name",rs())
insSet(i4,"Parent",i3)
insSet(i5,"Name",rs())
insSet(i5,"Parent",i4)
insSet(i5,"SortOrder",e.SortOrder.LayoutOrder)
insSet(i6,"Name",rs())
insSet(i6,"Parent",i3)
insSet(i6,"Color",cs({csk(0,guiTheme.listTopColor),csk(1,guiTheme.listBottomColor)}))
insSet(i6,"Rotation",90)
insSet(i7,"Font",e.Font.SourceSans)
insSet(i7,"FontSize",e.FontSize.Size18)
insSet(i7,"ClearTextOnFocus",false)
insSet(i7,"Text",guiTheme.guiTitle)
insSet(i7,"TextColor3",guiTheme.windowTitleColor)
insSet(i7,"TextSize",16)
insSet(i7,"AnchorPoint",v2(0.5,0))
insSet(i7,"BackgroundTransparency",1)
insSet(i7,"Position",u2(0.5,0,0,guiTheme.windowMinimizedSize.Y/2))
insSet(i7,"Name",rs())
insSet(i7,"Parent",i2)
insSet(i8,"AnchorPoint",v2(1,0))
insSet(i8,"BackgroundTransparency",1)
insSet(i8,"Position",u2(1,0,0,0))
insSet(i8,"Size",u2(0,40,0,guiTheme.windowMinimizedSize.Y))
insSet(i8,"Name",rs())
insSet(i8,"Parent",i2)
insSet(i8,"Font",e.Font.SourceSans)
insSet(i8,"FontSize",e.FontSize.Size18)
insSet(i8,"Text","-")
insSet(i8,"TextColor3",c3(1,1,1))
insSet(i8,"TextSize",16)
insSet(i9,"Name",rs())
insSet(i9,"Parent",i2)
insSet(i9,"Color",cs({csk(0,guiTheme.windowTopColor),csk(1,guiTheme.windowBottomColor)}))
insSet(i9,"Rotation",90)
insSet(i10,"ZIndexBehavior",e.ZIndexBehavior.Sibling)
insSet(i10,"IgnoreGuiInset",true)
insSet(i10,"ResetOnSpawn",false)
insSet(i10,"DisplayOrder",2147483647)
insSet(i10,"Name",rs())
local guimin=false
local minloop=false
local i1X=guiTheme.windowRegularSize.X
local i1Y=guiTheme.windowRegularSize.Y
local i1Xdest=i1X
local i1Ydest=i1Y
Connect(insGet(i8,"MouseButton1Click"),function()
guimin = not guimin
if guimin then
i1Xdest=guiTheme.windowMinimizedSize.X
i1Ydest=guiTheme.windowMinimizedSize.Y
else
i1Xdest=guiTheme.windowRegularSize.X
i1Ydest=guiTheme.windowRegularSize.Y
end
if minloop then
return
end
minloop=true
insSet(i3,"Visible",true)
sine=osclock()
local lastsine=sine
while true do
sine=osclock()
local deltaTime=(sine-lastsine)*10
lastsine=sine
local difX=i1Xdest-i1X
local difY=i1Ydest-i1Y
if (abs(difY)<=1) and (abs(difX)<=1) then
i1X=i1Xdest
i1Y=i1Ydest
insSet(i1,"Size",u2(0,i1X,0,i1Y))
break
end
i1X=i1X+difX*deltaTime
i1Y=i1Y+difY*deltaTime
insSet(i1,"Size",u2(0,i1X,0,i1Y))
twait()
end
insSet(i3,"Visible",not guimin)
minloop=false
end)
local Draggable=function(window,obj)
local MB1enum = e.UserInputType.MouseButton1
local TOUCHenum = e.UserInputType.Touch
obj = obj or window
local activeEntered = 0
local mouseStart = nil
local dragStart = nil
local inputbegancon = nil
local rendersteppedcon = nil
local inputendedcon = nil
local inputendedf=function(a)
a=insGet(a,"UserInputType")
if (a==MB1enum) or (a==TOUCHenum) then
Disconnect(rendersteppedcon)
Disconnect(inputendedcon)
end
end
local rendersteppedf=function()
local off = GetMouseLocation(uis)-mouseStart
insSet(window,"Position",dragStart+u2(0,off.X,0,off.Y))
end
local inputbeganf=function(a)
a=insGet(a,"UserInputType")
if ((a==MB1enum) or (a==TOUCHenum)) and (activeEntered==0) and not GetFocusedTextBox(uis) then
mouseStart=GetMouseLocation(uis)
dragStart=insGet(window,"Position")
if rendersteppedcon then Disconnect(rendersteppedcon) end
rendersteppedcon = Connect(renderstepped,rendersteppedf)
if inputendedcon then Disconnect(inputendedcon) end
inputendedcon = Connect(insGet(uis,"InputEnded"),inputendedf)
end
end
Connect(insGet(obj,"MouseEnter"),function()
if inputbegancon then Disconnect(inputbegancon) end
inputbegancon = Connect(insGet(uis,"InputBegan"),inputbeganf)
end)
Connect(insGet(obj,"MouseLeave"),function()
Disconnect(inputbegancon)
end)
local ondes=function(d)
if IsA(d,"GuiObject") then
local thisEntered = false
local thisAdded = false
local con0 = Connect(insGet(d,"MouseEnter"),function()
thisEntered = true
if (not thisAdded) and insGet(d,"Active") then
activeEntered = activeEntered + 1
thisAdded = true
end
end)
local con1 = Connect(insGet(d,"MouseLeave"),function()
thisEntered = false
if thisAdded then
activeEntered = activeEntered - 1
thisAdded = false
end
end)
local con2 = Connect(GetPropertyChangedSignal(d,"Active"),function()
if thisEntered then
if thisAdded and not insGet(d,"Active") then
activeEntered = activeEntered - 1
thisAdded = false
elseif insGet(d,"Active") and not thisAdded then
activeEntered = activeEntered + 1
thisAdded = true
end
end
end)
local con3 = nil
con3 = Connect(insGet(d,"AncestryChanged"),function()
if not IsDescendantOf(d,window) then
if thisAdded then
activeEntered = activeEntered - 1
end
Disconnect(con0)
Disconnect(con1)
Disconnect(con2)
Disconnect(con3)
end
end)
end
end
Connect(insGet(window,"DescendantAdded"),ondes)
for i,v in next,GetDescendants(window) do
ondes(v)
end
end
local btn=function(txt, f)
local i1=i("TextBox")
local i2=i("TextButton")
insSet(i1,"Font",e.Font.SourceSans)
insSet(i1,"FontSize",e.FontSize.Size14)
insSet(i1,"Text",txt)
insSet(i1,"ClearTextOnFocus",false)
insSet(i1,"Position",u2(0.5,0,0.5,0))
insSet(i1,"TextColor3",guiTheme.buttonsTextColor)
insSet(i1,"Name",rs())
insSet(i1,"Parent",i2)
insSet(i2,"BackgroundTransparency",1)
insSet(i2,"TextTransparency",1)
insSet(i2,"Size",u2(1,0,0,14))
insSet(i2,"Name",rs())
if f then
Connect(insGet(i2,"MouseButton1Click"),f)
end
insSet(i2,"Parent",i4)
return i1
end
local lbl=function(txt)
local i1=i("TextBox")
local i2=i("Frame")
insSet(i1,"Font",e.Font.SourceSans)
insSet(i1,"FontSize",e.FontSize.Size14)
insSet(i1,"Text",txt)
insSet(i1,"ClearTextOnFocus",false)
insSet(i1,"TextColor3",guiTheme.labelsTextColor)
insSet(i1,"Position",u2(0.5,0,0.5))
insSet(i1,"BackgroundTransparency",1)
insSet(i1,"Name",rs())
insSet(i1,"Parent",i2)
insSet(i2,"Size",u2(1,0,0,14))
insSet(i2,"BackgroundTransparency",1)
insSet(i2,"Name",rs())
insSet(i2,"Parent",i4)
return i1
end
Draggable(i1)
lbl("by MyWorld")
lbl("discord.gg/QMy5f6DrbH")
local allowshiftlock=nil
local ctrltp=nil
local placeholders=nil
local clickfling=nil
local highlightflingtargets=nil
local discharscripts=nil
local flingchangestate=nil
local respawntp=nil
local breakjointsmethod=nil
local simrad=false
local hidedeatheffect=nil
local c=nil
local stopreanimate=function()
if c then
c=nil
if replicatesignal then
replicatesignal(cdsb)
end
return true
end
return false
end
local reanimate=function()
--[[
FDless reanimate by MyWorld
optimize the optimized
]]
local novoid = true --prevents parts from going under workspace.FallenPartsDestroyHeight if you control them
local speedlimit = 3000 --makes your parts move slower if the magnitude of their velocity is higher than this
local retVelTime = 0.51 --time that claimed parts have velocity to reclaim in case u lose them
local walkSpeed = 16 --your walkspeed (can be changed at runtime)
local jumpPower = 50 --your jump power (can be changed at runtime)
local gravity = 196.2 --how fast the characters velocity decreases while falling (can be changed at runtime)
local ctrlclicktp = ctrltp --makes you teleport where u point ur mouse cursor at when click and hold ctrl down
local clickfling = clickfling --makes you fling the person you clicked when its available to do so
local flingvel = v3(15000,16000,15000) --the rotation velocity that ur character will have while flinging
if stopreanimate() then return end
c=insGet(lp,"Character")
if not (c and IsDescendantOf(c,ws)) then return end
local rootpart=gp(c,"HumanoidRootPart","BasePart") or gp(c,"Torso","BasePart") or gp(c,"UpperTorso","BasePart") or timegp(c,"HumanoidRootPart","BasePart",0.5) or FindFirstChildWhichIsA(c,"BasePart")
if not rootpart then return end
local cam=nil
--theres a way to have ws.currentcamera nil on heartbeat and still have the game run normally
local refcam=function()
local newcam=insGet(ws,"CurrentCamera")
while not newcam do
Wait(GetPropertyChangedSignal(ws,"CurrentCamera"))
newcam=insGet(ws,"CurrentCamera")
end
cam=newcam
end
refcam()
local camcf=insGet(cam,"CFrame")
local enumCamS=e.CameraType.Scriptable
local camt=insGet(cam,"CameraType")
local camcon0=nil
local camcon1=nil
local camcon2=nil
local onnewcamera=function()
refcam()
if camcon0 then
Disconnect(camcon0)
Disconnect(camcon1)
camcon0=nil
end
if not c then
if insGet(cam,"CameraType")==enumCamS then
insSet(cam,"CameraType",camt)
end
return Disconnect(camcon2)
end
camcon0=Connect(GetPropertyChangedSignal(cam,"CFrame"),function()
if insGet(cam,"CFrame")~=camcf then
insSet(cam,"CFrame",camcf)
end
end)
camcon1=Connect(GetPropertyChangedSignal(cam,"CameraType"),function()
if insGet(cam,"CameraType")~=enumCamS then
insSet(cam,"CameraType",enumCamS)
end
end)
if insGet(cam,"CameraType")~=enumCamS then
insSet(cam,"CameraType",enumCamS)
end
if insGet(cam,"CFrame")~=camcf then
insSet(cam,"CFrame",camcf)
end
end
camcon2=Connect(GetPropertyChangedSignal(ws,"CurrentCamera"),onnewcamera)
onnewcamera()
local velYdelta=insGet(ws,"Gravity")*0.025
Connect(GetPropertyChangedSignal(ws,"Gravity"),function()
velYdelta=insGet(ws,"Gravity")*0.025
end)
local fpdh=insGet(ws,"FallenPartsDestroyHeight")
novoid=novoid and (fpdh+1)
local Yvel=0
local cfr=insGet(rootpart,"CFrame")
local pos=cfGet(cfr,"Position")
cfr=cfl(pos,pos+cfGet(cfr,"LookVector")*v3_101)
local primarypart=nil
local shiftlock=false
local firstperson=false
local xzvel=v3_0
local v3_0150=v3_010*1.5
local camcfLV=cfGet(camcf,"LookVector")
local camrot=cfl(v3_0,camcfLV)
local camcfRV=cfGet(camrot,"RightVector")
local cammag=-v3Get((cfGet(camcf,"Position")-(pos+v3_0150)),"Magnitude")
local R6parts={
head={Name="Head"},
torso={Name="Torso"},
root={Name="HumanoidRootPart"},
leftArm={Name="Left Arm"},
rightArm={Name="Right Arm"},
leftLeg={Name="Left Leg"},
rightLeg={Name="Right Leg"}
}
rootpart=R6parts.root
local cframes={}
for i,v in next,R6parts do
cframes[v]=cfr
end
local joints={
{
Name="Neck",
Part0=R6parts.torso,Part1=R6parts.head,
C0=cf(0,1,0,-1,0,0,0,0,1,0,1,-0),
C1=cf(0,-0.5,0,-1,0,0,0,0,1,0,1,-0)
},
{
Name="RootJoint",
Part0=rootpart,Part1=R6parts.torso,
C0=cf(0,0,0,-1,0,0,0,0,1,0,1,-0),
C1=cf(0,0,0,-1,0,0,0,0,1,0,1,-0)
},
{
Name="Right Shoulder",
Part0=R6parts.torso,Part1=R6parts.rightArm,
C0=cf(1,0.5,0,0,0,1,0,1,-0,-1,0,0),
C1=cf(-0.5,0.5,0,0,0,1,0,1,-0,-1,0,0)
},
{
Name="Left Shoulder",
Part0=R6parts.torso,Part1=R6parts.leftArm,
C0=cf(-1,0.5,0,0,0,-1,0,1,0,1,0,0),
C1=cf(0.5,0.5,0,0,0,-1,0,1,0,1,0,0)
},
{
Name="Right Hip",
Part0=R6parts.torso,Part1=R6parts.rightLeg,
C0=cf(1,-1,0,0,0,1,0,1,-0,-1,0,0),
C1=cf(0.5,1,0,0,0,1,0,1,-0,-1,0,0)
},
{
Name="Left Hip",
Part0=R6parts.torso,Part1=R6parts.leftLeg,
C0=cf(-1,-1,0,0,0,-1,0,1,0,1,0,0),
C1=cf(-0.5,1,0,0,0,-1,0,1,0,1,0,0)
}
}
local refreshedjoints={}
local refreshjointsI=nil
refreshjointsI=function(part)
tinsert(refreshedjoints,part)
for i,v in next,joints do
local part0=v.Part0
local part1=v.Part1
if part1 and (part0==part) then
cframes[part1]=cfMul(cframes[part],cfMul(v.C0,Inverse(v.C1)))
if not tfind(refreshedjoints,part1) then
refreshjointsI(part1)
end
elseif part0 and (part1==part) then
cframes[part0]=cfMul(cframes[part],cfMul(v.C1,Inverse(v.C0)))
if not tfind(refreshedjoints,part0) then
refreshjointsI(part0)
end
end
end
end
refreshjointsI(rootpart)
tclear(refreshedjoints)
local attachments={
RightShoulderAttachment={R6parts.rightArm,cf(0,1,0,1,0,0,0,1,0,0,0,1)},
RightGripAttachment={R6parts.rightArm,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
LeftFootAttachment={R6parts.leftLeg,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
LeftShoulderAttachment={R6parts.leftArm,cf(0,1,0,1,0,0,0,1,0,0,0,1)},
LeftGripAttachment={R6parts.leftArm,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
RootAttachment={rootpart,cf(0,0,0,1,0,0,0,1,0,0,0,1)},
RightFootAttachment={R6parts.rightLeg,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
NeckAttachment={R6parts.torso,cf(0,1,0,1,0,0,0,1,0,0,0,1)},
BodyFrontAttachment={R6parts.torso,cf(0,0,-0.5,1,0,0,0,1,0,0,0,1)},
BodyBackAttachment={R6parts.torso,cf(0,0,0.5,1,0,0,0,1,0,0,0,1)},
LeftCollarAttachment={R6parts.torso,cf(-1,1,0,1,0,0,0,1,0,0,0,1)},
RightCollarAttachment={R6parts.torso,cf(1,1,0,1,0,0,0,1,0,0,0,1)},
WaistFrontAttachment={R6parts.torso,cf(0,-1,-0.5,1,0,0,0,1,0,0,0,1)},
WaistCenterAttachment={R6parts.torso,cf(0,-1,0,1,0,0,0,1,0,0,0,1)},
WaistBackAttachment={R6parts.torso,cf(0,-1,0.5,1,0,0,0,1,0,0,0,1)},
HairAttachment={R6parts.head,cf(0,0.6,0,1,0,0,0,1,0,0,0,1)},
HatAttachment={R6parts.head,cf(0,0.6,0,1,0,0,0,1,0,0,0,1)},
FaceFrontAttachment={R6parts.head,cf(0,0,-0.6,1,0,0,0,1,0,0,0,1)},
FaceCenterAttachment={R6parts.head,cf(0,0,0,1,0,0,0,1,0,0,0,1)}
}
local getPart=function(name,blacklist)
if blacklist then
for i,v in next,cframes do
if (i.Name==name) and not tfind(blacklist,i) then
return i
end
end
else
for i,v in next,cframes do
if i.Name==name then
return i
end
end
end
return nil
end
local getJoint=function(name)
for i,v in next,joints do
if v.Name==name then
return v
end
end
return {C0=cf_0,C1=cf_0}
end
local getPartFromMesh=function(m,t,blacklist)
if blacklist then
for v,_ in next,cframes do
if v.m and (not tfind(blacklist,v)) and sfind(v.m,m) and sfind(v.t,t) then
return v
end
end
else
for v,_ in next,cframes do
if v.m and sfind(v.m,m) and sfind(v.t,t) then
return v
end
end
end
local p={m=m,t=t}
cframes[p]=cfr
local j={C0=cf_0,C1=cf_0,Part0=p}
p.j=j
return p
end
local getPartJoint=function(p)
if cframes[p] then
local j=p.j
if j then
return j
end
for i,v in next,joints do
if v.Part0==p then
return v
end
end
for i,v in next,joints do
if v.Part1==p then
return v
end
end
end
return nil
end
local getAccWeldFromMesh=function(m,t)
return getPartJoint(getPartFromMesh(m,t))
end
local raycastparams=rp()
raycastparams.FilterType=e.RaycastFilterType.Exclude
raycastparams.RespectCanCollide=true
local rayfilter={}
local characters={}
local refreshrayfilter=function()
tclear(rayfilter)
for i,v in next,characters do
tinsert(rayfilter,v)
end
raycastparams.FilterDescendantsInstances=rayfilter
end
local flingtable={}
local rootparts={}
for i,v in next,accessorylimbs do
v.p=getPart(v.Name)
end
local makePartCons=function(p,t)
if (t.p==p) and insGet(p,"Anchored") then
t.p=nil
end
local con0=Connect(GetPropertyChangedSignal(p,"Anchored"),function()
if insGet(p,"Anchored") then
if t.p==p then
t.c=nil
t.p=nil
end
elseif not t.p then
t.p=p
end
end)
local con1=nil
con1=Connect(insGet(p,"AncestryChanged"),function()
if not IsDescendantOf(p,ws) then
Disconnect(con0)
Disconnect(con1)
if t.p==p then
t.p=nil
end
end
end)
end
local ondes=nil
ondes=function(v)
if c and IsA(v,"Attachment") and IsDescendantOf(c,ws) then
local v1=attachments[insGet(v,"Name")]
if v1 then
local p=insGet(v,"Parent")
if insGet(p,"Parent")~=c then
local meshid=nil
local textureid=nil
if IsA(p,"MeshPart") then
meshid=insGet(p,"MeshId")
textureid=insGet(p,"TextureID")
elseif IsA(p,"BasePart") then
local sm=FindFirstChildOfClass(p,"SpecialMesh")
if sm then
meshid=insGet(sm,"MeshId")
textureid=insGet(sm,"TextureId")
else
return
end
else
return
end
for i,_ in next,cframes do
if (meshid==i.m) and (textureid==i.t) then
local p1=i.p
if p1 and IsDescendantOf(p1,c) then
if p1==p then
return
end
else
i.p=p
makePartCons(p,i)
return
end
else
local j=i.j
if j and sfind(meshid,i.m) and sfind(textureid,i.t) then
i.m=meshid
i.t=textureid
i.l=insGet(p,"Position")
i.p=p
makePartCons(p,i)
i.j=nil
i.Name=insGet(p,"Name")
j.C0=insGet(v,"CFrame")
j.C1=v1[2]
j.Part1=v1[1]
tinsert(joints,j)
return
end
end
end
for i,l in next,accessorylimbs do
if l.p and sfind(meshid,l.meshid) and sfind(textureid,l.textureid) then
local t={Name=insGet(p,"Name"),l=insGet(p,"Position"),m=meshid,t=textureid,p=p}
makePartCons(p,t)
if placeholders then
t.v=makeplaceholder(p)
t.b=false
end
cframes[t]=insGet(p,"CFrame")
tinsert(joints,{Part0=t,Part1=l.p,C0=l.C0,C1=cf_0})
l.p=nil
return
end
end
local t={Name=insGet(p,"Name"),l=insGet(p,"Position"),m=meshid,t=textureid,p=p}
makePartCons(p,t)
if placeholders then
t.v=makeplaceholder(p)
t.b=false
end
cframes[t]=insGet(p,"CFrame")
tinsert(joints,{Part0=t,Part1=v1[1],C0=insGet(v,"CFrame"),C1=v1[2]})
end
end
end
end
local simradv=0
local charcons={}
local enumH=e.CoreGuiType.Health
local onplayer=function(v)
simradv=simradv+1000
local islp=v==lp
local lastc=nil
local oncharacter=function()
local newc=insGet(v,"Character")
if c and newc and (newc~=lastc) then
lastc=newc
characters[v]=newc
refreshrayfilter()
if islp then
if discharscripts then
Connect(insGet(newc,"DescendantAdded"),discharscripts)
for i,v in next,GetDescendants(newc) do
if IsA(v,"Script") then
insSet(v,"Disabled",true)
end
end
end
local hrp=timegp(newc,"HumanoidRootPart","BasePart",10)
if not (hrp and c and IsDescendantOf(newc,ws)) then return end
c=newc
local fi,fv=next(flingtable)
if fi then
if replicatesignal and not pdloadedtime then
replicatesignal(cdsb)
pdloadedtime=osclock()+rst
end
if flingchangestate==3 then
local hum=FindFirstChildOfClass(c,"Humanoid")
if hum then
insGet(hum,"ChangeState")(hum,e.HumanoidStateType.Physics)
insGet(hum,"SetStateEnabled")(hum,e.HumanoidStateType.Seated,false)
end
elseif flingchangestate==1 then
local hum=FindFirstChildOfClass(c,"Humanoid")
if hum then
insGet(hum,"ChangeState")(hum,e.HumanoidStateType.Physics)
end
elseif flingchangestate==2 then
local hum=FindFirstChildOfClass(c,"Humanoid")
if hum then
insGet(hum,"SetStateEnabled")(hum,e.HumanoidStateType.Seated,false)
end
end
for i,v in next,tclone(flingtable) do
if not c then
return
end
local startpos=insGet(i,"Position")
local stoptime=sine+3
while true do
twait()
if sine>stoptime then
break
end
if insGet(i,"Anchored") or not IsDescendantOf(i,ws) then
break
end
if v3Get((startpos-insGet(i,"Position")),"Magnitude")>200 then
break
end
local tcf=cfAdd(insGet(i,"CFrame"),insGet(i,"AssemblyLinearVelocity")*(sin(sine*15)+1))
if novoid and (cfGet(tcf,"Y")<novoid) then
tcf=cfAdd(tcf,v3_010*(novoid-cfGet(tcf,"Y")))
end
insSet(hrp,"CFrame",tcf)
insSet(hrp,"AssemblyLinearVelocity",insGet(i,"AssemblyLinearVelocity")*v3_101*75)
insSet(hrp,"AssemblyAngularVelocity",flingvel)
end
if v then
Destroy(v)
end
flingtable[i]=nil