Repository navigation
Expand file tree
/
Copy pathBWV2fixfefixfixfixfixfixfixfix.lua
More file actions
6045 lines (5595 loc) · 281 KB
/
Copy pathBWV2fixfefixfixfixfixfixfixfix.lua
File metadata and controls
6045 lines (5595 loc) · 281 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
--https://github.com/Mokiros/roblox-FE-compatibility
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
local Player,game,owner = owner,game
local RealPlayer = Player
do
print("FE Compatibility code V2 by Mokiros")
local RealPlayer = RealPlayer
script.Parent = RealPlayer.Character
--Fake event to make stuff like Mouse.KeyDown work
local Disconnect_Function = function(this)
this[1].Functions[this[2]] = nil
end
local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
local FakeEvent_Metatable = {__index={
Connect = function(this,f)
local i = tostring(math.random(0,10000))
while this.Functions[i] do
i = tostring(math.random(0,10000))
end
this.Functions[i] = f
return setmetatable({this,i},Disconnect_Metatable)
end
}}
FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
local function fakeEvent()
return setmetatable({Functions={}},FakeEvent_Metatable)
end
--Creating fake input objects with fake variables
local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
FakeMouse.keyUp = FakeMouse.KeyUp
FakeMouse.keyDown = FakeMouse.KeyDown
local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
end}
--Merged 2 functions into one by checking amount of arguments
CAS.UnbindAction = CAS.BindAction
--This function will trigger the events that have been :Connect()'ed
local function TriggerEvent(self,ev,...)
for _,f in pairs(self[ev].Functions) do
f(...)
end
end
FakeMouse.TriggerEvent = TriggerEvent
UIS.TriggerEvent = TriggerEvent
--Client communication
local Event = Instance.new("RemoteEvent")
Event.Name = "UserInput_Event"
Event.OnServerEvent:Connect(function(plr,io)
if plr~=RealPlayer then return end
FakeMouse.Target = io.Target
FakeMouse.Hit = io.Hit
if not io.isMouse then
local b = io.UserInputState == Enum.UserInputState.Begin
if io.UserInputType == Enum.UserInputType.MouseButton1 then
return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
end
if io.UserInputType == Enum.UserInputType.MouseButton2 then
return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
end
for _,t in pairs(CAS.Actions) do
for _,k in pairs(t.Keys) do
if k==io.KeyCode then
t.Function(t.Name,io.UserInputState,io)
end
end
end
FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
end
end)
Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
local Mouse = owner:GetMouse()
local UIS = game:GetService("UserInputService")
local input = function(io,RobloxHandled)
if RobloxHandled then return end
--Since InputObject is a client-side instance, we create and pass table instead
Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
end
UIS.InputBegan:Connect(input)
UIS.InputEnded:Connect(input)
local h,t
--Give the server mouse data every second frame, but only if the values changed
--If player is not moving their mouse, client won't fire events
local HB = game:GetService("RunService").Heartbeat
while true do
if h~=Mouse.Hit or t~=Mouse.Target then
h,t=Mouse.Hit,Mouse.Target
Event:FireServer({isMouse=true,Target=t,Hit=h})
end
--Wait 2 frames
for i=1,2 do
HB:Wait()
end
end]==],script)
----Sandboxed game object that allows the usage of client-side methods and services
--Real game object
local RealGame = game
--Metatable for fake service
local FakeService_Metatable = {
__index = function(self,k)
local s = rawget(self,"_RealService")
if s then
return typeof(s[k])=="function"
and function(_,...)return s[k](s,...)end or s[k]
end
end,
__newindex = function(self,k,v)
local s = rawget(self,"_RealService")
if s then s[k]=v end
end
}
local function FakeService(t,RealService)
t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
return setmetatable(t,FakeService_Metatable)
end
--Fake game object
local FakeGame = {
GetService = function(self,s)
return rawget(self,s) or RealGame:GetService(s)
end,
Players = FakeService({
LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
},"Players"),
UserInputService = FakeService(UIS,"UserInputService"),
ContextActionService = FakeService(CAS,"ContextActionService"),
RunService = FakeService({
_btrs = {},
RenderStepped = RealGame:GetService("RunService").Heartbeat,
BindToRenderStep = function(self,name,_,fun)
self._btrs[name] = self.Heartbeat:Connect(fun)
end,
UnbindFromRenderStep = function(self,name)
self._btrs[name]:Disconnect()
end,
},"RunService")
}
rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
FakeGame.service = FakeGame.GetService
FakeService(FakeGame,game)
--Changing owner to fake player object to support owner:GetMouse()
game,owner = FakeGame,FakeGame.Players.LocalPlayer
end
--Converted with ttyyuu12345's model to script plugin v4
function sandbox(var,func)
local env = getfenv(func)
local newenv = setmetatable({},{
__index = function(self,k)
if k=="script" then
return var
else
return env[k]
end
end,
})
setfenv(func,newenv)
return func
end
cors = {}
mas = Instance.new("Model",game:GetService("Lighting"))
Folder0 = Instance.new("Folder")
Folder1 = Instance.new("Folder")
LocalScript2 = Instance.new("LocalScript")
IntValue3 = Instance.new("IntValue")
IntValue4 = Instance.new("IntValue")
Model5 = Instance.new("Model")
Model6 = Instance.new("Model")
UnionOperation7 = Instance.new("UnionOperation")
UnionOperation8 = Instance.new("UnionOperation")
UnionOperation9 = Instance.new("UnionOperation")
UnionOperation10 = Instance.new("UnionOperation")
UnionOperation11 = Instance.new("UnionOperation")
UnionOperation12 = Instance.new("UnionOperation")
MeshPart13 = Instance.new("MeshPart")
Part14 = Instance.new("Part")
BlockMesh15 = Instance.new("BlockMesh")
WedgePart16 = Instance.new("WedgePart")
SpecialMesh17 = Instance.new("SpecialMesh")
WedgePart18 = Instance.new("WedgePart")
SpecialMesh19 = Instance.new("SpecialMesh")
Part20 = Instance.new("Part")
BlockMesh21 = Instance.new("BlockMesh")
Part22 = Instance.new("Part")
BlockMesh23 = Instance.new("BlockMesh")
WedgePart24 = Instance.new("WedgePart")
SpecialMesh25 = Instance.new("SpecialMesh")
Part26 = Instance.new("Part")
ParticleEmitter27 = Instance.new("ParticleEmitter")
Model28 = Instance.new("Model")
MeshPart29 = Instance.new("MeshPart")
Script30 = Instance.new("Script")
Model31 = Instance.new("Model")
Script32 = Instance.new("Script")
Model33 = Instance.new("Model")
MeshPart34 = Instance.new("MeshPart")
Model35 = Instance.new("Model")
UnionOperation36 = Instance.new("UnionOperation")
UnionOperation37 = Instance.new("UnionOperation")
UnionOperation38 = Instance.new("UnionOperation")
UnionOperation39 = Instance.new("UnionOperation")
UnionOperation40 = Instance.new("UnionOperation")
UnionOperation41 = Instance.new("UnionOperation")
UnionOperation42 = Instance.new("UnionOperation")
UnionOperation43 = Instance.new("UnionOperation")
Trail44 = Instance.new("Trail")
UnionOperation45 = Instance.new("UnionOperation")
UnionOperation46 = Instance.new("UnionOperation")
Model47 = Instance.new("Model")
Script48 = Instance.new("Script")
Model49 = Instance.new("Model")
MeshPart50 = Instance.new("MeshPart")
Model51 = Instance.new("Model")
UnionOperation52 = Instance.new("UnionOperation")
Part53 = Instance.new("Part")
ParticleEmitter54 = Instance.new("ParticleEmitter")
Model55 = Instance.new("Model")
Script56 = Instance.new("Script")
Model57 = Instance.new("Model")
Part58 = Instance.new("Part")
Part59 = Instance.new("Part")
Part60 = Instance.new("Part")
Part61 = Instance.new("Part")
Part62 = Instance.new("Part")
Part63 = Instance.new("Part")
UnionOperation64 = Instance.new("UnionOperation")
Part65 = Instance.new("Part")
Model66 = Instance.new("Model")
MeshPart67 = Instance.new("MeshPart")
Model68 = Instance.new("Model")
Model69 = Instance.new("Model")
MeshPart70 = Instance.new("MeshPart")
Script71 = Instance.new("Script")
Model72 = Instance.new("Model")
Part73 = Instance.new("Part")
UnionOperation74 = Instance.new("UnionOperation")
UnionOperation75 = Instance.new("UnionOperation")
UnionOperation76 = Instance.new("UnionOperation")
UnionOperation77 = Instance.new("UnionOperation")
UnionOperation78 = Instance.new("UnionOperation")
UnionOperation79 = Instance.new("UnionOperation")
UnionOperation80 = Instance.new("UnionOperation")
Part81 = Instance.new("Part")
SpecialMesh82 = Instance.new("SpecialMesh")
UnionOperation83 = Instance.new("UnionOperation")
Model84 = Instance.new("Model")
Script85 = Instance.new("Script")
Model86 = Instance.new("Model")
MeshPart87 = Instance.new("MeshPart")
Model88 = Instance.new("Model")
UnionOperation89 = Instance.new("UnionOperation")
UnionOperation90 = Instance.new("UnionOperation")
UnionOperation91 = Instance.new("UnionOperation")
UnionOperation92 = Instance.new("UnionOperation")
UnionOperation93 = Instance.new("UnionOperation")
UnionOperation94 = Instance.new("UnionOperation")
UnionOperation95 = Instance.new("UnionOperation")
UnionOperation96 = Instance.new("UnionOperation")
Part97 = Instance.new("Part")
Part98 = Instance.new("Part")
ParticleEmitter99 = Instance.new("ParticleEmitter")
Weld100 = Instance.new("Weld")
UnionOperation101 = Instance.new("UnionOperation")
Part102 = Instance.new("Part")
BlockMesh103 = Instance.new("BlockMesh")
UnionOperation104 = Instance.new("UnionOperation")
UnionOperation105 = Instance.new("UnionOperation")
Model106 = Instance.new("Model")
Script107 = Instance.new("Script")
Model108 = Instance.new("Model")
MeshPart109 = Instance.new("MeshPart")
Model110 = Instance.new("Model")
Part111 = Instance.new("Part")
Part112 = Instance.new("Part")
MeshPart113 = Instance.new("MeshPart")
Trail114 = Instance.new("Trail")
ParticleEmitter115 = Instance.new("ParticleEmitter")
ParticleEmitter116 = Instance.new("ParticleEmitter")
Weld117 = Instance.new("Weld")
Model118 = Instance.new("Model")
Model119 = Instance.new("Model")
Part120 = Instance.new("Part")
CFrameValue121 = Instance.new("CFrameValue")
MeshPart122 = Instance.new("MeshPart")
CFrameValue123 = Instance.new("CFrameValue")
Part124 = Instance.new("Part")
ParticleEmitter125 = Instance.new("ParticleEmitter")
ParticleEmitter126 = Instance.new("ParticleEmitter")
PointLight127 = Instance.new("PointLight")
CFrameValue128 = Instance.new("CFrameValue")
Part129 = Instance.new("Part")
Sound130 = Instance.new("Sound")
Sound131 = Instance.new("Sound")
Sound132 = Instance.new("Sound")
Sound133 = Instance.new("Sound")
Script134 = Instance.new("Script")
Weld135 = Instance.new("Weld")
UnionOperation136 = Instance.new("UnionOperation")
StringValue137 = Instance.new("StringValue")
CFrameValue138 = Instance.new("CFrameValue")
MeshPart139 = Instance.new("MeshPart")
CFrameValue140 = Instance.new("CFrameValue")
MeshPart141 = Instance.new("MeshPart")
CFrameValue142 = Instance.new("CFrameValue")
MeshPart143 = Instance.new("MeshPart")
CFrameValue144 = Instance.new("CFrameValue")
MeshPart145 = Instance.new("MeshPart")
CFrameValue146 = Instance.new("CFrameValue")
UnionOperation147 = Instance.new("UnionOperation")
CFrameValue148 = Instance.new("CFrameValue")
UnionOperation149 = Instance.new("UnionOperation")
CFrameValue150 = Instance.new("CFrameValue")
UnionOperation151 = Instance.new("UnionOperation")
CFrameValue152 = Instance.new("CFrameValue")
MeshPart153 = Instance.new("MeshPart")
CFrameValue154 = Instance.new("CFrameValue")
MeshPart155 = Instance.new("MeshPart")
CFrameValue156 = Instance.new("CFrameValue")
UnionOperation157 = Instance.new("UnionOperation")
MeshPart158 = Instance.new("MeshPart")
CFrameValue159 = Instance.new("CFrameValue")
UnionOperation160 = Instance.new("UnionOperation")
CFrameValue161 = Instance.new("CFrameValue")
UnionOperation162 = Instance.new("UnionOperation")
CFrameValue163 = Instance.new("CFrameValue")
MeshPart164 = Instance.new("MeshPart")
CFrameValue165 = Instance.new("CFrameValue")
MeshPart166 = Instance.new("MeshPart")
CFrameValue167 = Instance.new("CFrameValue")
MeshPart168 = Instance.new("MeshPart")
CFrameValue169 = Instance.new("CFrameValue")
Part170 = Instance.new("Part")
ParticleEmitter171 = Instance.new("ParticleEmitter")
ParticleEmitter172 = Instance.new("ParticleEmitter")
PointLight173 = Instance.new("PointLight")
CFrameValue174 = Instance.new("CFrameValue")
Model175 = Instance.new("Model")
MeshPart176 = Instance.new("MeshPart")
Script177 = Instance.new("Script")
ScreenGui178 = Instance.new("ScreenGui")
Frame179 = Instance.new("Frame")
Frame180 = Instance.new("Frame")
Frame181 = Instance.new("Frame")
TextLabel182 = Instance.new("TextLabel")
Frame183 = Instance.new("Frame")
Frame184 = Instance.new("Frame")
Frame185 = Instance.new("Frame")
TextLabel186 = Instance.new("TextLabel")
TextLabel187 = Instance.new("TextLabel")
TextLabel188 = Instance.new("TextLabel")
TextLabel189 = Instance.new("TextLabel")
Folder0.Parent = mas
Folder1.Name = "Effects"
Folder1.Parent = Folder0
LocalScript2.Name = "CamShake"
LocalScript2.Parent = Folder1
LocalScript2.Enabled = false
table.insert(cors,sandbox(LocalScript2,function()
local me = game:service'Players'.localPlayer
local ch = me.Character
local hum = ch:FindFirstChildOfClass'Humanoid'
local times = script:WaitForChild'times'.Value
local intense = script:WaitForChild'intensity'.Value
local origin
coroutine.wrap(function()
if(script:FindFirstChild'origin')then
origin = script:FindFirstChild'origin'.Value
end
end)()
local cam = workspace.CurrentCamera
local intensity = intense
local ArtificialHB = Instance.new("BindableEvent", script)
ArtificialHB.Name = "Heartbeat"
script:WaitForChild("Heartbeat")
local tf = 0
local allowframeloss = false
local tossremainder = false
local lastframe = tick()
local frame = 1/60
ArtificialHB:Fire()
game:GetService("RunService").Heartbeat:connect(function(s, p)
tf = tf + s
if tf >= frame then
if allowframeloss then
script.Heartbeat:Fire()
lastframe = tick()
else
for i = 1, math.floor(tf / frame) do
ArtificialHB:Fire()
end
lastframe = tick()
end
if tossremainder then
tf = 0
else
tf = tf - frame * math.floor(tf / frame)
end
end
end)
function swait(num)
if num == 0 or num == nil then
ArtificialHB.Event:wait()
else
for i = 0, num do
ArtificialHB.Event:wait()
end
end
end
if(hum and not hum:FindFirstChild'CamShaking')then
local cam = workspace.CurrentCamera
local oCO = hum.CameraOffset
local cs = Instance.new("BoolValue",hum)
cs.Name = "CamShaking"
for i = 1, times do
local camDistFromOrigin
if(typeof(origin) == 'Instance' and origin:IsA'BasePart')then
camDistFromOrigin = math.floor( (cam.CoordinateFrame.p-origin.Position).magnitude )/12.5
elseif(typeof(origin) == 'Vector3')then
camDistFromOrigin = math.floor( (cam.CoordinateFrame.p-origin).magnitude )/12.5
end
if(camDistFromOrigin)then
intensity = math.min(intense, math.floor(intense/camDistFromOrigin))
end
--cam.CoordinateFrame = cam.CoordinateFrame*CFrame.fromEulerAnglesXYZ(math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200,math.random(-intensity,intensity)/200)
if(hum)then
hum.CameraOffset = Vector3.new(math.random(-intensity,intensity)/50,math.random(-intensity,intensity)/50,math.random(-intensity,intensity)/50)
end
swait()
end
if(hum)then
hum.CameraOffset = oCO
end
cs:destroy()
end
script:Destroy()
end))
LocalScript2.Disabled = true
IntValue3.Name = "intensity"
IntValue3.Parent = LocalScript2
IntValue3.Value = 16
IntValue4.Name = "times"
IntValue4.Parent = LocalScript2
IntValue4.Value = 5
Model5.Name = "AK"
Model5.Parent = Folder0
Model6.Name = "Weapon"
Model6.Parent = Model5
UnionOperation7.Parent = Model6
UnionOperation7.CFrame = CFrame.new(-189.401062, 6093.42236, -3.25642395, 4.3704361e-08, -7.83657583e-10, 1, -0.0179280043, -0.999839306, 0, 0.999839246, -0.0179280005, -4.37113883e-08)
UnionOperation7.Orientation = Vector3.new(0, 90, -178.97000122070312)
UnionOperation7.Position = Vector3.new(-189.40106201171875, 6093.42236328125, -3.2564239501953125)
UnionOperation7.Rotation = Vector3.new(-178.97000122070312, 90, 0)
UnionOperation7.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
UnionOperation7.Size = Vector3.new(0.7833306789398193, 0.5843572616577148, 0.15130533277988434)
UnionOperation7.BrickColor = BrickColor.new("Really black")
UnionOperation7.CanCollide = false
UnionOperation7.Material = Enum.Material.SmoothPlastic
UnionOperation7.brickColor = BrickColor.new("Really black")
UnionOperation7.UsePartColor = true
UnionOperation8.Parent = Model6
UnionOperation8.CFrame = CFrame.new(-189.401367, 6090.64355, -3.70640612, 0, -4.37113812e-08, 1, -0.99999994, 0, 0, 0, -0.999999881, -4.37113883e-08)
UnionOperation8.Orientation = Vector3.new(0, 90, -90)
UnionOperation8.Position = Vector3.new(-189.4013671875, 6090.6435546875, -3.7064061164855957)
UnionOperation8.Rotation = Vector3.new(-90, 90, 0)
UnionOperation8.Color = Color3.new(0.105882, 0.164706, 0.207843)
UnionOperation8.Size = Vector3.new(1.2135430574417114, 0.43283718824386597, 0.16451001167297363)
UnionOperation8.BrickColor = BrickColor.new("Black")
UnionOperation8.CanCollide = false
UnionOperation8.Material = Enum.Material.Glass
UnionOperation8.brickColor = BrickColor.new("Black")
UnionOperation9.Parent = Model6
UnionOperation9.CFrame = CFrame.new(-189.408508, 6093.0127, -3.32357001, 0, -4.37113812e-08, 1, -0.99999994, 0, 0, 0, -0.999999881, -4.37113883e-08)
UnionOperation9.Orientation = Vector3.new(0, 90, -90)
UnionOperation9.Position = Vector3.new(-189.40850830078125, 6093.0126953125, -3.3235700130462646)
UnionOperation9.Rotation = Vector3.new(-90, 90, 0)
UnionOperation9.Color = Color3.new(0.105882, 0.164706, 0.207843)
UnionOperation9.Size = Vector3.new(0.4110247790813446, 0.2907370626926422, 0.12944276630878448)
UnionOperation9.BrickColor = BrickColor.new("Black")
UnionOperation9.CanCollide = false
UnionOperation9.Material = Enum.Material.Glass
UnionOperation9.brickColor = BrickColor.new("Black")
UnionOperation10.Parent = Model6
UnionOperation10.CFrame = CFrame.new(-189.334717, 6092.7251, -3.692276, 0, -4.37113812e-08, 1, -0.99999994, 0, 0, 0, -0.999999881, -4.37113883e-08)
UnionOperation10.Orientation = Vector3.new(0, 90, -90)
UnionOperation10.Position = Vector3.new(-189.334716796875, 6092.72509765625, -3.6922760009765625)
UnionOperation10.Rotation = Vector3.new(-90, 90, 0)
UnionOperation10.Color = Color3.new(0.105882, 0.164706, 0.207843)
UnionOperation10.Size = Vector3.new(1.770310401916504, 0.4887627065181732, 0.3027183413505554)
UnionOperation10.BrickColor = BrickColor.new("Black")
UnionOperation10.CanCollide = false
UnionOperation10.Material = Enum.Material.Glass
UnionOperation10.brickColor = BrickColor.new("Black")
UnionOperation11.Parent = Model6
UnionOperation11.CFrame = CFrame.new(-189.392029, 6091.68604, -3.66616797, 4.3704361e-08, -7.83657583e-10, 1, -0.0179280043, -0.999839306, 0, 0.999839246, -0.0179280005, -4.37113883e-08)
UnionOperation11.Orientation = Vector3.new(0, 90, -178.97000122070312)
UnionOperation11.Position = Vector3.new(-189.39202880859375, 6091.68603515625, -3.666167974472046)
UnionOperation11.Rotation = Vector3.new(-178.97000122070312, 90, 0)
UnionOperation11.Color = Color3.new(0, 0, 0)
UnionOperation11.Size = Vector3.new(0.46609997749328613, 0.8886861801147461, 0.15184633433818817)
UnionOperation11.BrickColor = BrickColor.new("Really black")
UnionOperation11.CanCollide = false
UnionOperation11.Material = Enum.Material.SmoothPlastic
UnionOperation11.brickColor = BrickColor.new("Really black")
UnionOperation11.UsePartColor = true
UnionOperation12.Parent = Model6
UnionOperation12.CFrame = CFrame.new(-189.398621, 6094.24121, -3.34983802, -4.32397673e-10, 1, 9.35557694e-08, -0.140306577, -9.2690982e-08, 0.990108013, 0.990107954, -1.26983899e-08, 0.140306562)
UnionOperation12.Orientation = Vector3.new(-81.93000030517578, 0, -90)
UnionOperation12.Position = Vector3.new(-189.39862060546875, 6094.2412109375, -3.3498380184173584)
UnionOperation12.Rotation = Vector3.new(-81.93000030517578, 0, -90)
UnionOperation12.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
UnionOperation12.Size = Vector3.new(0.638677716255188, 0.1386423110961914, 1.4755908250808716)
UnionOperation12.BrickColor = BrickColor.new("Really black")
UnionOperation12.CanCollide = false
UnionOperation12.Material = Enum.Material.SmoothPlastic
UnionOperation12.brickColor = BrickColor.new("Really black")
UnionOperation12.UsePartColor = true
MeshPart13.Name = "Meshes/AK-47 mag"
MeshPart13.Parent = Model6
MeshPart13.CFrame = CFrame.new(-189.404175, 6092.26709, -2.93439507, 0, -4.37113812e-08, 1, -0.99999994, 0, 0, 0, -0.999999881, -4.37113883e-08)
MeshPart13.Orientation = Vector3.new(0, 90, -90)
MeshPart13.Position = Vector3.new(-189.4041748046875, 6092.26708984375, -2.9343950748443604)
MeshPart13.Rotation = Vector3.new(-90, 90, 0)
MeshPart13.Color = Color3.new(0.105882, 0.164706, 0.207843)
MeshPart13.Size = Vector3.new(1.08330500125885, 1.1146513223648071, 0.16126202046871185)
MeshPart13.BrickColor = BrickColor.new("Black")
MeshPart13.CanCollide = false
MeshPart13.Material = Enum.Material.Glass
MeshPart13.brickColor = BrickColor.new("Black")
Part14.Parent = Model6
Part14.CFrame = CFrame.new(-189.400574, 6094.94727, -3.28234911, 0, -4.37113812e-08, 1, -0.99999994, 0, 0, 0, -0.999999881, -4.37113883e-08)
Part14.Orientation = Vector3.new(0, 90, -90)
Part14.Position = Vector3.new(-189.40057373046875, 6094.947265625, -3.282349109649658)
Part14.Rotation = Vector3.new(-90, 90, 0)
Part14.Color = Color3.new(0.105882, 0.164706, 0.207843)
Part14.Size = Vector3.new(0.09452936798334122, 0.5832487940788269, 0.13474586606025696)
Part14.BottomSurface = Enum.SurfaceType.Smooth
Part14.BrickColor = BrickColor.new("Black")
Part14.CanCollide = false
Part14.Material = Enum.Material.Glass
Part14.TopSurface = Enum.SurfaceType.Smooth
Part14.brickColor = BrickColor.new("Black")
BlockMesh15.Parent = Part14
BlockMesh15.Scale = Vector3.new(0.26218894124031067, 1, 1)
WedgePart16.Parent = Model6
WedgePart16.CFrame = CFrame.new(-189.368103, 6091.91016, -3.90715003, -2.64927422e-08, 1, 1.27599904e-07, -0.919146121, -7.4614448e-08, 0.393916696, 0.393916756, -1.06847018e-07, 0.919145882)
WedgePart16.Orientation = Vector3.new(-23.200000762939453, 0, -90)
WedgePart16.Position = Vector3.new(-189.36810302734375, 6091.91015625, -3.9071500301361084)
WedgePart16.Rotation = Vector3.new(-23.200000762939453, 0, -90)
WedgePart16.Color = Color3.new(0.105882, 0.164706, 0.207843)
WedgePart16.Size = Vector3.new(0.09452936798334122, 0.0945294052362442, 0.09452938288450241)
WedgePart16.BottomSurface = Enum.SurfaceType.Smooth
WedgePart16.BrickColor = BrickColor.new("Black")
WedgePart16.CanCollide = false
WedgePart16.Material = Enum.Material.Glass
WedgePart16.brickColor = BrickColor.new("Black")
SpecialMesh17.Parent = WedgePart16
SpecialMesh17.Scale = Vector3.new(0.5063340067863464, 0.022643180564045906, 0.46213141083717346)
SpecialMesh17.MeshType = Enum.MeshType.Wedge
WedgePart18.Parent = Model6
WedgePart18.CFrame = CFrame.new(-189.329285, 6093.3667, -3.38145399, -4.91238659e-08, 1, 1.30797773e-07, -0.992304265, -3.25500444e-08, -0.123823002, -0.12382298, -1.35873847e-07, 0.992304206)
WedgePart18.Orientation = Vector3.new(7.110000133514404, 0, -90)
WedgePart18.Position = Vector3.new(-189.32928466796875, 6093.36669921875, -3.3814539909362793)
WedgePart18.Rotation = Vector3.new(7.110000133514404, 0, -90)
WedgePart18.Color = Color3.new(0.627451, 0.372549, 0.207843)
WedgePart18.Size = Vector3.new(0.29886800050735474, 0.0945294052362442, 0.1622081995010376)
WedgePart18.BottomSurface = Enum.SurfaceType.Smooth
WedgePart18.BrickColor = BrickColor.new("Dark orange")
WedgePart18.CanCollide = false
WedgePart18.Material = Enum.Material.Wood
WedgePart18.brickColor = BrickColor.new("Dark orange")
SpecialMesh19.Parent = WedgePart18
SpecialMesh19.Scale = Vector3.new(1, 0.08243508636951447, 1)
SpecialMesh19.MeshType = Enum.MeshType.Wedge
Part20.Parent = Model6
Part20.CFrame = CFrame.new(-189.400208, 6091.87109, -3.87095594, 0, -4.37113812e-08, 1, -0.99999994, 0, 0, 0, -0.999999881, -4.37113883e-08)
Part20.Orientation = Vector3.new(0, 90, -90)
Part20.Position = Vector3.new(-189.40020751953125, 6091.87109375, -3.8709559440612793)
Part20.Rotation = Vector3.new(-90, 90, 0)
Part20.Color = Color3.new(0.105882, 0.164706, 0.207843)
Part20.Size = Vector3.new(0.09452936798334122, 0.0945294052362442, 0.09452938288450241)
Part20.BottomSurface = Enum.SurfaceType.Smooth
Part20.BrickColor = BrickColor.new("Black")
Part20.CanCollide = false
Part20.Material = Enum.Material.Glass
Part20.TopSurface = Enum.SurfaceType.Smooth
Part20.brickColor = BrickColor.new("Black")
BlockMesh21.Parent = Part20
BlockMesh21.Scale = Vector3.new(0.08129164576530457, 0.5404070019721985, 0.7018430233001709)
Part22.Parent = Model6
Part22.CFrame = CFrame.new(-189.392029, 6091.88721, -3.59260511, 4.3704361e-08, -7.83657583e-10, 1, -0.0179280043, -0.999839306, 0, 0.999839246, -0.0179280005, -4.37113883e-08)
Part22.Orientation = Vector3.new(0, 90, -178.97000122070312)
Part22.Position = Vector3.new(-189.39202880859375, 6091.88720703125, -3.5926051139831543)
Part22.Rotation = Vector3.new(-178.97000122070312, 90, 0)
Part22.Color = Color3.new(0.627451, 0.372549, 0.207843)
Part22.Size = Vector3.new(0.20845013856887817, 0.0945294052362442, 0.15184612572193146)
Part22.BottomSurface = Enum.SurfaceType.Smooth
Part22.BrickColor = BrickColor.new("Dark orange")
Part22.CanCollide = false
Part22.Material = Enum.Material.Sand
Part22.TopSurface = Enum.SurfaceType.Smooth
Part22.brickColor = BrickColor.new("Dark orange")
BlockMesh23.Parent = Part22
BlockMesh23.Scale = Vector3.new(1, 0.06526096910238266, 1)
WedgePart24.Parent = Part22
WedgePart24.CFrame = CFrame.new(-189.368103, 6091.90088, -3.90370202, -6.53696759e-08, 4.96822601e-08, -1, 0.863402188, 0.504516304, -3.13747996e-08, 0.504516244, -0.863402128, -7.58758247e-08)
WedgePart24.Orientation = Vector3.new(0, -90, 59.70000076293945)
WedgePart24.Position = Vector3.new(-189.36810302734375, 6091.90087890625, -3.9037020206451416)
WedgePart24.Rotation = Vector3.new(-59.70000076293945, -90, 0)
WedgePart24.Color = Color3.new(0.105882, 0.164706, 0.207843)
WedgePart24.Size = Vector3.new(0.09452936798334122, 0.0945294052362442, 0.09452938288450241)
WedgePart24.BottomSurface = Enum.SurfaceType.Smooth
WedgePart24.BrickColor = BrickColor.new("Black")
WedgePart24.CanCollide = false
WedgePart24.Material = Enum.Material.Metal
WedgePart24.brickColor = BrickColor.new("Black")
SpecialMesh25.Parent = WedgePart24
SpecialMesh25.Scale = Vector3.new(0.539990246295929, 0.49196791648864746, 0.022643184289336205)
SpecialMesh25.MeshType = Enum.MeshType.Wedge
Part26.Name = "Hole"
Part26.Parent = Model6
Part26.CFrame = CFrame.new(-189.391998, 6090.07764, -3.60206604, 1, 4.37113847e-08, -4.37113776e-08, 4.37113705e-08, -0.999999464, -4.23516474e-22, -4.37113776e-08, -1.91068462e-15, -0.999999464)
Part26.Orientation = Vector3.new(0, -180, 180)
Part26.Position = Vector3.new(-189.39199829101562, 6090.07763671875, -3.6020660400390625)
Part26.Rotation = Vector3.new(180, 0, 0)
Part26.Size = Vector3.new(0.05000000074505806, 0.050000011920928955, 0.05000000074505806)
Part26.BottomSurface = Enum.SurfaceType.Smooth
Part26.CanCollide = false
Part26.TopSurface = Enum.SurfaceType.Smooth
ParticleEmitter27.Parent = Part26
ParticleEmitter27.Speed = NumberRange.new(0.20000000298023224, 0.20000000298023224)
ParticleEmitter27.Rotation = NumberRange.new(-180, 180)
ParticleEmitter27.Color = ColorSequence.new(Color3.new(1, 0, 0),Color3.new(1, 0, 0))
ParticleEmitter27.LightEmission = 0.5
ParticleEmitter27.Texture = "http://www.roblox.com/asset/?id=304437537"
ParticleEmitter27.Transparency = NumberSequence.new(0.30000001192092896,0,1)
ParticleEmitter27.ZOffset = 0.20000000298023224
ParticleEmitter27.Size = NumberSequence.new(0.10000000149011612,0)
ParticleEmitter27.Acceleration = Vector3.new(0, 5, 0)
ParticleEmitter27.Lifetime = NumberRange.new(0.30000001192092896, 0.5)
ParticleEmitter27.Rate = 150
ParticleEmitter27.RotSpeed = NumberRange.new(-180, 180)
ParticleEmitter27.SpreadAngle = Vector2.new(360, 360)
ParticleEmitter27.VelocitySpread = 360
Model28.Name = "RightArm"
Model28.Parent = Model5
MeshPart29.Name = "REF"
MeshPart29.Parent = Model28
MeshPart29.CFrame = CFrame.new(-189.423828, 6094.30811, -3.02189589, 1, 0, 0, 0, 1, 0, 0, 0, 1)
MeshPart29.Position = Vector3.new(-189.423828125, 6094.30810546875, -3.0218958854675293)
MeshPart29.Color = Color3.new(0.972549, 0.972549, 0.972549)
MeshPart29.Transparency = 1
MeshPart29.Size = Vector3.new(1, 2, 1)
MeshPart29.BrickColor = BrickColor.new("Institutional white")
MeshPart29.CanCollide = false
MeshPart29.Material = Enum.Material.SmoothPlastic
MeshPart29.brickColor = BrickColor.new("Institutional white")
Script30.Name = "qPerfectionWeld"
Script30.Parent = Model5
table.insert(cors,sandbox(Script30,function()
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
local function CallOnChildren(Instance, FunctionToCall)
FunctionToCall(Instance)
for _, Child in next, Instance:GetChildren() do
CallOnChildren(Child, FunctionToCall)
end
end
local function GetNearestParent(Instance, ClassName)
local Ancestor = Instance
repeat
Ancestor = Ancestor.Parent
if Ancestor == nil then
return nil
end
until Ancestor:IsA(ClassName)
return Ancestor
end
local function GetBricks(StartInstance)
local List = {}
CallOnChildren(StartInstance, function(Item)
if Item:IsA("BasePart") then
List[#List+1] = Item;
end
end)
return List
end
local function Modify(Instance, Values)
assert(type(Values) == "table", "Values is not a table");
for Index, Value in next, Values do
if type(Index) == "number" then
Value.Parent = Instance
else
Instance[Index] = Value
end
end
return Instance
end
local function Make(ClassType, Properties)
return Modify(Instance.new(ClassType), Properties)
end
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
local function HasWheelJoint(Part)
for _, SurfaceName in pairs(Surfaces) do
for _, HingSurfaceName in pairs(HingSurfaces) do
if Part[SurfaceName].Name == HingSurfaceName then
return true
end
end
end
return false
end
local function ShouldBreakJoints(Part)
if NEVER_BREAK_JOINTS then
return false
end
if HasWheelJoint(Part) then
return false
end
local Connected = Part:GetConnectedParts()
if #Connected == 1 then
return false
end
for _, Item in pairs(Connected) do
if HasWheelJoint(Item) then
return false
elseif not Item:IsDescendantOf(script.Parent) then
return false
end
end
return true
end
local function WeldTogether(Part0, Part1, JointType, WeldParent)
JointType = JointType or "Weld"
local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
Modify(NewWeld, {
Name = "qCFrameWeldThingy";
Part0 = Part0;
Part1 = Part1;
C0 = CFrame.new();--Part0.CFrame:inverse();
C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
Parent = Part1;
})
if not RelativeValue then
RelativeValue = Make("CFrameValue", {
Parent = Part1;
Name = "qRelativeCFrameWeldValue";
Archivable = true;
Value = NewWeld.C1;
})
end
return NewWeld
end
local function WeldParts(Parts, MainPart, JointType)
for _, Part in pairs(Parts) do
if ShouldBreakJoints(Part) then
Part:BreakJoints()
end
end
for _, Part in pairs(Parts) do
if Part ~= MainPart then
WeldTogether(MainPart, Part, JointType, MainPart)
end
end
end
local function PerfectionWeld()
local Tool = GetNearestParent(script, "Tool")
local Parts = GetBricks(script.Parent)
local PrimaryPart = script.Parent.RightArm.REF
if PrimaryPart then
WeldParts(Parts, PrimaryPart, "Weld")
else
warn("qWeld - Unable to weld part")
end
return Tool
end
local Tool = PerfectionWeld()
if Tool and script.ClassName == "Script" then
script.Parent.AncestryChanged:connect(function()
PerfectionWeld()
end)
end
end))
Model31.Name = "Katana"
Model31.Parent = Folder0
Script32.Name = "qPerfectionWeld"
Script32.Parent = Model31
table.insert(cors,sandbox(Script32,function()
local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
local function CallOnChildren(Instance, FunctionToCall)
FunctionToCall(Instance)
for _, Child in next, Instance:GetChildren() do
CallOnChildren(Child, FunctionToCall)
end
end
local function GetNearestParent(Instance, ClassName)
local Ancestor = Instance
repeat
Ancestor = Ancestor.Parent
if Ancestor == nil then
return nil
end
until Ancestor:IsA(ClassName)
return Ancestor
end
local function GetBricks(StartInstance)
local List = {}
CallOnChildren(StartInstance, function(Item)
if Item:IsA("BasePart") then
List[#List+1] = Item;
end
end)
return List
end
local function Modify(Instance, Values)
assert(type(Values) == "table", "Values is not a table");
for Index, Value in next, Values do
if type(Index) == "number" then
Value.Parent = Instance
else
Instance[Index] = Value
end
end
return Instance
end
local function Make(ClassType, Properties)
return Modify(Instance.new(ClassType), Properties)
end
local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
local function HasWheelJoint(Part)
for _, SurfaceName in pairs(Surfaces) do
for _, HingSurfaceName in pairs(HingSurfaces) do
if Part[SurfaceName].Name == HingSurfaceName then
return true
end
end
end
return false
end
local function ShouldBreakJoints(Part)
if NEVER_BREAK_JOINTS then
return false
end
if HasWheelJoint(Part) then
return false
end
local Connected = Part:GetConnectedParts()
if #Connected == 1 then
return false
end
for _, Item in pairs(Connected) do
if HasWheelJoint(Item) then
return false
elseif not Item:IsDescendantOf(script.Parent) then
return false
end
end
return true
end
local function WeldTogether(Part0, Part1, JointType, WeldParent)
JointType = JointType or "Weld"
local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
Modify(NewWeld, {
Name = "qCFrameWeldThingy";
Part0 = Part0;
Part1 = Part1;
C0 = CFrame.new();--Part0.CFrame:inverse();
C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
Parent = Part1;
})
if not RelativeValue then
RelativeValue = Make("CFrameValue", {
Parent = Part1;
Name = "qRelativeCFrameWeldValue";
Archivable = true;
Value = NewWeld.C1;
})
end
return NewWeld
end
local function WeldParts(Parts, MainPart, JointType)
for _, Part in pairs(Parts) do
if ShouldBreakJoints(Part) then
Part:BreakJoints()
end
end
for _, Part in pairs(Parts) do
if Part ~= MainPart then
WeldTogether(MainPart, Part, JointType, MainPart)
end
end
end
local function PerfectionWeld()
local Tool = GetNearestParent(script, "Tool")
local Parts = GetBricks(script.Parent)
local PrimaryPart = script.Parent.RightArm.REF
if PrimaryPart then
WeldParts(Parts, PrimaryPart, "Weld")
else
warn("qWeld - Unable to weld part")
end
return Tool
end
local Tool = PerfectionWeld()
if Tool and script.ClassName == "Script" then
script.Parent.AncestryChanged:connect(function()
PerfectionWeld()
end)
end
end))
Model33.Name = "RightArm"
Model33.Parent = Model31
MeshPart34.Name = "REF"
MeshPart34.Parent = Model33
MeshPart34.CFrame = CFrame.new(-153.983353, 6091.48975, -0.226437807, 1, -4.41333764e-13, 7.10542736e-15, -4.41333764e-13, 1, 0, 7.10542736e-15, 0, 1)
MeshPart34.Position = Vector3.new(-153.9833526611328, 6091.48974609375, -0.22643780708312988)
MeshPart34.Color = Color3.new(0.972549, 0.972549, 0.972549)