View difference between Paste ID: 12Sk9Mi5 and cR4yktdr
SHOW: | | - or go back to the newest paste.
1
--https://github.com/Mokiros/roblox-FE-compatibility
2
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
3
local Player,game,owner = owner,game
4
local RealPlayer = Player
5
do
6
	print("FE Compatibility code V2 by Mokiros")
7
	local RealPlayer = RealPlayer
8
	script.Parent = RealPlayer.Character
9
10
	--Fake event to make stuff like Mouse.KeyDown work
11
	local Disconnect_Function = function(this)
12
		this[1].Functions[this[2]] = nil
13
	end
14
	local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
15
	local FakeEvent_Metatable = {__index={
16
		Connect = function(this,f)
17
			local i = tostring(math.random(0,10000))
18
			while this.Functions[i] do
19
				i = tostring(math.random(0,10000))
20
			end
21
			this.Functions[i] = f
22
			return setmetatable({this,i},Disconnect_Metatable)
23
		end
24
function clerp(c1,c2,al)
25
    local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
26
    local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
27
    for i,v in pairs(com1) do 
28
        com1[i] = v+(com2[i]-v)*al
29
    end
30
    return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
31
end
32
33
plr = game:service'Players'.LocalPlayer
34
plrgui = plr:findFirstChild'PlayerGui'
35
plrmouse = plr:GetMouse()
36
char = plr.Character
37
humanoid = char:findFirstChild("Humanoid")
38
torso = char:findFirstChild("Torso")
39
head = char.Head
40
ra = char:findFirstChild("Right Arm")
41
la = char:findFirstChild("Left Arm")
42
rl = char:findFirstChild("Right Leg")
43
ll = char:findFirstChild("Left Leg")
44
rs = torso:findFirstChild("Right Shoulder")
45
ls = torso:findFirstChild("Left Shoulder")
46
rh = torso:findFirstChild("Right Hip")
47
lh = torso:findFirstChild("Left Hip")
48
neck = torso:findFirstChild("Neck")
49
rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
50
rootpart = char:findFirstChild("HumanoidRootPart")
51
camera = workspace.CurrentCamera
52
anim = char:findFirstChild("Animate")
53
54
local rm = Instance.new("Weld")
55
rm.C0 = CFrame.new(1.5, 0.5, 0)
56
rm.C1 = CFrame.new(0, 0.5, 0)
57
rm.Part0 = torso
58
rm.Part1 = ra
59
rm.Name = 'Right Shoulder'
60
61
local lm = Instance.new("Weld")
62
lm.C0 = CFrame.new(-1.5, 0.5, 0)
63
lm.C1 = CFrame.new(0, 0.5, 0)
64
lm.Part0 = torso
65
lm.Part1 = la
66
lm.Name = 'Left Shoulder'
67
68
local tool = Instance.new('HopperBin', plr.Backpack)
69
tool.Name = 'Dual M1911'
70
71
function scan(parent)
72
    local parts,last = {}
73
        for _,v in pairs(parent:GetChildren()) do
74
            if (v:IsA("BasePart")) then
75
            v.Anchored = true
76
                if (last) then
77
                    local w = Instance.new("Weld")
78
                    w.Name = ("%s_Weld"):format(v.Name)
79
                    w.Part0,w.Part1 = last,v
80
                    w.C0 = last.CFrame:inverse()
81
                    w.C1 = v.CFrame:inverse()
82
                    w.Parent = last
83
                end
84
                last = v
85
                table.insert(parts,v)
86
            end
87
            scan(v)
88
        end
89
    for _,v in pairs(parts) do
90
        v.Anchored = false
91
        v.Locked = true
92
        v.CanCollide = false
93
    end
94
end
95
96
--1-Torso
97
holsters=Instance.new("Model")
98
holsters.Name="Torso"
99
holsters.Parent=char
100
--2-HolsterWeldTo2
101
obj2=Instance.new("Part")
102
obj2.CFrame=CFrame.new(Vector3.new(14.8519955,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
103
obj2.FormFactor=Enum.FormFactor.Custom
104
obj2.LeftSurface=10
105
obj2.Transparency=1
106
obj2.TopSurface=10
107
obj2.RightSurface=10
108
obj2.Material="SmoothPlastic"
109
obj2.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
110
obj2.FrontSurface=10
111
obj2.BottomSurface=10
112
obj2.BackSurface=10
113
obj2.BrickColor=BrickColor.new("Dark stone grey")
114
obj2.Name="HolsterWeldTo2"
115
obj2.Parent=holsters
116
--3-Mesh
117
obj3=Instance.new("BlockMesh")
118
obj3.Scale=Vector3.new(0.999499977,1,1)
119
obj3.Parent=obj2
120
--4-Belt
121
obj4=Instance.new("Part")
122
obj4.CFrame=CFrame.new(Vector3.new(13.6000061,1.49000156,35.8999977)) * CFrame.Angles(-1.4901162970204e-008,0,-0)
123
obj4.FormFactor=Enum.FormFactor.Custom
124
obj4.LeftSurface=10
125
obj4.TopSurface=10
126
obj4.RightSurface=10
127
obj4.Material="SmoothPlastic"
128
obj4.Size=Vector3.new(2,0.200000003,1)
129
obj4.FrontSurface=10
130
obj4.BottomSurface=10
131
obj4.BackSurface=10
132
obj4.BrickColor=BrickColor.new("Dark stone grey")
133
obj4.Name="Belt"
134
obj4.Parent=holsters
135
--5-Mesh
136
obj5=Instance.new("BlockMesh")
137
obj5.Scale=Vector3.new(1.10000002,1,1.10000002)
138
obj5.Parent=obj4
139
--6-Hold2
140
obj6=Instance.new("Part")
141
obj6.CFrame=CFrame.new(Vector3.new(14.8000011,1.0950017,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0)
142
obj6.FormFactor=Enum.FormFactor.Custom
143
obj6.LeftSurface=10
144
obj6.TopSurface=10
145
obj6.RightSurface=10
146
obj6.Material="SmoothPlastic"
147
obj6.Size=Vector3.new(0.400000006,1.00999999,0.600000024)
148
obj6.FrontSurface=10
149
obj6.BottomSurface=10
150
obj6.BackSurface=10
151
obj6.BrickColor=BrickColor.new("Dark stone grey")
152
obj6.Name="Hold2"
153
obj6.Parent=holsters
154
--7-TorsoWeld
155
obj7=Instance.new("Part")
156
obj7.CFrame=CFrame.new(Vector3.new(13.6000061,1.99000168,35.8999939)) * CFrame.Angles(-0,0,-0)
157
obj7.FormFactor=Enum.FormFactor.Custom
158
obj7.LeftSurface=10
159
obj7.Transparency=1
160
obj7.TopSurface=10
161
obj7.RightSurface=10
162
obj7.Size=Vector3.new(2,2,1)
163
obj7.FrontSurface=10
164
obj7.BottomSurface=10
165
obj7.BackSurface=10
166
obj7.BrickColor=BrickColor.new("Bright blue")
167
obj7.Name="TorsoWeld"
168
obj7.Parent=holsters
169
--8-HolsterWeldTo
170
obj8=Instance.new("Part")
171
obj8.CFrame=CFrame.new(Vector3.new(12.342,1.44200003,35.6479988)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
172
obj8.FormFactor=Enum.FormFactor.Custom
173
obj8.LeftSurface=10
174
obj8.Transparency=1
175
obj8.TopSurface=10
176
obj8.RightSurface=10
177
obj8.Material="SmoothPlastic"
178
obj8.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
179
obj8.FrontSurface=10
180
obj8.BottomSurface=10
181
obj8.BackSurface=10
182
obj8.BrickColor=BrickColor.new("Dark stone grey")
183
obj8.Name="HolsterWeldTo"
184
obj8.Parent=holsters
185
--9-Mesh
186
obj9=Instance.new("BlockMesh")
187
obj9.Scale=Vector3.new(0.999499977,1,1)
188
obj9.Parent=obj8
189
--10-Hold
190
obj10=Instance.new("Part")
191
obj10.CFrame=CFrame.new(Vector3.new(12.4000053,1.09500158,35.6999893)) * CFrame.Angles(0.26179936528206,0,-0)
192
obj10.FormFactor=Enum.FormFactor.Custom
193
obj10.LeftSurface=10
194
obj10.TopSurface=10
195
obj10.RightSurface=10
196
obj10.Material="SmoothPlastic"
197
obj10.Size=Vector3.new(0.400000006,1.00999999,0.600000024)
198
obj10.FrontSurface=10
199
obj10.BottomSurface=10
200
obj10.BackSurface=10
201
obj10.BrickColor=BrickColor.new("Dark stone grey")
202
obj10.Name="Hold"
203
obj10.Parent=holsters
204
holsters:MakeJoints()
205
scan(holsters)
206
207
--1-M1911
208
gun=Instance.new("Model")
209
gun.Name="M1911"
210
gun.Parent=char
211
--2-Handle
212
obj2=Instance.new("Part")
213
obj2.CFrame=CFrame.new(Vector3.new(12.3420238,1.86332655,36.3927727)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126)
214
obj2.FormFactor=Enum.FormFactor.Custom
215
obj2.LeftSurface=10
216
obj2.TopSurface=10
217
obj2.RightSurface=10
218
obj2.Material=Enum.Material.Wood
219
obj2.Size=Vector3.new(0.200000003,0.99999994,0.400000036)
220
obj2.FrontSurface=10
221
obj2.BottomSurface=10
222
obj2.BackSurface=10
223
obj2.BrickColor=BrickColor.new("Brown")
224
obj2.Name="Handle"
225
obj2.Parent=gun
226
--3-Decor
227
obj3=Instance.new("Part")
228
obj3.CFrame=CFrame.new(Vector3.new(12.3420143,2.28510284,35.9773712)) * CFrame.Angles(1.832595705986,0,-3.1415927410126)
229
obj3.FormFactor=Enum.FormFactor.Custom
230
obj3.LeftSurface=10
231
obj3.TopSurface=10
232
obj3.RightSurface=10
233
obj3.Material="SmoothPlastic"
234
obj3.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
235
obj3.FrontSurface=10
236
obj3.BottomSurface=10
237
obj3.BackSurface=10
238
obj3.BrickColor=BrickColor.new("Dark stone grey")
239
obj3.Name="Decor"
240
obj3.Parent=gun
241
--4-Mesh
242
obj4=Instance.new("BlockMesh")
243
obj4.Offset=Vector3.new(0,0.00999999978,0.0399999991)
244
obj4.Scale=Vector3.new(0.699999988,0.200000003,0.800000012)
245
obj4.Parent=obj3
246
--5-Decor
247
obj5=Instance.new("Part")
248
obj5.CFrame=CFrame.new(Vector3.new(12.3420143,1.46716928,35.8617401)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
249
obj5.FormFactor=Enum.FormFactor.Custom
250
obj5.LeftSurface=10
251
obj5.TopSurface=10
252
obj5.RightSurface=10
253
obj5.Material="SmoothPlastic"
254
obj5.Size=Vector3.new(0.200000003,0.400000006,0.200000003)
255
obj5.FrontSurface=10
256
obj5.BottomSurface=10
257
obj5.BackSurface=10
258
obj5.BrickColor=BrickColor.new("Dark stone grey")
259
obj5.Name="Decor"
260
obj5.Parent=gun
261
--6-Mesh
262
obj6=Instance.new("BlockMesh")
263
obj6.Scale=Vector3.new(0.600000024,1,0.200000003)
264
obj6.Parent=obj5
265
--7-Decor
266
obj7=Instance.new("Part")
267
obj7.CFrame=CFrame.new(Vector3.new(12.3420124,1.55429673,36.0928192)) * CFrame.Angles(0.45686540007591,-1.1175870895386e-008,3.141592502594)
268
obj7.FormFactor=Enum.FormFactor.Custom
269
obj7.LeftSurface=10
270
obj7.TopSurface=10
271
obj7.RightSurface=10
272
obj7.Material="SmoothPlastic"
273
obj7.Size=Vector3.new(0.200000003,0.310000002,0.200000003)
274
obj7.FrontSurface=10
275
obj7.BottomSurface=10
276
obj7.BackSurface=10
277
obj7.BrickColor=BrickColor.new("Dark stone grey")
278
obj7.Name="Decor"
279
obj7.Parent=gun
280
--8-Mesh
281
obj8=Instance.new("BlockMesh")
282
obj8.Scale=Vector3.new(0.600000024,1,0.200000003)
283
obj8.Parent=obj7
284
--9-Decor
285
obj9=Instance.new("Part")
286
obj9.CFrame=CFrame.new(Vector3.new(12.3420258,2.21372294,35.8965569)) * CFrame.Angles(0.76370096206665,-1.4901161193848e-008,-3.1415927410126)
287
obj9.FormFactor=Enum.FormFactor.Custom
288
obj9.LeftSurface=10
289
obj9.TopSurface=10
290
obj9.RightSurface=10
291
obj9.Material="SmoothPlastic"
292
obj9.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
293
obj9.FrontSurface=10
294
obj9.BottomSurface=10
295
obj9.BackSurface=10
296
obj9.BrickColor=BrickColor.new("Dark stone grey")
297
obj9.Name="Decor"
298
obj9.Parent=gun
299
--10-Mesh
300
obj10=Instance.new("BlockMesh")
301
obj10.Scale=Vector3.new(0.400000006,0.200000003,1)
302
obj10.Parent=obj9
303
--11-Decor
304
obj11=Instance.new("Part")
305
obj11.CFrame=CFrame.new(Vector3.new(12.3420229,1.8633275,36.2927704)) * CFrame.Angles(1.5707963705063,-4.4703483581543e-008,3.1415927410126)
306
obj11.FormFactor=Enum.FormFactor.Custom
307
obj11.LeftSurface=10
308
obj11.TopSurface=10
309
obj11.RightSurface=10
310
obj11.Material="SmoothPlastic"
311
obj11.Size=Vector3.new(0.200000003,1.20000005,0.400000036)
312
obj11.FrontSurface=10
313
obj11.BottomSurface=10
314
obj11.BackSurface=10
315
obj11.BrickColor=BrickColor.new("Dark stone grey")
316
obj11.Name="Decor"
317
obj11.Parent=gun
318
--12-Mesh
319
obj12=Instance.new("BlockMesh")
320
obj12.Offset=Vector3.new(0,-0.0700000003,0)
321
obj12.Scale=Vector3.new(0.995000005,0.949999988,1.20000005)
322
obj12.Parent=obj11
323
--13-Decor
324
obj13=Instance.new("Part")
325
obj13.CFrame=CFrame.new(Vector3.new(12.3420258,2.30202365,35.8373909)) * CFrame.Angles(1.756756901741,-1.0430812835693e-007,3.1415927410126)
326
obj13.FormFactor=Enum.FormFactor.Custom
327
obj13.LeftSurface=10
328
obj13.TopSurface=10
329
obj13.RightSurface=10
330
obj13.Material="SmoothPlastic"
331
obj13.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
332
obj13.FrontSurface=10
333
obj13.BottomSurface=10
334
obj13.BackSurface=10
335
obj13.BrickColor=BrickColor.new("Dark stone grey")
336
obj13.Name="Decor"
337
obj13.Parent=gun
338
--14-Mesh
339
obj14=Instance.new("BlockMesh")
340
obj14.Scale=Vector3.new(0.400000006,0.200000003,0.400000006)
341
obj14.Parent=obj13
342
--15-BulletCase
343
obj15=Instance.new("Part")
344
obj15.CFrame=CFrame.new(Vector3.new(12.3420229,1.44165683,35.6482697)) * CFrame.Angles(1.8325955867767,-1.4901161193848e-008,-3.1415927410126)
345
obj15.FormFactor=Enum.FormFactor.Custom
346
obj15.LeftSurface=10
347
obj15.TopSurface=10
348
obj15.RightSurface=10
349
obj15.Material="SmoothPlastic"
350
obj15.Size=Vector3.new(0.200000003,0.200000003,1.60000014)
351
obj15.FrontSurface=10
352
obj15.BottomSurface=10
353
obj15.BackSurface=10
354
obj15.BrickColor=BrickColor.new("Dark stone grey")
355
obj15.Name="BulletCase"
356
obj15.Parent=gun
357
--16-Mesh
358
obj16=Instance.new("BlockMesh")
359
obj16.Scale=Vector3.new(0.999499977,1,1)
360
obj16.Parent=obj15
361
--17-Flashlight
362
obj17=Instance.new("Part")
363
obj17.CFrame=CFrame.new(Vector3.new(12.3420115,0.729269207,35.601902)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
364
obj17.FormFactor=Enum.FormFactor.Custom
365
obj17.LeftSurface=10
366
obj17.TopSurface=10
367
obj17.RightSurface=10
368
obj17.Material="SmoothPlastic"
369
obj17.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
370
obj17.FrontSurface=10
371
obj17.BottomSurface=10
372
obj17.BackSurface=10
373
obj17.BrickColor=BrickColor.new("Pastel yellow")
374
obj17.Name="Flashlight"
375
obj17.Parent=gun
376
--18-Mesh
377
obj18=Instance.new("CylinderMesh")
378
obj18.Offset=Vector3.new(0,0,0.0500000007)
379
obj18.Scale=Vector3.new(0.5,1.01999998,0.5)
380
obj18.Parent=obj17
381
--19-Decor
382
obj19=Instance.new("Part")
383
obj19.CFrame=CFrame.new(Vector3.new(12.3420143,2.1178081,35.8290215)) * CFrame.Angles(1.832595705986,0,-3.1415927410126)
384
obj19.FormFactor=Enum.FormFactor.Custom
385
obj19.LeftSurface=10
386
obj19.TopSurface=10
387
obj19.RightSurface=10
388
obj19.Material="SmoothPlastic"
389
obj19.Size=Vector3.new(0.200000003,0.400000036,0.200000003)
390
obj19.FrontSurface=10
391
obj19.BottomSurface=10
392
obj19.BackSurface=10
393
obj19.BrickColor=BrickColor.new("Black")
394
obj19.Name="Decor"
395
obj19.Parent=gun
396
--20-Mesh
397
obj20=Instance.new("BlockMesh")
398
obj20.Scale=Vector3.new(0.5,0.5,1.10000002)
399
obj20.Parent=obj19
400
--21-Decor
401
obj21=Instance.new("Part")
402
obj21.CFrame=CFrame.new(Vector3.new(12.2895117,2.05304575,35.6843338)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126)
403
obj21.FormFactor=Enum.FormFactor.Custom
404
obj21.LeftSurface=10
405
obj21.TopSurface=10
406
obj21.RightSurface=10
407
obj21.Material="SmoothPlastic"
408
obj21.Size=Vector3.new(0.399999976,0.200000003,0.200000003)
409
obj21.FrontSurface=10
410
obj21.BottomSurface=10
411
obj21.BackSurface=10
412
obj21.BrickColor=BrickColor.new("Dark stone grey")
413
obj21.Name="Decor"
414
obj21.Parent=gun
415
--22-Mesh
416
obj22=Instance.new("SpecialMesh")
417
obj22.MeshType=Enum.MeshType.Wedge
418
obj22.Scale=Vector3.new(1,0.25,0.50999999)
419
obj22.Parent=obj21
420
--23-Decor
421
obj23=Instance.new("Part")
422
obj23.CFrame=CFrame.new(Vector3.new(12.3420172,1.41577363,35.744442)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
423
obj23.FormFactor=Enum.FormFactor.Custom
424
obj23.LeftSurface=10
425
obj23.TopSurface=10
426
obj23.RightSurface=10
427
obj23.Material="SmoothPlastic"
428
obj23.Size=Vector3.new(0.200000003,1.60000002,0.200000003)
429
obj23.FrontSurface=10
430
obj23.BottomSurface=10
431
obj23.BackSurface=10
432
obj23.BrickColor=BrickColor.new("Dark stone grey")
433
obj23.Name="Decor"
434
obj23.Parent=gun
435
--24-Mesh
436
obj24=Instance.new("CylinderMesh")
437
obj24.Parent=obj23
438
--25-ShellCaseSpawner
439
obj25=Instance.new("Part")
440
obj25.CFrame=CFrame.new(Vector3.new(12.3420172,1.75731552,35.6289024)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
441
obj25.FormFactor=Enum.FormFactor.Custom
442
obj25.LeftSurface=10
443
obj25.TopSurface=10
444
obj25.RightSurface=10
445
obj25.Material="SmoothPlastic"
446
obj25.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
447
obj25.FrontSurface=10
448
obj25.BottomSurface=10
449
obj25.BackSurface=10
450
obj25.Name="ShellCaseSpawner"
451
obj25.Parent=gun
452
--26-Mesh
453
obj26=Instance.new("CylinderMesh")
454
obj26.Offset=Vector3.new(0.0149999997,0,-0.0350000001)
455
obj26.Scale=Vector3.new(0.75,1,0.75)
456
obj26.Parent=obj25
457
--27-Decor
458
obj27=Instance.new("Part")
459
obj27.CFrame=CFrame.new(Vector3.new(12.3420115,0.765501678,35.4666672)) * CFrame.Angles(-2.8797931671143,-1.7763568394003e-015,-3.1415927410126)
460
obj27.FormFactor=Enum.FormFactor.Custom
461
obj27.LeftSurface=10
462
obj27.TopSurface=10
463
obj27.RightSurface=10
464
obj27.Material="SmoothPlastic"
465
obj27.Size=Vector3.new(0.200000003,0.200000003,0.200000003)
466
obj27.FrontSurface=10
467
obj27.BottomSurface=10
468
obj27.BackSurface=10
469
obj27.BrickColor=BrickColor.new("Black")
470
obj27.Name="Decor"
471
obj27.Parent=gun
472
--28-Mesh
473
obj28=Instance.new("CylinderMesh")
474
obj28.Offset=Vector3.new(0,0,0.0500000007)
475
obj28.Scale=Vector3.new(0.5,1.01999998,0.5)
476
obj28.Parent=obj27
477
--29-Decor
478
obj29=Instance.new("Part")
479
obj29.CFrame=CFrame.new(Vector3.new(12.3920164,1.4734931,35.5290413)) * CFrame.Angles(-1.3089969158173,-1.5701057910919,-0)
480
obj29.FormFactor=Enum.FormFactor.Custom
481
obj29.LeftSurface=10
482
obj29.TopSurface=10
483
obj29.RightSurface=10
484
obj29.Material="SmoothPlastic"
485
obj29.Size=Vector3.new(1.60000002,0.200000003,0.200000003)
486
obj29.FrontSurface=10
487
obj29.BottomSurface=10
488
obj29.BackSurface=10
489
obj29.BrickColor=BrickColor.new("Dark stone grey")
490
obj29.Name="Decor"
491
obj29.Parent=gun
492
--30-Mesh
493
obj30=Instance.new("SpecialMesh")
494
obj30.MeshType=Enum.MeshType.Wedge
495
obj30.Scale=Vector3.new(1,0.25,0.5)
496
obj30.Parent=obj29
497
--31-Decor
498
obj31=Instance.new("Part")
499
obj31.CFrame=CFrame.new(Vector3.new(12.2895117,1.18371284,35.4513969)) * CFrame.Angles(1.832595705986,1.5699505805969,-3.1415927410126)
500
obj31.FormFactor=Enum.FormFactor.Custom
501
obj31.LeftSurface=10
502
obj31.TopSurface=10
503
obj31.RightSurface=10
504
obj31.Material="SmoothPlastic"
505
obj31.Size=Vector3.new(1,0.200000003,0.200000003)
506
obj31.FrontSurface=10
507
obj31.BottomSurface=10
508
obj31.BackSurface=10
509
obj31.BrickColor=BrickColor.new("Dark stone grey")
510
obj31.Name="Decor"
511
obj31.Parent=gun
512
--32-Mesh
513
obj32=Instance.new("SpecialMesh")
514
obj32.MeshType=Enum.MeshType.Wedge
515
obj32.Scale=Vector3.new(1,0.25,0.50999999)
516
obj32.Parent=obj31
517
gun:MakeJoints()
518
scan(gun)
519
520
local gun2 = gun:clone()
521
gun2.Parent = char
522
523
local torsoweld = Instance.new('Weld', char)
524
torsoweld.Part0 = torso
525
torsoweld.Part1 = holsters.TorsoWeld
526
torsoweld.C1 = CFrame.Angles(0,math.pi,0)
527
528
local gunweld = Instance.new('Weld', char)
529
gunweld.Part0 = gun.BulletCase
530
gunweld.Part1 = holsters.HolsterWeldTo
531
532
local gunweld2 = Instance.new('Weld', char)
533
gunweld2.Part0 = gun2.BulletCase
534
gunweld2.Part1 = holsters.HolsterWeldTo2
535
536
local bodygyro = Instance.new('BodyGyro')
537
bodygyro.maxTorque = Vector3.new(14e16,14e16,14e16)
538
bodygyro.P = 15000
539
540
local rsc0 = rm.C0
541
local lsc0 = lm.C0
542
local angle = 0
543
local anglespeed = .5
544
local speed = .3
545
local side = 0
546
local Equipped = false
547
local origneckc0 = neck.C0
548
local origneckc1 = neck.C1
549
local neckc0 = CFrame.new(0, 1, 0)
550
local firing = false
551
local pistol = 1
552
local light = false
553
554
local gunlight = Instance.new('SpotLight', gun.Flashlight)
555
gunlight.Range = 40
556
gunlight.Angle = 60
557
gunlight.Face = 'Bottom'
558
gunlight.Shadows = true
559
gunlight.Enabled = false
560
561
local gunlight2 = gunlight:clone()
562
gunlight2.Parent = gun2.Flashlight
563
564
local fire = Instance.new('Sound', head)
565
fire.SoundId = "rbxassetid://132373536"
566
fire.Volume = 1
567
568
local reload = Instance.new('Sound', head)
569
reload.SoundId = "rbxassetid://138109513"
570
reload.Volume = 1
571
572
local ammo = 14
573
local scrgui = Instance.new('ScreenGui', plrgui)
574
scrgui.Name = 'DualGunsGui'
575
576
local ammonution = Instance.new('TextLabel', scrgui)
577
ammonution.Size = UDim2.new(0,150,0,50)
578
ammonution.Position = UDim2.new(1, -250, 1, -70)
579
ammonution.BackgroundTransparency = 1
580
ammonution.TextColor3 = Color3.new(1,1,1)
581
ammonution.TextStrokeTransparency = .1
582
ammonution.Text = ('| '):rep(ammo)
583
ammonution.TextXAlignment = 'Right'
584
ammonution.ZIndex = 2
585
ammonution.FontSize = 'Size18'
586
587
local ammonution2 = Instance.new('TextLabel', scrgui)
588
ammonution2.Size = UDim2.new(0,150,0,50)
589
ammonution2.Position = UDim2.new(1, -250, 1, -70)
590
ammonution2.BackgroundTransparency = 1
591
ammonution2.TextColor3 = Color3.new(.5,.5,.5)
592
ammonution2.TextStrokeTransparency = .1
593
ammonution2.TextXAlignment = 'Right'
594
ammonution2.Text = ('| '):rep(ammo)
595
ammonution2.FontSize = 'Size18'
596
597
local rel = Instance.new('TextButton', scrgui)
598
rel.Size = UDim2.new(0,500,0,250)
599
rel.Position = UDim2.new(.5, -250, .8, -250)
600
rel.BackgroundTransparency = 1
601
rel.TextColor3 = Color3.new(.7,0,0)
602
rel.Visible = false
603
rel.Text = 'Reload (r)'
604
rel.FontSize = 'Size24'
605
606
rel.MouseButton1Down:connect(function()
607
            if ammo >= 14 or firing then return end
608
            dontclerpneck = true
609
            firing = true
610
            local dropammo = gun.Handle:clone()
611
            dropammo:ClearAllChildren()
612
            dropammo.CanCollide = true
613
            dropammo.BrickColor = BrickColor.Black()
614
            dropammo.Parent = workspace
615
            dropammo.CFrame = gun.Handle.CFrame
616
            local dropammo2 = dropammo:clone()
617
            dropammo2.Parent = workspace
618
            dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0)
619
            game:service'Debris':AddItem(dropammo,15)
620
            game:service'Debris':AddItem(dropammo2,15)
621
            wait(.5)
622
            reload:play()
623
            for i = 1, 65 do
624
                firing = true
625
                rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
626
                lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2)
627
                lm.C0 = clerp(lm.C0,lscf,speed)
628
                rm.C0 = clerp(rm.C0,rscf,speed)
629
                game:service'RunService'.RenderStepped:wait()
630
            end
631
            reload:play()
632
            for i = 1, 65 do
633
                firing = true
634
                rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2)
635
                lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0)
636
                lm.C0 = clerp(lm.C0,lscf,speed)
637
                rm.C0 = clerp(rm.C0,rscf,speed)
638
                game:service'RunService'.RenderStepped:wait()
639
            end
640
            dontclerpneck = false
641
            firing = false
642
            ammo = 14
643
            ammonution.Text = ('| '):rep(ammo)
644
end)
645
tool.Selected:connect(function(mouse)
646
	Equipped = true
647
    bodygyro.Parent = torso
648
    bodygyro.cframe = torso.CFrame
649
    rs.Parent = nil
650
    ls.Parent = nil
651
	rm.Parent = torso
652
	lm.Parent = torso
653
    neck.C0 = CFrame.new(0, 1, 0)
654
    neck.C1 = CFrame.new(0, -0.5, 0)
655
    gunweld.Part0 = gun.Handle
656
    gunweld2.Part0 = gun2.Handle
657
    gunweld.Part1 = ra
658
    gunweld2.Part1 = la
659
    gunweld.C1 = CFrame.new(0, -.8, 0)
660
    gunweld.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi)
661
    gunweld2.C1 = CFrame.new(0, -.8, 0)
662
    gunweld2.C0 = CFrame.Angles(math.pi/2-math.rad(15), 0, math.pi)
663
    mouse.KeyDown:connect(function(k)
664
        if k == "r" then
665
            if ammo >= 14 or firing then return end
666
            dontclerpneck = true
667
            firing = true
668
            local dropammo = gun.Handle:clone()
669
            dropammo:ClearAllChildren()
670
            dropammo.CanCollide = true
671
            dropammo.BrickColor = BrickColor.Black()
672
            dropammo.Parent = workspace
673
            dropammo.CFrame = gun.Handle.CFrame
674
            local dropammo2 = dropammo:clone()
675
            dropammo2.Parent = workspace
676
            dropammo2.CFrame = gun2.Handle.CFrame * CFrame.new(0, -.5, 0)
677
            game:service'Debris':AddItem(dropammo,15)
678
            game:service'Debris':AddItem(dropammo2,15)
679
            wait(.5)
680
            reload:play()
681
            for i = 1, 65 do
682
                firing = true
683
                rscf = rsc0 * CFrame.Angles(math.pi/2, 0, 0)
684
                lscf = lsc0 * CFrame.new(1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, math.rad(30), math.pi/3.2)
685
                lm.C0 = clerp(lm.C0,lscf,speed)
686
                rm.C0 = clerp(rm.C0,rscf,speed)
687
                game:service'RunService'.RenderStepped:wait()
688
            end
689
            reload:play()
690
            for i = 1, 65 do
691
                firing = true
692
                rscf = rsc0 * CFrame.new(-1.2, 0, -.4) * CFrame.Angles(math.pi/4 + math.sin(angle)*math.random()/20, -math.rad(30), -math.pi/3.2)
693
                lscf = lsc0 * CFrame.Angles(math.pi/2, 0, 0)
694
                lm.C0 = clerp(lm.C0,lscf,speed)
695
                rm.C0 = clerp(rm.C0,rscf,speed)
696
                game:service'RunService'.RenderStepped:wait()
697
            end
698
            dontclerpneck = false
699
            firing = false
700
            ammo = 14
701
            ammonution.Text = ('| '):rep(ammo)
702
        end
703
        if k == "f" then
704
            light = not light
705
            local sound = Instance.new('Sound', head)
706
            sound.SoundId = "rbxassetid://115959318"
707
            sound.Volume = 1
708
            sound:play()
709
            game:service'Debris':AddItem(sound,1)
710
        end
711
    end)
712
	mouse.Button1Down:connect(function()
713
        if ammo <= 0 then
714
            local sound = Instance.new('Sound', head)
715
            sound.SoundId = "rbxassetid://132464034"
716
            sound.Volume = 1
717
            sound:play()
718
            game:service'Debris':AddItem(sound,1)
719
        end
720
        if firing or ammo <= 0 then return end
721
        ammo = ammo - 1
722
        ammonution.Text = ('| '):rep(ammo)
723
        firing = true
724
            local pa = Instance.new('Part')
725
            pa.CanCollide = false
726
            pa.Anchored = true
727
            pa.Locked = true
728
            pa.FormFactor = 'Custom'
729
            pa.BrickColor = BrickColor.new('New Yeller')
730
            pa.Size = Vector3.new(.2,3,.2)
731
            Instance.new('BlockMesh', pa).Scale = Vector3.new(.2,3,.2)
732
            local thegun
733
            if pistol == 1 then
734
                thegun = gun.BulletCase
735
            elseif pistol == 2 then
736
                thegun = gun2.BulletCase
737
            end
738
            local muzzle = Instance.new('PointLight', thegun)
739
            muzzle.Range = 12
740
            muzzle.Color = Color3.new(1,.6,.1)
741
            game:service'Debris':AddItem(muzzle, .05)
742
            local shell = pa:clone()
743
            shell:ClearAllChildren()
744
            shell.Anchored = false
745
            shell.CFrame = thegun.Parent.ShellCaseSpawner.CFrame
746
            shell.Size = Vector3.new(.2,.5,.2)
747
            shell.Parent = workspace
748
            shell.BrickColor = BrickColor.new('Bright yellow')
749
            shell.CanCollide = true
750
            game:service'Debris':AddItem(shell, 5)
751
            local bulletpos = thegun.Position
752
            local bulletvelocity = (mouse.Hit.p - bulletpos).unit*15
753
            local lastbulletpos = thegun.Position 
754
            fire:play()
755
            coroutine.wrap(function()
756
                while game:service'RunService'.Stepped:wait() do
757
                    lastbulletpos = bulletpos 
758
                    bulletpos = bulletpos + bulletvelocity
759
                    local RayCast = Ray.new(lastbulletpos, (bulletpos - lastbulletpos))
760
                    local hit, hitpos = workspace:FindPartOnRay(RayCast, char)
761
                    if (torso.Position - pa.Position).magnitude > 800 then
762
                        pa:Destroy()
763
                        break
764
                    end
765
                    pa.Anchored = true
766
                    pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
767
                    if hit then
768
                        local damage
769
                        local sound = Instance.new('Sound', pa)
770
                        sound.SoundId = "rbxassetid://166423137"
771
                        sound.Pitch = 1.2+math.random()/3
772
                        sound.Volume = 1
773
                        sound:play()
774
                        pa:Destroy()
775
                        game:service'Debris':AddItem(sound,4)
776
                        local ray = Ray.new(rootpart.Position, Vector3.new(0, -6, 0))
777
                        local hitz, enz = workspace:FindPartOnRay(ray, char)
778
                        local hum = hit and hit.Parent and hit.Parent:findFirstChild'Humanoid'
779
                        if hum then
780
                            damage = math.random(5,10)
781
                            hum:TakeDamage(damage)
782
                        end
783
                        local hum = hit and hit.Parent and hit.Parent.Parent and hit.Parent.Parent:findFirstChild'Humanoid'
784
                        if hum then
785
                            damage = math.random(5,10)
786
                            hum:TakeDamage(damage)
787
                        end
788
                        break
789
                    end
790
                    pa.Anchored = true
791
                    pa.Parent = char
792
                    pa.CFrame = CFrame.new(bulletpos, bulletpos+bulletvelocity) * CFrame.Angles(math.pi/2, 0, 0)
793
                end
794
            end)()
795
796
        if pistol == 1 then
797
            pistol = 2
798
            for i = 1, 4 do
799
                rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
800
    	        lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
801
                lm.C0 = clerp(lm.C0,lscf,speed)
802
                rm.C0 = clerp(rm.C0,rscf,speed)
803
                game:service'RunService'.RenderStepped:wait()
804
            end
805
        elseif pistol == 2 then
806
            for i = 1, 4 do
807
                rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
808
                lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.new(0, 0, .5) * CFrame.Angles(math.pi/1.5 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
809
                lm.C0 = clerp(lm.C0,lscf,speed)
810
                rm.C0 = clerp(rm.C0,rscf,speed)
811
                game:service'RunService'.RenderStepped:wait()
812
            end
813
            pistol = 1
814
        end
815
        firing = false
816
    end)
817
end)
818
tool.Deselected:connect(function()
819
	Equipped = false
820
    rm.Parent = nil
821
    lm.Parent = nil
822
	rs.Parent = torso
823
	ls.Parent = torso
824
    neck.C0 = origneckc0
825
    neck.C1 = origneckc1
826
	lm.C0 = lsc0
827
	rm.C0 = rsc0
828
    gunweld.Part0 = gun.BulletCase
829
    gunweld.Part1 = holsters.HolsterWeldTo
830
    gunweld.C0 = CFrame.new()
831
    gunweld.C1 = CFrame.new()
832
    gunweld2.Part0 = gun2.BulletCase
833
    gunweld2.Part1 = holsters.HolsterWeldTo2
834
    gunweld2.C0 = CFrame.new()
835
    gunweld2.C1 = CFrame.new()
836
    bodygyro.Parent = nil
837
end)
838
839
game:service'RunService'.RenderStepped:connect(function()
840
	if Equipped then
841
        if ammo <= 0 then
842
            rel.Visible = true
843
        else
844
            rel.Visible = false
845
        end
846
        if light then
847
            gunlight.Enabled = true
848
            gunlight2.Enabled = true
849
        else
850
            gunlight.Enabled = false
851
            gunlight2.Enabled = false
852
        end
853
		angle = angle + (0.05+math.random()/20)
854
        local rscf = rsc0
855
        local lscf = lsc0
856
        local ncf = neckc0
857
        local rmx,rmy,rmz = rm.C0:toEulerAnglesXYZ()
858
        if rmz >= 1 then
859
            bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0)
860
        elseif rmz <= -1 then
861
            bodygyro.cframe = bodygyro.cframe * CFrame.Angles(0, -rmz/5, 0)
862
        end
863
    	rscf = CFrame.new(Vector3.new(rsc0.x, rsc0.y, rsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, math.cos(angle)*math.random()/20)
864
    	lscf = CFrame.new(Vector3.new(lsc0.x, lsc0.y, lsc0.z), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p)) * CFrame.Angles(math.pi/2 + math.sin(angle)*math.random()/20, 0, -math.cos(angle)*math.random()/20)
865
        ncf = neckc0 * CFrame.new(Vector3.new(), torso.CFrame:pointToObjectSpace(plrmouse.Hit.p))
866
        if not firing then
867
        	lm.C0 = clerp(lm.C0,lscf,speed)
868
        	rm.C0 = clerp(rm.C0,rscf,speed)
869
        end
870
        if not dontclerpneck then
871
            neck.C0 = clerp(neck.C0,ncf,speed)
872
        end
873
	end
874
    if light and not Equipped then
875
        gunlight.Enabled = false
876
        gunlight2.Enabled = false
877
    end
878
end)