View difference between Paste ID: 6QezTQuF and ZrGHze8W
SHOW: | | - or go back to the newest paste.
1
--[[
2
Colt Model 1911 .45, Commonly known as the M1911 or Colt .45. 
3
The most common handgun in the world, and also one of the most reliable.
4
It's legendary functionality is reinforced by the .45 ACP round, allowing the 
5
M1911 to pack a lot of firepower. The M1911 is also known for its ability to have an 
6
extremely accurate first shot out of the holster, since it can be chambered, 
7
with the hammer back, while in a holster. The well-places saftey allows the user to 
8
draw and turn it off in one swift motion, allowing for amazing personal defense 
9
applications.
10
--]]
11
12
13
if script == nil then return end
14
15
16
Player = game:GetService("Players").LocalPlayer
17
Char = Player.Character
18
Anims = Char:FindFirstChild("Animate")
19
Anims:remove()
20
Name = "Operator"
21
MC = BrickColor.new("Really black")
22
GC = BrickColor.new("Really black")
23
SC = BrickColor.new("White")
24-
Spread = 9000000
24+
Spread = 0
25
MR = 0.02
26-
MagSize = 8
26+
MagSize = 10
27
Chamber = 1
28
canHit = false
29
melee = true
30
Hammer = true
31
selected = false
32
canDual = true
33
dual = false
34
Button1Down = false
35-
damage = 20
35+
damage = 999999999999999999999999999
36
canFire = true
37
canFire2 = false
38
readyTime = 0.1
39
automatic = false
40
burst = false
41
burstCount = 0
42
burstCountMax = 3
43
canSilence = true
44
silenced = false
45
canZoom = false
46
zoom = false
47
switchToSingle = false
48
switchToBurst = false
49
switchToAutomatic = false
50
51
52
ammoGui = Instance.new("ScreenGui")
53
ammoGui.Name = Name
54
local frame = Instance.new("Frame")
55
frame.Name = "Frame"
56
frame.Size = UDim2.new(0, 165, 0, 60)
57
frame.Position = UDim2.new(0, 0, 1, -400)
58
frame.BackgroundColor3 = Color3.new(1, 1, 1)
59
frame.BorderColor3 = Color3.new(0, 0, 0)
60
frame.Parent = ammoGui
61
local label = Instance.new("TextLabel")
62
label.Name = "Weapon"
63
label.Text = "Weapon: " ..Name
64
label.Size = UDim2.new(1, 0, 0, 20)
65
label.Position = UDim2.new(0, 0, 0, 0)
66
label.BackgroundColor3 = Color3.new(1, 0, 0)
67
label.BorderColor3 = Color3.new(0, 0, 0)
68
label.Parent = frame
69
local label = Instance.new("TextLabel")
70
label.Name = "MagazinePrefix"
71
label.Text = "    Magazine:"
72
label.TextXAlignment = "Left"
73
label.Size = UDim2.new(1, 0, 0, 20)
74
label.Position = UDim2.new(0, 0, 0, 20)
75
label.BackgroundColor3 = Color3.new(1, 1, 1)
76
label.BorderColor3 = Color3.new(0, 0, 0)
77
label.Parent = frame
78
local label = Instance.new("TextLabel")
79
label.Name = "Magazine"
80
label.Text = "0/0"
81
label.TextXAlignment = "Right"
82
label.Size = UDim2.new(1, 0, 0, 20)
83
label.Position = UDim2.new(0, -10, 0, 20)
84
label.BackgroundTransparency = 1
85
label.BorderSizePixel = 0
86
label.Parent = frame
87
local label = Instance.new("TextLabel")
88
label.Name = "AmmoPrefix"
89
label.Text = "    .45 ACP:"
90
label.TextXAlignment = "Left"
91
label.Size = UDim2.new(1, 0, 0, 20)
92
label.Position = UDim2.new(0, 0, 0, 40)
93
label.BackgroundColor3 = Color3.new(1, 1, 1)
94
label.BorderColor3 = Color3.new(0, 0, 0)
95
label.Parent = frame
96
local label = Instance.new("TextLabel")
97
label.Name = "Ammo"
98
label.Text = "0/0"
99
label.TextXAlignment = "Right"
100
label.Size = UDim2.new(1, 0, 0, 20)
101
label.Position = UDim2.new(0, -10, 0, 40)
102
label.BackgroundTransparency = 1
103
label.BorderSizePixel = 0
104
label.Parent = frame
105
106
107
function updateGui()
108
	if selected == false then return end
109
	if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
110
	if Player.PlayerGui:FindFirstChild(Name) == nil then
111
		ammoGui:Clone().Parent = Player.PlayerGui
112
	end
113
	Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
114
	Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
115
end
116
117
118
function makeParts(format)
119
	local model = Instance.new("Model")
120
	model.Name = Name
121
	local pm2 = Instance.new("Part")
122
	pm2.Name = "WeldPoint"
123
	pm2.formFactor = "Symmetric"
124
	pm2.Size = Vector3.new(1, 1, 1)
125
	pm2.BrickColor = MC
126
	pm2.Reflectance = MR
127
	pm2.CanCollide = false
128
	pm2.Transparency = 1
129
	pm2.Locked = true
130
	pm2.TopSurface = 0
131
	pm2.BottomSurface = 0
132
	pm2.Parent = model
133
	local m = Instance.new("SpecialMesh")
134
	m.MeshType = "Brick"
135
	m.Scale = Vector3.new(0.3, 0.8, 0.4)
136
	m.Parent = pm2
137
	if format ~= nil then
138
		local w = Instance.new("Weld")
139
		w.Part0 = pm2
140
		if format == "RightHand" then
141
			w.Part1 = Player.Character:FindFirstChild("Right Arm")
142
			w.C0 = CFrame.new(0, 0.9, 0.68)
143
			w.C1 = CFrame.new()
144
		elseif format == "LeftHand" then
145
			w.Part1 = Player.Character:FindFirstChild("Left Arm")
146
			w.C0 = CFrame.new(0, 0.9, 0.68)
147
			w.C1 = CFrame.new()
148
			model.Name = Name.. " (Left)"
149
		elseif format == "RightHolster" then
150
			w.Part1 = Player.Character:FindFirstChild("Right Leg")
151
			w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
152
			w.C1 = CFrame.new()
153
			model.Name = Name.. " (Holstered)"
154
		elseif format == "LeftHolster" then
155
			w.Part1 = Player.Character:FindFirstChild("Left Leg")
156
			w.C0 = CFrame.new(0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
157
			w.C1 = CFrame.new()
158
			model.Name = Name.. " (Holstered, Left)"
159
		end
160
		w.Parent = pm2
161
		model.Parent = Player.Character
162
	end
163
	local pm = Instance.new("Part")
164
	pm.Name = "Handle"
165
	pm.formFactor = "Symmetric"
166
	pm.Size = Vector3.new(1, 1, 1)
167
	pm.CanCollide = false
168
	pm.Transparency = 1
169
	pm.Locked = true
170
	pm.TopSurface = 0
171
	pm.BottomSurface = 0
172
	pm.Parent = model
173
	local w = Instance.new("Weld")
174
	w.Part0 = pm
175
	w.Part1 = pm2
176
	w.C0 = CFrame.new()
177
	w.C1 = CFrame.new()
178
	w.Parent = pm	
179
	local s = Instance.new("Sound")
180
	s.Name = "Melee"
181
	s.SoundId = "rbxasset://sounds/swordslash.wav"
182
	s.Volume = 1
183
	s.Pitch = 2
184
	s.Looped = false
185
	s.Parent = pm
186
	local s = Instance.new("Sound")
187
	s.Name = "Impact"
188
	s.SoundId = "http://www.roblox.com/Asset/?id=46153268"
189
	s.Volume = 0.5
190
	s.Pitch = 1
191
	s.Looped = false
192
	s.Parent = pm	
193
	local s = Instance.new("Sound")
194
	s.Name = "Fire"
195-
	s.SoundId = "http://www.roblox.com/Asset/?id=10209798"
195+
	s.SoundId = "http://www.roblox.com/Asset/?id=282716906"
196
	s.Volume = 1
197-
	s.Pitch = 3
197+
198
	s.Looped = false
199
	s.Parent = pm
200
	local s = Instance.new("Sound")
201
	s.Name = "Fire2"
202-
	s.SoundId = "http://roblox.com/asset/?id=2691586"
202+
	s.SoundId = "http://roblox.com/asset/?id=162043120"
203
	s.Volume = 1
204-
	s.Pitch = 3
204+
205
	s.Looped = false
206
	s.Parent = pm
207
	local s = Instance.new("Sound")
208
	s.Name = "Hammer"
209
	s.SoundId = "http://www.roblox.com/Asset/?id=10209894"
210
	s.Volume = 0.8
211
	s.Pitch = 4
212
	s.Looped = false
213
	s.Parent = pm	
214
	local s = Instance.new("Sound")
215
	s.Name = "Lock"
216
	s.SoundId = "http://www.roblox.com/Asset/?id=10209636"
217
	s.Volume = 1
218
	s.Pitch = 3.2
219
	s.Looped = false
220
	s.Parent = pm
221
	local s = Instance.new("Sound")
222
	s.Name = "Empty"
223
	s.SoundId = "http://www.roblox.com/asset/?id=2697295"
224
	s.Volume = 1
225
	s.Pitch = 5
226
	s.Looped = false
227
	s.Parent = pm
228
	local s = Instance.new("Sound")
229
	s.Name = "Reload"
230
	s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
231
	s.Volume = 1
232
	s.Pitch = 5
233
	s.Looped = false
234
	s.Parent = pm
235
	local s = Instance.new("Sound")
236
	s.Name = "Release"
237
	s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
238
	s.Volume = 1
239
	s.Pitch = 4
240
	s.Looped = false
241
	s.Parent = pm
242
	local s = Instance.new("Sound")
243
	s.Name = "Switch"
244
	s.SoundId = "http://www.roblox.com/asset/?id=2697295"
245
	s.Volume = 1
246
	s.Pitch = 10
247
	s.Looped = false
248
	s.Parent = pm
249
	local p = Instance.new("Part")
250
	p.Name = "ShellOut"
251
	p.formFactor = "Symmetric"
252
	p.Size = Vector3.new(1, 1, 1)
253
	p.Transparency = 1
254
	p.Locked = true
255
	p.CanCollide = false
256
	p.TopSurface = 0
257
	p.BottomSurface = 0
258
	p.Parent = model
259
	local w = Instance.new("Weld")
260
	w.Part0 = p
261
	w.Part1 = pm
262
	w.C0 = CFrame.new(0.5, 0, 0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0)
263
	w.C1 = CFrame.new()
264
	w.Parent = p
265
	local p = Instance.new("Part")
266
	p.Name = "Grip"
267
	p.formFactor = "Symmetric"
268
	p.Size = Vector3.new(1, 1, 1)
269
	p.BrickColor = GC
270
	p.Reflectance = MR
271
	p.CanCollide = false
272
	p.Locked = true
273
	p.TopSurface = 0
274
	p.BottomSurface = 0
275
	p.Parent = model
276
	local m = Instance.new("SpecialMesh")
277
	m.MeshType = "Brick"
278
	m.Scale = Vector3.new(0.261, 0.42, 0.78)
279
	m.Parent = p
280
	local w = Instance.new("Weld")
281
	w.Part0 = p
282
	w.Part1 = pm
283
	w.C0 = CFrame.new(0, -0.092, -0.44) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
284
	w.C1 = CFrame.new()
285
	w.Parent = p
286
	local p = Instance.new("Part")
287
	p.Name = "Grip Wood"
288
	p.formFactor = "Symmetric"
289
	p.Size = Vector3.new(1, 1, 1)
290
	p.BrickColor = BrickColor.new("Black")
291
	p.Material = "Wood"
292
	p.CanCollide = false
293
	p.Locked = true
294
	p.TopSurface = 0
295
	p.BottomSurface = 0
296
	p.Parent = model
297
	local m = Instance.new("SpecialMesh")
298
	m.MeshType = "Brick"
299
	m.Scale = Vector3.new(0.264, 0.4, 0.68)
300
	m.Parent = p
301
	local w = Instance.new("Weld")
302
	w.Part0 = p
303
	w.Part1 = pm
304
	w.C0 = CFrame.new(0, -0.092, -0.48) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
305
	w.C1 = CFrame.new()
306
	w.Parent = p	
307
	local p = Instance.new("Part")
308
	p.Name = "Magazine"
309
	p.formFactor = "Symmetric"
310
	p.Size = Vector3.new(1, 1, 1)
311
	p.BrickColor = BrickColor.new("Black")
312
	p.CanCollide = false
313
	p.Locked = true
314
	p.TopSurface = 0
315
	p.BottomSurface = 0
316
	p.Parent = model
317
	local m = Instance.new("SpecialMesh")
318
	m.MeshType = "Brick"
319
	m.Scale = Vector3.new(0.24, 0.32, 0.74)
320
	m.Parent = p
321
	local w = Instance.new("Weld")
322
	w.Part0 = p
323
	w.Part1 = pm
324
	w.C0 = CFrame.new(0, -0.078, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
325
	w.C1 = CFrame.new()
326
	w.Parent = p
327
	local ph = Instance.new("Part")
328
	ph.Name = "Hammer"
329
	ph.formFactor = "Symmetric"
330
	ph.Size = Vector3.new(1, 1, 1)
331
	ph.BrickColor = GC
332
	ph.Reflectance = MR
333
	ph.CanCollide = false
334
	ph.Locked = true
335
	ph.TopSurface = 0
336
	ph.BottomSurface = 0
337
	ph.Parent = model
338
	local m = Instance.new("BlockMesh")
339
	m.Scale = Vector3.new(0.086, 0.1, 0.22)
340
	m.Parent = ph
341
	local w = Instance.new("Weld")
342
	w.Part0 = ph
343
	w.Part1 = pm
344
	if Hammer == false then
345
		w.C0 = CFrame.new(0, -0.358, 0.02)
346
	else
347
		w.C0 = CFrame.new(0, -0.3, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)	
348
	end
349
	w.C1 = CFrame.new()
350
	w.Parent = ph
351
	local p = Instance.new("Part")
352
	p.Name = "HammerSpur"
353
	p.formFactor = "Symmetric"
354
	p.Size = Vector3.new(1, 1, 1)
355
	p.BrickColor = GC
356
	p.Reflectance = MR
357
	p.CanCollide = false
358
	p.Locked = true
359
	p.TopSurface = 0
360
	p.BottomSurface = 0
361
	p.Parent = model
362
	local m = Instance.new("CylinderMesh")
363
	m.Scale = Vector3.new(0.1, 0.1, 0.1)
364
	m.Parent = p
365
	local w = Instance.new("Weld")
366
	w.Part0 = p
367
	w.Part1 = ph
368
	w.C0 = CFrame.new(0.05, 0, 0.08) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
369
	w.C1 = CFrame.new()
370
	w.Parent = p		
371
	local p = Instance.new("Part")
372
	p.Name = "Trigger"
373
	p.formFactor = "Symmetric"
374
	p.Size = Vector3.new(1, 1, 1)
375
	p.BrickColor = BrickColor.new("Black")
376
	p.Reflectance = MR
377
	p.CanCollide = false
378
	p.Locked = true
379
	p.TopSurface = 0
380
	p.BottomSurface = 0
381
	p.Parent = model
382
	local m = Instance.new("BlockMesh")
383
	m.Scale = Vector3.new(0.1, 0.4, 0.16)
384
	m.Parent = p
385
	local w = Instance.new("Weld")
386
	w.Part0 = p
387
	w.Part1 = pm
388
	w.C0 = CFrame.new(0, -0.08, -0.25)
389
	w.C1 = CFrame.new()
390
	w.Parent = p
391
	local p = Instance.new("Part")
392
	p.Name = "TriggerGuard"
393
	p.formFactor = "Symmetric"
394
	p.Size = Vector3.new(1, 1, 1)
395
	p.BrickColor = GC
396
	p.CanCollide = false
397
	p.Locked = true
398
	p.TopSurface = 0
399
	p.BottomSurface = 0
400
	p.Parent = model
401
	local m = Instance.new("SpecialMesh")
402
	m.MeshType = "FileMesh"
403
	m.MeshId = "http://www.roblox.com/asset/?id=3270017"
404
	m.Scale = Vector3.new(0.34, 0.34, 0.8)
405
	m.Parent = p
406
	local w = Instance.new("Weld")
407
	w.Part0 = p
408
	w.Part1 = pm
409
	w.C0 = CFrame.new(-0.25, 0.05, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
410
	w.C1 = CFrame.new()
411
	w.Parent = p		
412
	local p = Instance.new("Part")
413
	p.Name = "Base"
414
	p.CanCollide = false
415
	p.formFactor = "Symmetric"
416
	p.Size = Vector3.new(1, 1, 1)
417
	p.BrickColor = GC
418
	p.Reflectance = MR
419
	p.Locked = true
420
	p.TopSurface = 0
421
	p.BottomSurface = 0
422
	p.Parent = model
423
	local m = Instance.new("SpecialMesh")
424
	m.MeshType = "Brick"
425
	m.Scale = Vector3.new(0.261, 0.9, 0.248)
426
	m.Parent = p
427
	local w = Instance.new("Weld")
428
	w.Part0 = p
429
	w.Part1 = pm
430
	w.C0 = CFrame.new(0, 0.045, -0.066)
431
	w.C1 = CFrame.new()
432
	w.Parent = p
433
	local p = Instance.new("Part")
434
	p.Name = "Base"
435
	p.CanCollide = false
436
	p.formFactor = "Symmetric"
437
	p.Size = Vector3.new(1, 1, 1)
438
	p.BrickColor = GC
439
	p.Reflectance = MR
440
	p.Locked = true
441
	p.TopSurface = 0
442
	p.BottomSurface = 0
443
	p.Parent = model
444
	local m = Instance.new("SpecialMesh")
445
	m.MeshType = "Brick"
446
	m.Scale = Vector3.new(0.261, 0.9, 0.16)
447
	m.Parent = p
448
	local w = Instance.new("Weld")
449
	w.Part0 = p
450
	w.Part1 = pm
451
	w.C0 = CFrame.new(0, 0, -0.1155)
452
	w.C1 = CFrame.new()
453
	w.Parent = p	
454
	local p = Instance.new("Part")
455
	p.Name = "Base"
456
	p.CanCollide = false
457
	p.formFactor = "Symmetric"
458
	p.Size = Vector3.new(1, 1, 1)
459
	p.BrickColor = GC
460
	p.Reflectance = MR
461
	p.Locked = true
462
	p.TopSurface = 0
463
	p.BottomSurface = 0
464
	p.Parent = model
465
	local m = Instance.new("SpecialMesh")
466
	m.MeshType = "Brick"
467
	m.Scale = Vector3.new(0.261, 0.5, 0.248)
468
	m.Parent = p
469
	local w = Instance.new("Weld")
470
	w.Part0 = p
471
	w.Part1 = pm
472
	w.C0 = CFrame.new(0, 0.3, -0.066)
473
	w.C1 = CFrame.new()
474
	w.Parent = p
475
	local ps = Instance.new("Part")
476
	ps.Name = "Slide"
477
	ps.CanCollide = false
478
	ps.formFactor = "Symmetric"
479
	ps.Size = Vector3.new(1, 1, 1)
480
	ps.BrickColor = MC
481
	ps.Reflectance = MR
482
	ps.Locked = true
483
	ps.TopSurface = 0
484
	ps.BottomSurface = 0
485
	ps.Parent = model
486
	local m = Instance.new("SpecialMesh")
487
	m.MeshType = "Brick"
488
	m.Name = "Mesh"
489
	m.Scale = Vector3.new(0.26, 0.2, 0.24)
490
	m.Offset = Vector3.new(0, 0, 0.2)
491
	m.Parent = ps
492
	local w = Instance.new("Weld")
493
	w.Part0 = ps
494
	w.Part1 = pm
495
	if magazine.Value ~= 0 then
496
		w.C0 = CFrame.new(0, 0.4, 0.06)
497
	else
498
		w.C0 = CFrame.new(0, 0.2, 0.06)
499
	end
500
	w.C1 = CFrame.new()
501
	w.Parent = ps
502
	local p = Instance.new("Part")
503
	p.Name = "SlideBottom"
504
	p.CanCollide = false
505
	p.formFactor = "Symmetric"
506
	p.Size = Vector3.new(1, 1, 1)
507
	p.BrickColor = MC
508
	p.Reflectance = MR
509
	p.Locked = true
510
	p.TopSurface = 0
511
	p.BottomSurface = 0
512
	p.Parent = model
513
	local m = Instance.new("SpecialMesh")
514
	m.MeshType = "Brick"
515
	m.Name = "Mesh"
516
	m.Scale = Vector3.new(0.26, 0.9, 0.16)
517
	m.Parent = p
518
	local w = Instance.new("Weld")
519
	w.Part0 = p
520
	w.Part1 = ps
521
	w.C0 = CFrame.new(0, -0.35, -0.06)
522
	w.C1 = CFrame.new()
523
	w.Parent = p
524
	local p = Instance.new("Part")
525
	p.Name = "GuideBottom"
526
	p.CanCollide = false
527
	p.formFactor = "Symmetric"
528
	p.Size = Vector3.new(1, 1, 1)
529
	p.BrickColor = MC
530
	p.Reflectance = MR
531
	p.Locked = true
532
	p.TopSurface = 0
533
	p.BottomSurface = 0
534
	p.Parent = model
535
	local m = Instance.new("SpecialMesh")
536
	m.MeshType = "Brick"
537
	m.Name = "Mesh"
538
	m.Scale = Vector3.new(0.2, 0.65, 0.3)
539
	m.Parent = p
540
	local w = Instance.new("Weld")
541
	w.Part0 = p
542
	w.Part1 = ps
543
	w.C0 = CFrame.new(0, 0.125, -0.075)
544
	w.C1 = CFrame.new()
545
	w.Parent = p		
546
	local p = Instance.new("Part")
547
	p.Name = "Guide"
548
	p.CanCollide = false
549
	p.formFactor = "Symmetric"
550
	p.Size = Vector3.new(1, 1, 1)
551
	p.BrickColor = MC
552
	p.Reflectance = MR
553
	p.Locked = true
554
	p.TopSurface = 0
555
	p.BottomSurface = 0
556
	p.Parent = model
557
	local m = Instance.new("SpecialMesh")
558
	m.MeshType = "Brick"
559
	m.Name = "Mesh"
560
	m.Scale = Vector3.new(0.26, 0.65, 0.26)
561
	m.Parent = p
562
	local w = Instance.new("Weld")
563
	w.Part0 = p
564
	w.Part1 = ps
565
	w.C0 = CFrame.new(0, 0.125, -0.01)
566
	w.C1 = CFrame.new()
567
	w.Parent = p	
568
	local p = Instance.new("Part")
569
	p.Name = "Slide1"
570
	p.CanCollide = false
571
	p.formFactor = "Symmetric"
572
	p.Size = Vector3.new(1, 1, 1)
573
	p.BrickColor = MC
574
	p.Reflectance = MR
575
	p.Locked = true
576
	p.TopSurface = 0
577
	p.BottomSurface = 0
578
	p.Parent = model
579
	local m = Instance.new("SpecialMesh")
580
	m.MeshType = "Brick"
581
	m.Name = "Mesh"
582
	m.Scale = Vector3.new(0.13, 0.6, 0.24)
583
	m.Parent = p
584
	local w = Instance.new("Weld")
585
	w.Part0 = p
586
	w.Part1 = ps
587
	w.C0 = CFrame.new(0.065, -0.2, 0)
588
	w.C1 = CFrame.new()
589
	w.Parent = p
590
	local p = Instance.new("Part")
591
	p.Name = "Slide2"
592
	p.CanCollide = false
593
	p.formFactor = "Symmetric"
594
	p.Size = Vector3.new(1, 1, 1)
595
	p.BrickColor = MC
596
	p.Reflectance = MR
597
	p.Locked = true
598
	p.TopSurface = 0
599
	p.BottomSurface = 0
600
	p.Parent = model
601
	local m = Instance.new("SpecialMesh")
602
	m.MeshType = "Brick"
603
	m.Name = "Mesh"
604
	m.Scale = Vector3.new(0.26, 0.6, 0.12)
605
	m.Parent = p
606
	local w = Instance.new("Weld")
607
	w.Part0 = p
608
	w.Part1 = ps
609
	w.C0 = CFrame.new(0, -0.2, -0.03)
610
	w.C1 = CFrame.new()
611
	w.Parent = p
612
	local p = Instance.new("Part")
613
	p.Name = "Slide3"
614
	p.CanCollide = false
615
	p.formFactor = "Symmetric"
616
	p.Size = Vector3.new(1, 1, 1)
617
	p.BrickColor = MC
618
	p.Reflectance = MR
619
	p.Locked = true
620
	p.TopSurface = 0
621
	p.BottomSurface = 0
622
	p.Parent = model
623
	local m = Instance.new("SpecialMesh")
624
	m.MeshType = "Brick"
625
	m.Name = "Mesh"
626
	m.Scale = Vector3.new(0.26, 0.45, 0.24)
627
	m.Parent = p
628
	local w = Instance.new("Weld")
629
	w.Part0 = p
630
	w.Part1 = ps
631
	w.C0 = CFrame.new(0, -0.58, 0)
632
	w.C1 = CFrame.new()
633
	w.Parent = p
634
	local p = Instance.new("Part")
635
	p.Name = "Shell"
636
	p.formFactor = "Custom"
637
	p.Size = Vector3.new(0.2, 0.2, 0.2)
638
	p.BrickColor = BrickColor.new("New Yeller")
639
	if magazine.Value ~= 0 then
640
		p.Transparency = 0
641
	else
642
		p.Transparency = 1
643
	end
644
	p.Reflectance = 0
645
	p.CanCollide = false
646
	p.Locked = true
647
	p.TopSurface = 0
648
	p.BottomSurface = 0
649
	p.Parent = model
650
	local m = Instance.new("CylinderMesh")
651
	m.Scale = Vector3.new(0.51, 1, 0.51)
652
	m.Parent = p
653
	local w = Instance.new("Weld")
654
	w.Part0 = p
655
	w.Part1 = pm
656
	w.C0 = CFrame.new(0, -0.09, 0.06)
657
	w.C1 = CFrame.new()
658
	w.Parent = p
659
	local p = Instance.new("Part")
660
	p.Name = "RearSight"
661
	p.CanCollide = false
662
	p.formFactor = "Symmetric"
663
	p.Size = Vector3.new(1, 1, 1)
664
	p.BrickColor = MC
665
	p.Reflectance = MR
666
	p.Locked = true
667
	p.TopSurface = 0
668
	p.BottomSurface = 0
669
	p.Parent = model
670
	local m = Instance.new("BlockMesh")
671
	m.Name = "Mesh"
672
	m.Scale = Vector3.new(0.08, 0.08, 0.08)
673
	m.Parent = p
674
	local w = Instance.new("Weld")
675
	w.Part0 = p
676
	w.Part1 = ps
677
	w.C0 = CFrame.new(0.07, -0.7, 0.12)
678
	w.C1 = CFrame.new()
679
	w.Parent = p
680
	local p = Instance.new("Part")
681
	p.Name = "RearSight"
682
	p.CanCollide = false
683
	p.formFactor = "Symmetric"
684
	p.Size = Vector3.new(1, 1, 1)
685
	p.BrickColor = SC
686
	p.Reflectance = MR
687
	p.Locked = true
688
	p.TopSurface = 0
689
	p.BottomSurface = 0
690
	p.Parent = model
691
	local m = Instance.new("CylinderMesh")
692
	m.Name = "Mesh"
693
	m.Scale = Vector3.new(0.04, 0.084, 0.04)
694
	m.Parent = p
695
	local w = Instance.new("Weld")
696
	w.Part0 = p
697
	w.Part1 = ps
698
	w.C0 = CFrame.new(0.07, -0.705, 0.12)
699
	w.C1 = CFrame.new()
700
	w.Parent = p
701
	local p = Instance.new("Part")
702
	p.Name = "RearSight"
703
	p.CanCollide = false
704
	p.formFactor = "Symmetric"
705
	p.Size = Vector3.new(1, 1, 1)
706
	p.BrickColor = SC
707
	p.Reflectance = MR
708
	p.Locked = true
709
	p.TopSurface = 0
710
	p.BottomSurface = 0
711
	p.Parent = model
712
	local m = Instance.new("CylinderMesh")
713
	m.Name = "Mesh"
714
	m.Scale = Vector3.new(0.04, 0.084, 0.04)
715
	m.Parent = p
716
	local w = Instance.new("Weld")
717
	w.Part0 = p
718
	w.Part1 = ps
719
	w.C0 = CFrame.new(-0.07, -0.705, 0.12)
720
	w.C1 = CFrame.new()
721
	w.Parent = p			
722
	local p = Instance.new("Part")
723
	p.Name = "RearSight"
724
	p.CanCollide = false
725
	p.formFactor = "Symmetric"
726
	p.Size = Vector3.new(1, 1, 1)
727
	p.BrickColor = MC
728
	p.Reflectance = MR
729
	p.Locked = true
730
	p.TopSurface = 0
731
	p.BottomSurface = 0
732
	p.Parent = model
733
	local m = Instance.new("BlockMesh")
734
	m.Name = "Mesh"
735
	m.Scale = Vector3.new(0.08, 0.08, 0.08)
736
	m.Parent = p
737
	local w = Instance.new("Weld")
738
	w.Part0 = p
739
	w.Part1 = ps
740
	w.C0 = CFrame.new(-0.07, -0.7, 0.12)
741
	w.C1 = CFrame.new()
742
	w.Parent = p
743
	local p = Instance.new("Part")
744
	p.Name = "FrontSight"
745
	p.CanCollide = false
746
	p.formFactor = "Symmetric"
747
	p.Size = Vector3.new(1, 1, 1)
748
	p.BrickColor = MC
749
	p.Reflectance = MR
750
	p.Locked = true
751
	p.TopSurface = 0
752
	p.BottomSurface = 0
753
	p.Parent = model
754
	local m = Instance.new("BlockMesh")
755
	m.Name = "Mesh"
756
	m.Scale = Vector3.new(0.08, 0.08, 0.08)
757
	m.Parent = p
758
	local w = Instance.new("Weld")
759
	w.Part0 = p
760
	w.Part1 = ps
761
	w.C0 = CFrame.new(0, 0.35, 0.12)
762
	w.C1 = CFrame.new()
763
	w.Parent = p
764
	local p = Instance.new("Part")
765
	p.Name = "FrontSight"
766
	p.CanCollide = false
767
	p.formFactor = "Symmetric"
768
	p.Size = Vector3.new(1, 1, 1)
769
	p.BrickColor = SC
770
	p.Reflectance = MR
771
	p.Locked = true
772
	p.TopSurface = 0
773
	p.BottomSurface = 0
774
	p.Parent = model
775
	local m = Instance.new("CylinderMesh")
776
	m.Scale = Vector3.new(0.04, 0.084, 0.04)
777
	m.Parent = p
778
	local w = Instance.new("Weld")
779
	w.Part0 = p
780
	w.Part1 = ps
781
	w.C0 = CFrame.new(0, 0.346, 0.12)
782
	w.C1 = CFrame.new()
783
	w.Parent = p
784
	local p = Instance.new("Part")
785
	p.Name = "Recoil Spring Guide"
786
	p.formFactor = "Symmetric"
787
	p.Size = Vector3.new(1, 1, 1)
788
	p.BrickColor = BrickColor.new("Light stone grey")
789
	p.Reflectance = 0.06
790
	p.CanCollide = false
791
	p.Locked = true
792
	p.TopSurface = 0
793
	p.BottomSurface = 0
794
	p.Parent = model
795
	local m = Instance.new("CylinderMesh")
796
	m.Scale = Vector3.new(0.07, 0.901, 0.07)
797
	m.Offset = Vector3.new(0, 0.34, 0)	
798
	m.Parent = p
799
	local w = Instance.new("Weld")
800
	w.Part0 = p
801
	w.Part1 = pm
802
	w.C0 = CFrame.new(0, 0.75, -0.065)
803
	w.C1 = CFrame.new()
804
	w.Parent = p	
805
	local p = Instance.new("Part")
806
	p.Name = "Hole"
807
	p.formFactor = "Symmetric"
808
	p.Size = Vector3.new(1, 1, 1)
809
	p.BrickColor = BrickColor.new("Really black")
810
	p.Reflectance = 0
811
	p.CanCollide = false
812
	p.Locked = true
813
	p.TopSurface = 0
814
	p.BottomSurface = 0
815
	p.Parent = model
816
	local m = Instance.new("CylinderMesh")
817
	m.Scale = Vector3.new(0.115, 0.901, 0.115)
818
	m.Offset = Vector3.new(0, 0.34, 0)	
819
	m.Parent = p
820
	local w = Instance.new("Weld")
821
	w.Part0 = p
822
	w.Part1 = pm
823
	w.C0 = CFrame.new(0, 0.75, 0.06)
824
	w.C1 = CFrame.new()
825
	w.Parent = p
826
	local p = Instance.new("Part")
827
	if silenced == false then
828
		p.Name = "Muzzle"
829
	else
830
		p.Name = "Muzzle 2"
831
	end
832
	p.formFactor = "Symmetric"
833
	p.Size = Vector3.new(1, 1, 1)
834
	p.BrickColor = BrickColor.new("Light stone grey")
835
	p.Reflectance = 0.06
836
	p.CanCollide = false
837
	p.Locked = true
838
	p.TopSurface = 0
839
	p.BottomSurface = 0
840
	p.Parent = model
841
	local m = Instance.new("CylinderMesh")
842
	m.Scale = Vector3.new(0.15, 0.9, 0.15)
843
	m.Offset = Vector3.new(0, 0.34, 0)
844
	m.Parent = p
845
	local w = Instance.new("Weld")
846
	w.Part0 = p
847
	w.Part1 = pm
848
	w.C0 = CFrame.new(0, 0.75, 0.06)
849
	w.C1 = CFrame.new()
850
	w.Parent = p
851
	local s = Instance.new("Smoke")
852
	s.Enabled = false
853
	s.Name = "Smoke"
854
	s.RiseVelocity = -5
855
	s.Opacity = 0.3
856
	s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
857
	s.Size = 1
858
	s.Parent = p
859
	local f = Instance.new("Fire")
860
	f.Enabled = false
861
	f.Name = "Fire"
862
	f.Heat = -35
863
	f.Size = 1
864
	f.Parent = p
865
	p.Touched:connect(function(hit) onTouched(hit, p, "pistol") end)	
866
	local p = Instance.new("Part")
867
	if silenced == false then
868
		p.Name = "Silencer"
869
		p.Transparency = 1
870
	else
871
		p.Name = "Muzzle"
872
		p.Transparency = 0
873
	end
874
	p.formFactor = "Symmetric"
875
	p.Size = Vector3.new(1, 1, 1)
876
	p.BrickColor = BrickColor.new("Really black")
877
	p.Reflectance = 0
878
	p.CanCollide = false
879
	p.Locked = true
880
	p.TopSurface = 0
881
	p.BottomSurface = 0
882
	p.Parent = model
883
	local m = Instance.new("CylinderMesh")
884
	m.Scale = Vector3.new(0.2, 0.8, 0.2)
885
	m.Parent = p
886
	local w = Instance.new("Weld")
887
	w.Part0 = p
888
	w.Part1 = pm
889
	w.C0 = CFrame.new(0, 1.26, 0.06)
890
	w.C1 = CFrame.new()
891
	w.Parent = p
892
	local p = Instance.new("Part")
893
	p.Name = "Silencer1"
894
	if silenced == false then
895
		p.Transparency = 1
896
	else
897
		p.Transparency = 0
898
	end
899
	p.formFactor = "Symmetric"
900
	p.Size = Vector3.new(1, 1, 1)
901
	p.BrickColor = BrickColor.new("Black")
902
	p.Reflectance = 0
903
	p.CanCollide = false
904
	p.Locked = true
905
	p.TopSurface = 0
906
	p.BottomSurface = 0
907
	p.Parent = model
908
	local m = Instance.new("CylinderMesh")
909
	m.Scale = Vector3.new(0.21, 0.6, 0.21)
910
	m.Parent = p
911
	local w = Instance.new("Weld")
912
	w.Part0 = p
913
	w.Part1 = pm
914
	w.C0 = CFrame.new(0, 1.26, 0.06)
915
	w.C1 = CFrame.new()
916
	w.Parent = p
917
	return model
918
end
919
920
921
function removeParts(format)
922
	if format == "RightHand" then
923
		pcall(function() Player.Character[Name]:Remove() end)
924
	elseif format == "LeftHand" then
925
		pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
926
	elseif format == "RightHolster" then
927
		pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
928
	elseif format == "LeftHolster" then
929
		pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
930
	end
931
end
932
933
934
function onTouched(hit, source, format)
935
	if format == "pistol" then
936
		if hit.Parent:FindFirstChild("Humanoid") ~= nil and hit.Parent ~= Player.Character then
937
			tagHumanoid(hit.Parent.Humanoid)
938
			if canHit == true and melee == true then
939
				hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 50
940
				Player.Character[Name].Handle.Impact:Play()
941
				hit.Parent.Humanoid.Sit = true
942
				melee = false
943
				wait(0.8)
944
				melee = true
945
			end
946
			delay(3, function() untagHumanoid(hit.Parent.Humanoid) end)
947
		end
948
	end
949
end
950
951
952
function SetAngle(Joint, Angle, Character)
953
	if Character == nil then return false end
954
	local Joints = {
955
		Character.Torso:FindFirstChild("Right Shoulder 2"),
956
		Character.Torso:FindFirstChild("Left Shoulder 2"),
957
		Character.Torso:FindFirstChild("Right Hip 2"),
958
		Character.Torso:FindFirstChild("Left Hip 2")
959
	}
960
	if Joints[Joint] == nil then return false end
961
	if Joint == 1 or Joint == 3 then
962
		Joints[Joint].DesiredAngle = Angle
963
	end
964
	if Joint == 2 or Joint == 4 then
965
		Joints[Joint].DesiredAngle = -Angle
966
	end
967
end
968
969
970
function ForceAngle(Joint, Angle, Character)
971
	if Character == nil then return false end
972
	local Joints = {
973
		Character.Torso:FindFirstChild("Right Shoulder 2"),
974
		Character.Torso:FindFirstChild("Left Shoulder 2"),
975
		Character.Torso:FindFirstChild("Right Hip 2"),
976
		Character.Torso:FindFirstChild("Left Hip 2")
977
	}
978
	if Joints[Joint] == nil then return false end
979
	if Joint == 1 or Joint == 3 then
980
		Joints[Joint].DesiredAngle = Angle
981
		Joints[Joint].CurrentAngle = Angle
982
	end
983
	if Joint == 2 or Joint == 4 then
984
		Joints[Joint].DesiredAngle = -Angle
985
		Joints[Joint].CurrentAngle = -Angle
986
	end
987
end
988
989
990
function SetSpeed(Joint, Speed, Character)
991
	if Character == nil then return false end
992
	local Joints = {
993
		Character.Torso:FindFirstChild("Right Shoulder 2"),
994
		Character.Torso:FindFirstChild("Left Shoulder 2"),
995
		Character.Torso:FindFirstChild("Right Hip 2"),
996
		Character.Torso:FindFirstChild("Left Hip 2")
997
	}
998
	if Joints[Joint] == nil then return false end
999
	Joints[Joint].MaxVelocity = Speed
1000
end
1001
1002
1003
function DisableLimb(Limb, Character)
1004
	if Character == nil then return false end
1005
	if Character:FindFirstChild("Torso") == nil then return false end
1006
	local Joints = {
1007
		Character.Torso:FindFirstChild("Right Shoulder"),
1008
		Character.Torso:FindFirstChild("Left Shoulder"),
1009
		Character.Torso:FindFirstChild("Right Hip"),
1010
		Character.Torso:FindFirstChild("Left Hip")
1011
	}
1012
	local Limbs = {
1013
		Character:FindFirstChild("Right Arm"),
1014
		Character:FindFirstChild("Left Arm"),
1015
		Character:FindFirstChild("Right Leg"),
1016
		Character:FindFirstChild("Left Leg")
1017
	}
1018
	if Joints[Limb] == nil then return false end
1019
	if Limbs[Limb] == nil then return false end
1020
	local Joint = Instance.new("Motor")
1021
	Joint.Parent = Character.Torso
1022
	Joint.Part0 = Character.Torso
1023
	Joint.Part1 = Limbs[Limb]
1024
	if Limb == 1 then
1025
		Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1026
		Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1027
		Joint.Name = "Right Shoulder 2"
1028
	elseif Limb == 2 then
1029
		Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1030
		Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1031
		Joint.Name = "Left Shoulder 2"
1032
	elseif Limb == 3 then
1033
		Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1034
		Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1035
		Joint.Name = "Right Hip 2"
1036
	elseif Limb == 4 then
1037
		Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1038
		Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1039
		Joint.Name = "Left Hip 2"
1040
	end
1041
	Joint.MaxVelocity = Joints[Limb].MaxVelocity
1042
	Joint.CurrentAngle = Joints[Limb].CurrentAngle
1043
	Joint.DesiredAngle = Joints[Limb].DesiredAngle
1044
	Joints[Limb]:Remove()
1045
end
1046
1047
1048
function ResetLimbCFrame(Limb, Character)
1049
	if Character == nil then return false end
1050
	if Character.Parent == nil then return false end
1051
	if Character:FindFirstChild("Torso") == nil then return false end
1052
	local Joints = {
1053
		Character.Torso:FindFirstChild("Right Shoulder 2"),
1054
		Character.Torso:FindFirstChild("Left Shoulder 2"),
1055
		Character.Torso:FindFirstChild("Right Hip 2"),
1056
		Character.Torso:FindFirstChild("Left Hip 2")
1057
	}
1058
	local Limbs = {
1059
		Character:FindFirstChild("Right Arm"),
1060
		Character:FindFirstChild("Left Arm"),
1061
		Character:FindFirstChild("Right Leg"),
1062
		Character:FindFirstChild("Left Leg")
1063
	}
1064
	if Joints[Limb] == nil then return false end
1065
	if Limbs[Limb] == nil then return false end
1066
	if Limb == 1 then
1067
		Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1068
		Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1069
	elseif Limb == 2 then
1070
		Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1071
		Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1072
	elseif Limb == 3 then
1073
		Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1074
		Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1075
	elseif Limb == 4 then
1076
		Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1077
		Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1078
	end
1079
end
1080
1081
1082
function EnableLimb(Limb, Character)
1083
	if Character == nil then return false end
1084
	if Character:FindFirstChild("Torso") == nil then return false end
1085
	local Joints = {
1086
		Character.Torso:FindFirstChild("Right Shoulder 2"),
1087
		Character.Torso:FindFirstChild("Left Shoulder 2"),
1088
		Character.Torso:FindFirstChild("Right Hip 2"),
1089
		Character.Torso:FindFirstChild("Left Hip 2")
1090
	}
1091
	local Limbs = {
1092
		Character:FindFirstChild("Right Arm"),
1093
		Character:FindFirstChild("Left Arm"),
1094
		Character:FindFirstChild("Right Leg"),
1095
		Character:FindFirstChild("Left Leg")
1096
	}
1097
	if Joints[Limb] == nil then return false end
1098
	if Limbs[Limb] == nil then return false end
1099
	if Limb == 1 then
1100
		Joints[Limb].Name = "Right Shoulder"
1101
	elseif Limb == 2 then
1102
		Joints[Limb].Name = "Left Shoulder"
1103
	elseif Limb == 3 then
1104
		Joints[Limb].Name = "Right Hip"
1105
	elseif Limb == 4 then
1106
		Joints[Limb].Name = "Left Hip"
1107
	end
1108
	Animate = Character:FindFirstChild("Animate")
1109
	if Animate == nil then return false end
1110
	Animate = Animate:Clone()
1111
	Character.Animate:Remove()
1112
	Animate.Parent = Character
1113
end
1114
1115
1116
function playAnimation(format, mouse)
1117
	if format == "equip" then
1118
		Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
1119
		local w = Instance.new("Weld")
1120
		w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
1121
		w.Part1 = Player.Character:FindFirstChild("Right Arm")
1122
		w.C0 = CFrame.new(0, 1.2, 0.7)
1123
		w.C1 = CFrame.new()
1124
		w.Parent = Player.Character[Name.. " (Holstered)"].Handle
1125
		for i = 0.01, 1, 0.1 do
1126
			if Player.Character:FindFirstChild("Torso") ~= nil then
1127
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1128
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1129
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
1130
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1131
					Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
1132
					wait()
1133
				else return false end
1134
			else return false end
1135
		end
1136
		return playAnimation("hold")
1137
	end
1138
	if format == "rightEquip" then
1139
		Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
1140
		local w = Instance.new("Weld")
1141
		w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
1142
		w.Part1 = Player.Character:FindFirstChild("Right Arm")
1143
		w.C0 = CFrame.new(0, 1.2, 0.7)
1144
		w.C1 = CFrame.new()
1145
		w.Parent = Player.Character[Name.. " (Holstered)"].Handle
1146
		for i = 0.01, 1, 0.1 do
1147
			if Player.Character:FindFirstChild("Torso") ~= nil then
1148
				if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1149
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1150
					Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
1151
					wait()
1152
				else return false end
1153
			else return false end
1154
		end
1155
		return playAnimation("rightHold")
1156
	end
1157
	if format == "leftEquip" then
1158
		Player.Character[Name.. " (Holstered, Left)"].Handle.Weld:Remove()
1159
		local w = Instance.new("Weld")
1160
		w.Part0 = Player.Character[Name.. " (Holstered, Left)"].Handle
1161
		w.Part1 = Player.Character:FindFirstChild("Left Arm")
1162
		w.C0 = CFrame.new(0, 1.2, 0.7)
1163
		w.C1 = CFrame.new()
1164
		w.Parent = Player.Character[Name.. " (Holstered, Left)"].Handle
1165
		for i = 0.01, 1, 0.1 do
1166
			if Player.Character:FindFirstChild("Torso") ~= nil then
1167
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1168
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1169
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0)
1170
					wait()
1171
				else return false end
1172
			else return false end
1173
		end
1174
		return playAnimation("leftHold")
1175
	end
1176
	if format == "unequip" then
1177
		for i = 1, 0.01, -0.1 do
1178
			if Player.Character:FindFirstChild("Torso") ~= nil then
1179
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1180
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1181
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
1182
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1183
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
1184
					wait()
1185
				else return false end
1186
			else return false end
1187
		end
1188
		return true
1189
	end
1190
	if format == "leftUnequip" then
1191
		for i = 1, 0.01, -0.1 do
1192
			if Player.Character:FindFirstChild("Torso") ~= nil then
1193
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1194
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1195
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((1 * i) + (1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(5 * i), 0)
1196
					wait()
1197
				else return false end
1198
			else return false end
1199
		end
1200
		return true
1201
	end
1202
	if format == "rightUnequip" then
1203
		for i = 1, 0.01, -0.1 do
1204
			if Player.Character:FindFirstChild("Torso") ~= nil then
1205
				if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1206
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1207
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
1208
					wait()
1209
				else return false end
1210
			else return false end
1211
		end
1212
		return true
1213
	end
1214
	if format == "hold" then
1215
		if Player.Character:FindFirstChild("Torso") ~= nil then
1216
			if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1217
				Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1218
				Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
1219
				Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1220
				Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
1221
			else return false end
1222
		else return false end
1223
	end
1224
	if format == "rightHold" then
1225
		if Player.Character:FindFirstChild("Torso") ~= nil then
1226
			if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1227
				Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1228
				Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad(-5))
1229
			else return false end
1230
		else return false end
1231
	end
1232
	if format == "leftHold" then
1233
		if Player.Character:FindFirstChild("Torso") ~= nil then
1234
			if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1235
				Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1236
				Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), math.rad(5))
1237
			else return false end
1238
		else return false end
1239
	end
1240
	if format == "reload" then
1241
		coroutine.wrap(function()
1242
				Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.7, 0.68)	
1243
				for i = 0, 30, 15 do
1244
					pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
1245
					wait()
1246
				end
1247
				pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-30), 0, 0) end)
1248
		end)()					
1249
		Player.Character[Name].Handle.Empty:Play()
1250
		for i = 0, 25, 7.5 do
1251
			if Player.Character:FindFirstChild("Torso") ~= nil then
1252
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1253
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1254
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1255
					wait()
1256
				else return false end
1257
			else return false end
1258
		end
1259
		Player.Character[Name].Handle.Release:Play()
1260
		Player.Character[Name].Shell.Transparency = 1			
1261
		Player.Character[Name].Magazine.Transparency = 1
1262
		CamShake(15, 50000)				
1263
		local magazineDrop = Player.Character[Name].Magazine:Clone()
1264
		magazineDrop.Transparency = 0
1265
		magazineDrop.Parent = game:GetService("Workspace")
1266
		coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop)
1267
		delay(0.1, function() magazineDrop.CanCollide = true end)		
1268
		Player.Character[Name].Handle.Reload:Play()		
1269
		local magazineNew = Player.Character[Name].Magazine:Clone()
1270
		magazineNew.Name = "New Magazine"
1271
		magazineNew.Transparency = 0
1272
		magazineNew.Parent = Player.Character[Name]
1273
		local w = Instance.new("Weld")
1274
		w.Part0 = magazineNew
1275
		w.Part1 = Player.Character:FindFirstChild("Left Arm")
1276
		w.C0 = CFrame.new(0, 1.1, 0)
1277
		w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1278
		w.Parent = magazineNew
1279
		for i = 25, 0, -5 do
1280
			if Player.Character:FindFirstChild("Torso") ~= nil then
1281
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1282
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1283
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (i / 50), 0.75 - (i / 50), 0.35 + (i / 22.5)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (i * 2)), math.rad(-i * 3.5), math.rad(-90))
1284
					wait()
1285
				else return false end
1286
			else return false end
1287
		end			
1288
		Player.Character[Name].Magazine.Transparency = 0
1289
		Player.Character[Name].Shell.Transparency = 0
1290
		Player.Character[Name]["New Magazine"]:Remove()
1291
		if magazine.Value == 0 then
1292
			wait(0.05)
1293
			Player.Character[Name].Handle.Lock.Pitch = 2.5
1294
			Player.Character[Name].Handle.Lock:Play()
1295
			Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
1296
			CamShake(1, 50000)	
1297
			CamShake(1, -50000)								
1298
			wait(0.24)
1299
		else end
1300
		for i = 25, 0, -7.5 do
1301
			if Player.Character:FindFirstChild("Torso") ~= nil then
1302
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1303
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1304
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1305
					wait()
1306
				else return false end
1307
			else return false end
1308
		end
1309
		coroutine.wrap(function()
1310
				Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)	
1311
				for i = 30, 0, -15 do
1312
					pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
1313
					wait()
1314
				end
1315
				pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(0), 0, 0) end)
1316
		end)()							
1317
		for i = 0, 10, 5 do
1318
			if Player.Character:FindFirstChild("Torso") ~= nil then
1319
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1320
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1321
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i), math.rad(-90))
1322
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1323
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
1324
					wait()
1325
				else return false end
1326
			else return false end
1327
		end
1328
		for i = 10, 0, -5 do
1329
			if Player.Character:FindFirstChild("Torso") ~= nil then
1330
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1331
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1332
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i), math.rad(-90))
1333
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1334
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
1335
					wait()
1336
				else return false end
1337
			else return false end
1338
		end		
1339
		wait(0.04)
1340
	end
1341
	if format == "reloadDual" then
1342
		for i = 0, 25, 7.5 do
1343
			if Player.Character:FindFirstChild("Torso") ~= nil then
1344
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1345
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1346
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
1347
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1348
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1349
					wait()
1350
				else return false end
1351
			else return false end
1352
		end
1353
		coroutine.wrap(function()
1354
				Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1)	
1355
				Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 1)						
1356
				for i = 0, 360, 15 do
1357
					pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)
1358
					pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-i), 0, 0) end)					
1359
					wait()
1360
				end
1361
				pcall(function() Player.Character[Name].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end)
1362
				pcall(function() Player.Character[Name.. " (Left)"].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-360), 0, 0) end)				
1363
		end)()						
1364
		if magazine.Value == 0 then
1365
			Player.Character[Name].Shell.Transparency = 1		
1366
			Player.Character[Name.. " (Left)"].Shell.Transparency = 1			
1367
			Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
1368
			Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.1, 0.06)
1369
		else end
1370
		wait(0.1)
1371
		CamShake(1, 40000)													
1372
		Player.Character[Name].Handle.Release:Play()
1373
		Player.Character[Name].Magazine.Transparency = 1
1374
		local magazineDrop = Player.Character[Name].Magazine:Clone()
1375
		magazineDrop.Transparency = 0
1376
		magazineDrop.Parent = game:GetService("Workspace")
1377
		coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop)
1378
		delay(0.1, function() magazineDrop.CanCollide = true end)	
1379
		wait(math.random(0.1, 0.25))
1380
		Player.Character[Name].Handle.Release:Play()
1381
		Player.Character[Name.. " (Left)"].Magazine.Transparency = 1
1382
		local magazineDropDual = Player.Character[Name.. " (Left)"].Magazine:Clone()
1383
		magazineDropDual.Transparency = 0
1384
		magazineDropDual.Parent = game:GetService("Workspace")
1385
		coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDropDual)
1386
		delay(0.1, function() magazineDropDual.CanCollide = true end)
1387
		for i = 0, 25, 7.5 do
1388
			if Player.Character:FindFirstChild("Torso") ~= nil then
1389
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1390
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1391
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
1392
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1393
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1394
					wait()
1395
				else return false end
1396
			else return false end
1397
		end
1398
		local magazineNew = Player.Character[Name].Magazine:Clone()
1399
		magazineNew.Name = "New Magazine"
1400
		magazineNew.Transparency = 0
1401
		magazineNew.Parent = Player.Character[Name]
1402
		local w = Instance.new("Weld")
1403
		w.Part0 = magazineNew
1404
		w.Part1 = Player.Character:FindFirstChild("Right Arm")
1405
		w.C0 = CFrame.new(0, 1.1, 0)
1406
		w.C1 = CFrame.new()
1407
		w.Parent = magazineNew
1408
		local magazineNewL = Player.Character[Name.. " (Left)"].Magazine:Clone()
1409
		magazineNewL.Name = "New Magazine L"
1410
		magazineNewL.Transparency = 0
1411
		magazineNewL.Parent = Player.Character[Name.. " (Left)"]
1412
		local w = Instance.new("Weld")
1413
		w.Part0 = magazineNewL
1414
		w.Part1 = Player.Character:FindFirstChild("Left Arm")
1415
		w.C0 = CFrame.new(0, 1.1, 0)
1416
		w.C1 = CFrame.new()
1417
		w.Parent = magazineNewL				
1418
		for i = 125, 0, -15 do
1419
			if Player.Character:FindFirstChild("Torso") ~= nil then
1420
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1421
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1422
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)					
1423
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1424
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
1425
					wait()
1426
				else return false end
1427
			else return false end
1428
		end
1429
		Player.Character[Name].Handle.Reload:Play()		
1430
		Player.Character[Name].Magazine.Transparency = 0
1431
		Player.Character[Name].Shell.Transparency = 0	
1432
		Player.Character[Name.. " (Left)"].Magazine.Transparency = 0
1433
		Player.Character[Name.. " (Left)"].Shell.Transparency = 0
1434
		Player.Character[Name]["New Magazine"]:Remove()
1435
		Player.Character[Name.. " (Left)"]["New Magazine L"]:Remove()	
1436
		Player.Character[Name].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)	
1437
		Player.Character[Name.. " (Left)"].WeldPoint.Weld.C0 = CFrame.new(0, 0.9, 0.68)								
1438
		for i = 0, 125, 15 do
1439
			if Player.Character:FindFirstChild("Torso") ~= nil then
1440
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1441
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1442
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)					
1443
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1444
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
1445
					wait()
1446
				else return false end
1447
			else return false end
1448
		end
1449
		if magazine.Value == 0 then
1450
			Player.Character[Name].Handle.Lock.Pitch = 2.5
1451
			Player.Character[Name].Handle.Lock:Play()
1452
			Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
1453
			Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
1454
			CamShake(1, 30000)	
1455
			CamShake(1, -30000)											
1456
		else end
1457
		for i = 25, 0, -5 do
1458
			if Player.Character:FindFirstChild("Torso") ~= nil then
1459
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1460
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1461
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
1462
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1463
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1464
					wait()
1465
				else return false end
1466
			else return false end
1467
		end
1468
		playAnimation("rightHold")
1469
		playAnimation("leftHold")
1470
		return true
1471
	end
1472
	if format == "hammer" then
1473
		Player.Character[Name].Handle.Hammer:Play()	
1474
		for i = 25, 0, -5 do
1475
			if Player.Character:FindFirstChild("Torso") ~= nil then
1476
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1477
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1478
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1 + (i / 30), 0.5, 0.6 + (i / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad((25 * 2) - ((25 - i) * 2)))
1479
					wait()
1480
				else return false end
1481
			else return false end
1482
		end	
1483
		if Hammer == false then
1484
			Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.3, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)	
1485
		else 
1486
			Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.358, 0.02)	
1487
		end
1488
	end	
1489
	if format == "whip" then
1490
		Player.Character[Name].Handle.Melee:Play()		
1491
		for i = 0, 10, 5 do
1492
			if Player.Character:FindFirstChild("Torso") ~= nil then
1493
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1494
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1495
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i * 2), math.rad(-90))
1496
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1497
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 - i * 3), 0)
1498
					wait()
1499
				else return false end
1500
			else return false end
1501
		end
1502
		wait(0.1)
1503
		for i = 0, 10, 5 do
1504
			if Player.Character:FindFirstChild("Torso") ~= nil then
1505
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1506
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1507
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0)
1508
					wait()
1509
				else return false end
1510
			else return false end
1511
		end
1512
		for i = 10, 0, -5 do
1513
			if Player.Character:FindFirstChild("Torso") ~= nil then
1514
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1515
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1516
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1 + i * 0.05, 0.5 + i * 0.05, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5 + i * 5), 0)
1517
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1518
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-i * 2), math.rad(-90))
1519
					wait()
1520
				else return false end
1521
			else return false end
1522
		end	
1523
		if dual ~= true then
1524
			playAnimation("hold")
1525
			return true
1526
		else
1527
			playAnimation("rightHold")
1528
			playAnimation("leftHold")
1529
			return true
1530
		end
1531
	end	
1532
	if format == "fire" then
1533
		Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.358, 0.02)	
1534
		wait(0.01)
1535
		Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.2, 0.06)
1536
		if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
1537
			if silenced then
1538
				Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
1539
				Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
1540
				Player.Character[Name].Handle.Fire2:Play()
1541
				CamShake(15, 50000)
1542
			else
1543
				Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
1544
				Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
1545
				Player.Character[Name].Handle.Fire:Play()
1546
				CamShake(15, 50000)
1547
			end
1548
		else return false end
1549
		if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
1550
			if silenced == false then
1551
				coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
1552
			else end
1553
		else return false end
1554
		for i = 0, 10, 5 do
1555
			if Player.Character:FindFirstChild("Torso") ~= nil then
1556
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1557
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1558
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
1559
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1560
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1561
					wait()
1562
				else return false end
1563
			else return false end
1564
		end
1565
		makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))	
1566
		Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.3, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)			
1567
		if magazine.Value ~= 0 then
1568
			Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
1569
		elseif magazine.Value == 0 then
1570
			Player.Character[Name].Handle.Lock.Pitch = 1.5
1571
			Player.Character[Name].Shell.Transparency = 1				
1572
			Player.Character[Name].Handle.Lock:Play()
1573
		end
1574
		for i = 10, 0, -5 do
1575
			if Player.Character:FindFirstChild("Torso") ~= nil then
1576
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1577
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1578
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
1579
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1580
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
1581
					wait()
1582
				else return false end
1583
			else return false end
1584
		end
1585
	end
1586
	if format == "rightFire" then
1587
		Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.358, 0.02)	
1588
		wait(0.01)	
1589
		Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.2, 0.06)
1590
		if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
1591
			if silenced then
1592
				Player.Character[Name].Handle.Fire2.Volume = math.random(3, 8) / 10
1593
				Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
1594
				Player.Character[Name].Handle.Fire2:Play()
1595
				CamShake(15, 50000)
1596
			else
1597
				Player.Character[Name].Handle.Fire.Volume = math.random(8, 12) / 10
1598
				Player.Character[Name].Handle.Fire.Pitch = math.random(25, 35) / 20
1599
				Player.Character[Name].Handle.Fire:Play()
1600
				CamShake(15, 50000)
1601
			end
1602
		else return false end
1603
		if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
1604
			if silenced == false then
1605
				coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
1606
			else end
1607
		else return false end
1608
		for i = 0, 10, 5 do
1609
			if Player.Character:FindFirstChild("Torso") ~= nil then
1610
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1611
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1612
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), math.rad(-5))
1613
					wait()
1614
				else return false end
1615
			else return false end
1616
		end
1617
		Player.Character[Name].Hammer.Weld.C0 = CFrame.new(0, -0.3, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)			
1618
		makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))		
1619
		if magazine.Value ~= 0 then
1620
			Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
1621
		elseif magazine.Value == 0 then
1622
			Player.Character[Name].Handle.Lock.Pitch = 1.5
1623
			Player.Character[Name].Handle.Lock:Play()
1624
			Player.Character[Name].Shell.Transparency = 1	
1625
			Player.Character[Name.. " (Left)"].Shell.Transparency = 1						
1626
			Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.2, 0.06)
1627
		end
1628
		for i = 10, 0, -5 do
1629
			if Player.Character:FindFirstChild("Torso") ~= nil then
1630
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1631
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1632
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), math.rad(-5))
1633
					wait()
1634
				else return false end
1635
			else return false end
1636
		end
1637
	end
1638
	if format == "leftFire" then
1639
		Player.Character[Name.. " (Left)"].Hammer.Weld.C0 = CFrame.new(0, -0.358, 0.02)	
1640
		wait(0.01)	
1641
		Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.2, 0.06)	
1642
		if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") ~= nil then
1643
			if silenced then
1644
				Player.Character[Name.. " (Left)"].Handle.Fire2.Volume = math.random(3, 8) / 10
1645
				Player.Character[Name.. " (Left)"].Handle.Fire2.Pitch = math.random(1.8, 2)
1646
				Player.Character[Name.. " (Left)"].Handle.Fire2:Play()
1647
				CamShake(15, 50000)
1648
			else
1649
				Player.Character[Name.. " (Left)"].Handle.Fire.Volume = math.random(8, 12) / 10
1650
				Player.Character[Name.. " (Left)"].Handle.Fire.Pitch = math.random(25, 35) / 20
1651
				Player.Character[Name.. " (Left)"].Handle.Fire:Play()
1652
				CamShake(15, 50000)
1653
			end
1654
		end
1655
		if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") ~= nil then
1656
			if silenced == false then
1657
				coroutine.resume(coroutine.create(function() Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = true Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name.. " (Left)"].Muzzle.Smoke.Enabled = false Player.Character[Name.. " (Left)"].Muzzle.Fire.Enabled = false end))
1658
			else end
1659
		end
1660
		for i = 0, 10, 5 do
1661
			if Player.Character:FindFirstChild("Torso") ~= nil then
1662
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1663
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1664
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), math.rad(5))
1665
					wait()
1666
				else return false end
1667
			else return false end
1668
		end
1669
		makeShell(Player.Character[Name.. " (Left)"]:FindFirstChild("ShellOut"))	
1670
		Player.Character[Name.. " (Left)"].Hammer.Weld.C0 = CFrame.new(0, -0.3, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-50), 0, 0)			
1671
		if magazine.Value ~= 0 then
1672
			Player.Character[Name.. " (Left)"].Slide.Weld.C0 = CFrame.new(0, 0.4, 0.06)
1673
		elseif magazine.Value == 0 then
1674
			Player.Character[Name].Handle.Lock.Pitch = 1.5
1675
			Player.Character[Name].Handle.Lock:Play()	
1676
			Player.Character[Name].Shell.Transparency = 1
1677
			Player.Character[Name.. " (Left)"].Shell.Transparency = 1					
1678
			Player.Character[Name].Slide.Weld.C0 = CFrame.new(0, 0.2, 0.06)
1679
		end
1680
		for i = 10, 0, -5 do
1681
			if Player.Character:FindFirstChild("Torso") ~= nil then
1682
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1683
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1684
					Player.Character.Torso["Left Shoulder 2"].C1 =  CFrame.new(0.72, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), math.rad(5))
1685
					wait()
1686
				else return false end
1687
			else return false end
1688
		end
1689
	end
1690
	return true
1691
end
1692
1693
1694
function CamShake(time, freq)
1695
	coroutine.resume(coroutine.create(function()
1696
		local cam = game:GetService("Workspace").CurrentCamera
1697
		local time = 10
1698
		local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
1699
		if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
1700
		if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
1701
		cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(seed.x * time, seed.y * time, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
1702
		for i = 1, time do
1703
			cam.CoordinateFrame = (CFrame.new(cam.Focus.p) * (cam.CoordinateFrame - cam.CoordinateFrame.p) * CFrame.fromEulerAnglesXYZ(-seed.x, -seed.y, 0)) * CFrame.new(0, 0, (cam.CoordinateFrame.p - cam.Focus.p).magnitude)
1704
			wait()
1705
		end
1706
	end))
1707
end
1708
1709
1710
function makeShell(part)
1711
	if part == nil then return false end
1712
	local casing = Instance.new("Part")
1713
	casing.Name = "Shell"
1714
	casing.formFactor = "Custom"
1715
	casing.Size = Vector3.new(0.2, 0.2, 0.2)
1716
	casing.CFrame = CFrame.new(part.Position) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
1717
	casing.BrickColor = BrickColor.new("New Yeller")
1718
	local mesh = Instance.new("CylinderMesh")
1719
	mesh.Scale = Vector3.new(0.51, 1, 0.51)
1720
	mesh.Parent = casing
1721
	casing.Parent = game:GetService("Workspace")
1722
	casing:BreakJoints()
1723
	casing.Velocity = (part.CFrame.lookVector * 50) + Vector3.new(0, 10, 0)
1724
	coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
1725
end
1726
1727
1728
function Weld(x, y)
1729
	local weld = Instance.new("Weld")
1730
	weld.Part0 = x
1731
	weld.Part1 = y
1732
	CJ = CFrame.new(x.Position)
1733
	C0 = x.CFrame:inverse() * CJ
1734
	C1 = y.CFrame:inverse() * CJ
1735
	weld.C0 = C0
1736
	weld.C1 = C1
1737
	weld.Parent = x
1738
end
1739
1740
1741
function tagHumanoid(humanoid)
1742
	local tag = Instance.new("ObjectValue")
1743
	tag.Name = "creator"
1744
	tag.Value = Player
1745
	tag.Parent = humanoid
1746
	local tag = Instance.new("StringValue")
1747
	tag.Name = "creatorType1"
1748
	tag.Value = Name
1749
	tag.Parent = humanoid
1750
	local tag = Instance.new("StringValue")
1751
	tag.Name = "creatorType2"
1752
	tag.Value = "shot"
1753
	tag.Parent = humanoid
1754
end
1755
1756
1757
function untagHumanoid(humanoid)
1758
	if humanoid ~= nil then
1759
		local tag = humanoid:FindFirstChild("creator")
1760
		if tag ~= nil then
1761
			tag:Remove()
1762
		end
1763
		local tag = humanoid:FindFirstChild("creatorType1")
1764
		if tag ~= nil then
1765
			tag:Remove()
1766
		end
1767
		local tag = humanoid:FindFirstChild("creatorType2")
1768
		if tag ~= nil then
1769
			tag:Remove()
1770
		end
1771
	end
1772
end
1773
1774
1775
function fire(startPoint, endPoint, hit)
1776
	local trail = Instance.new("Part")
1777
	trail.Name = "Bullet Trail"
1778
	trail.BrickColor = BrickColor.new("Dark stone grey")
1779
	trail.TopSurface = 0
1780
	trail.BottomSurface = 0
1781
	trail.formFactor = 0
1782
	trail.Size = Vector3.new(1, 1, 1)
1783
	trail.Transparency = 0.5
1784
	trail.Anchored = true
1785
	trail.CanCollide = false
1786
	trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
1787
	trail.Parent = game:GetService("Workspace")
1788
	local mesh = Instance.new("SpecialMesh")
1789
	mesh.MeshType = "Brick"
1790
	mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
1791
	mesh.Parent = trail
1792
	coroutine.resume(coroutine.create(function(part) for i = 1, 10 do part.Mesh.Scale = Vector3.new(part.Mesh.Scale.x - 0.01, part.Mesh.Scale.y - 0.01, part.Mesh.Scale.z) wait() end part:Remove() end), trail)
1793
	if hit ~= nil then
1794
		if hit.Parent == nil then return end
1795
		if hit.Parent.ClassName == "Hat" then
1796
			if hit.Parent.Parent.Humanoid ~= nil then
1797
				hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
1798
			end
1799
		end
1800
		if hit.Parent:FindFirstChild("Humanoid") ~= nil then
1801
			tagHumanoid(hit.Parent.Humanoid)
1802
			if hit.Name == "Head" then
1803
				hit.Parent.Humanoid:TakeDamage(damage * 10)
1804
			elseif hit.Name == "Torso" then
1805
				hit.Parent.Humanoid:TakeDamage(damage * 2)
1806
			elseif hit.Name == "Left Leg" then
1807
				hit.Parent.Humanoid:TakeDamage(damage)	
1808
				hit.Parent.Humanoid.Sit = true	
1809
			elseif hit.Name == "Right Leg" then
1810
				hit.Parent.Humanoid:TakeDamage(damage)	
1811
				hit.Parent.Humanoid.Sit = true								
1812
			else
1813
				hit.Parent.Humanoid:TakeDamage(damage)
1814
			end
1815
			if math.random(1, 10) == 1 then
1816
				hit.Parent.Humanoid.Sit = true
1817
			end
1818
			delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
1819
		end
1820
		if hit.Anchored == false then
1821
			hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
1822
		end
1823
	end
1824
end
1825
1826
1827
function onButton1Down(mouse)
1828
	if selected == false then return end
1829
	if Player.Character:FindFirstChild(Name) ~= nil and Button1Down == false and canFire == true and (function() if dual == true then if Player.Character:FindFirstChild(Name.. " (Left)") ~= nil then return true else return false end else return true end end)() == true then
1830
		if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
1831
		if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
1832
		if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
1833
		if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
1834
		mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
1835
		Button1Down = true
1836
		canFire = false
1837
		canFire2 = true
1838
		while canFire2 == true do
1839
			local humanoid = Player.Character:FindFirstChild("Humanoid")
1840
			if humanoid == nil then
1841
				canFire2 = false
1842
				break
1843
			end
1844
			if humanoid.Health <= 0 then
1845
				canFire2 = false
1846
				break
1847
			end
1848
			local fireLeft = false
1849
			if automatic == false and burst == false then
1850
				canFire2 = false
1851
			elseif automatic == false and burst == true then
1852
				if burstCount >= burstCountMax then
1853
					canFire2 = false
1854
					burstCount = 0
1855
					break
1856
				end
1857
				burstCount = burstCount + 1
1858
			elseif automatic == true and burst == false then
1859
				fireLeft = true
1860
			end
1861
			if magazine.Value > 0 and Hammer == true then
1862
				magazine.Value = magazine.Value - 1
1863
				updateGui()
1864
				if silenced == true then
1865
					CamShake(1, Spread)
1866
				else end
1867
				fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
1868
				coroutine.resume(coroutine.create(function()
1869
					if dual == true then
1870
						playAnimation("rightFire")
1871
					elseif dual == false then
1872
						playAnimation("fire")
1873
					end
1874
				end))				
1875
				if dual == true and magazine.Value ~= 0 then
1876
					magazine.Value = magazine.Value - 1	
1877
					updateGui()
1878
					wait(math.random(0, 0.15))
1879
					fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
1880
					coroutine.resume(coroutine.create(function()
1881
						playAnimation("leftFire")
1882
					end))					
1883
				end
1884
			else
1885
				Player.Character[Name].Handle.Empty:Play()
1886
			end
1887
			if fireLeft == true and dual == true and automatic == true then
1888
				if magazine.Value > 0 then
1889
					coroutine.resume(coroutine.create(function()
1890
						wait(readyTime / 2)
1891
						magazine.Value = magazine.Value - 1
1892
						updateGui()
1893
						fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
1894
						if silenced == true then
1895
							CamShake(1, Spread)
1896
						else end
1897
						playAnimation("leftFire")
1898
					end))
1899
				else
1900
					coroutine.resume(coroutine.create(function()
1901
						wait(readyTime / 2)
1902
						Player.Character[Name].Handle.Empty:Play()
1903
					end))
1904
				end
1905
			end
1906
			wait(readyTime)
1907
		end
1908
		if magazine.Value ~= 0 then
1909
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
1910
		else end
1911
		canFire = true
1912
	end
1913
end
1914
1915
1916
function onButton1Up(mouse)
1917
	if selected == false then return end
1918
	Button1Down = false
1919
	canFire2 = false
1920
	burstCount = 0
1921
	while canFire == false do wait() end
1922
	if dual == true and automatic == false then
1923
		if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
1924
		if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
1925
		mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
1926
		canFire = false
1927
		canFire2 = true
1928
		while canFire2 == true do
1929
			local humanoid = Player.Character:FindFirstChild("Humanoid")
1930
			if humanoid == nil then
1931
				canFire2 = false
1932
				break
1933
			end
1934
			if humanoid.Health <= 0 then
1935
				canFire2 = false
1936
				break
1937
			end
1938
			if burst == false then
1939
				canFire2 = false
1940
			elseif burst == true then
1941
				if burstCount >= burstCountMax then
1942
					canFire2 = false
1943
					burstCount = 0
1944
					break
1945
				end
1946
				burstCount = burstCount + 1
1947
			end
1948
			if magazine.Value <= 0 then
1949
				Player.Character[Name].Handle.Empty:Play()
1950
			else end
1951
		end
1952
		if magazine.Value ~= 0 then
1953
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
1954
		else end
1955
		canFire = true
1956
	end
1957
end
1958
1959
1960
function onKeyDown(key, mouse)
1961
	if selected == false then return end
1962
	key = key:lower()
1963
	if key == "q" and Button1Down == false and canFire == true then
1964
		if mouse.Target == nil then return end
1965
		if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
1966
			if dual == true then onKeyDown("t", mouse) end
1967
			onDeselected(mouse)
1968
			removeParts("RightHolster")
1969
			script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
1970
		end
1971
	end
1972
	if key == "e" and Button1Down == false and canFire == true and canSilence == true then
1973
		if silenced then
1974
			silenced = false
1975
			Player.Character[Name].Handle.Lock.Pitch = 5
1976
			Player.Character[Name].Handle.Lock:Play()
1977
			if Player.Character:FindFirstChild(Name) == nil then return end
1978
			if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
1979
			if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
1980
			Player.Character[Name].Muzzle.Transparency = 1
1981
			Player.Character[Name].Silencer1.Transparency = 1			
1982
			Player.Character[Name].Muzzle.Name = "Silencer"
1983
			Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
1984
			if dual == true then
1985
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
1986
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
1987
				Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
1988
				Player.Character[Name.. " (Left)"].Silencer1.Transparency = 1					
1989
				Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
1990
				Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
1991
			end
1992
		else		
1993
			silenced = true
1994
			Player.Character[Name].Handle.Lock.Pitch = 5
1995
			Player.Character[Name].Handle.Lock:Play()			
1996
			if Player.Character:FindFirstChild(Name) == nil then return end
1997
			if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
1998
			if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
1999
			Player.Character[Name].Silencer.Transparency = 0
2000
			Player.Character[Name].Silencer1.Transparency = 0					
2001
			Player.Character[Name].Muzzle.Name = "Muzzle 2"
2002
			Player.Character[Name].Silencer.Name = "Muzzle"
2003
			if dual == true then
2004
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
2005
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
2006
				Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
2007
				Player.Character[Name.. " (Left)"].Silencer1.Transparency = 0						
2008
				Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
2009
				Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
2010
			end
2011
		end
2012
	end
2013
	if key == "r" and Button1Down == false and canFire == true then
2014
		if ammo.Value > 0 and magazine.Value ~= magazineMax.Value + Chamber then
2015
			canFire = false
2016
			burstCount = 0
2017
			mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2018
			if magazine.Value > 0 then magazine.Value = Chamber end
2019
			updateGui()
2020
			if dual == true then
2021
				playAnimation("reloadDual")
2022
			elseif dual == false then
2023
				playAnimation("reload")
2024
			end
2025
			if ammo.Value - magazineMax.Value < 0 then
2026
				magazine.Value = ammo.Value
2027
				ammo.Value = 0
2028
			elseif ammo.Value - magazineMax.Value >= 0 then
2029
				ammo.Value = ammo.Value - magazineMax.Value
2030
				magazine.Value = magazine.Value + MagSize
2031
			end
2032
			updateGui()
2033
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2034
			canFire = true
2035
		end
2036
	end
2037
	if key == "t" and Button1Down == false and canFire == true and canDual == true then
2038
		canFire = false
2039
		Hammer = true
2040
		if dual == false then
2041
			local weapon = nil
2042
			for _, p in pairs(Player.Backpack:GetChildren()) do
2043
				if p.Name == Name and p ~= script.Parent then weapon = p break end
2044
			end
2045
			if weapon ~= nil then
2046
				dual = true
2047
				Chamber = 2
2048
				MagSize = MagSize * 2
2049
				weapon.Name = "Dual"
2050
				weapon.Parent = script
2051
				removeParts("RightHand")
2052
				makeParts("RightHand")
2053
				removeParts("RightHolster")
2054
				makeParts("LeftHolster")
2055
				playAnimation("leftEquip")
2056
				removeParts("LeftHolster")
2057
				makeParts("LeftHand")
2058
				magazineMax.Value = math.ceil(magazineMax.Value * 2)
2059
				ammoMax.Value = math.ceil(ammoMax.Value * 2)
2060
				magazine.Value = magazine.Value + weapon.Magazine.Value
2061
				ammo.Value = ammo.Value + weapon.Ammo.Value
2062
				updateGui()
2063
			end
2064
		elseif dual == true then
2065
			local weapon = script:FindFirstChild("Dual")
2066
			if weapon ~= nil then
2067
				dual = false
2068
				Chamber = 1
2069
				MagSize = MagSize * 0.5
2070
				weapon.Name = Name
2071
				weapon.Parent = Player.Backpack
2072
				removeParts("RightHand")
2073
				makeParts("RightHand")
2074
				playAnimation("leftUnequip")
2075
				removeParts("LeftHand")
2076
				makeParts("RightHolster")
2077
				playAnimation("hold")
2078
				weapon.Magazine.Value = math.floor(magazine.Value / 2)
2079
				weapon.Ammo.Value = math.floor(ammo.Value / 2)
2080
				magazineMax.Value = math.ceil(magazineMax.Value / 2)
2081
				ammoMax.Value = math.ceil(ammoMax.Value / 2)
2082
				magazine.Value = math.ceil(magazine.Value / 2)
2083
				ammo.Value = math.ceil(ammo.Value / 2)
2084
				updateGui()
2085
			end
2086
		end
2087
		canFire = true
2088
	end
2089
	if key == "y" and canZoom == true then
2090
		if zoom == false then
2091
			zoom = true
2092
			local pos = mouse.Hit.p
2093
			local target = mouse.Target
2094
			local cam = game:GetService("Workspace").CurrentCamera
2095
			focus = Instance.new("Part", workspace)
2096
			focus.Anchored = true
2097
			focus.CanCollide = false
2098
			focus.Transparency = 1
2099
			focus.TopSurface = 0
2100
			focus.BottomSurface = 0
2101
			focus.formFactor = "Plate"
2102
			focus.Size = Vector3.new(0, 0, 0)
2103
			focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
2104
			cam.CameraSubject = focus
2105
			cam.CameraType = "Attach"
2106
			while zoom == true and selected == true do
2107
				local set = false
2108
				if target ~= nil then
2109
					if target.Parent ~= nil then
2110
						if target.Anchored == false then
2111
							focus.CFrame = CFrame.new(target.CFrame.p) * (CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p) - CFrame.new(Player.Character.Torso.CFrame.p, target.CFrame.p).p)
2112
							set = true
2113
						end
2114
					end
2115
				end
2116
				if set == false then
2117
					focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
2118
				end
2119
				wait()
2120
			end
2121
			if focus ~= nil then focus:Remove() focus = nil end
2122
			local cam = game:GetService("Workspace").CurrentCamera
2123
			cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
2124
			cam.CameraType = "Custom"
2125
		else
2126
			zoom = false
2127
		end
2128
	end
2129
	if key == "u" and Button1Down == false and canFire == true then
2130
		if automatic == false and burst == false then
2131
			if switchToBurst == true then
2132
				burst = true
2133
				local m = Instance.new("Message", Player)
2134
				m.Text = "Burst"
2135
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2136
				delay(2.5, function() m:Remove() end)
2137
			elseif switchToAutomatic == true then
2138
				automatic = true
2139
				local m = Instance.new("Message", Player)
2140
				m.Text = "Automatic"
2141
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2142
				delay(2.5, function() m:Remove() end)
2143
			end
2144
		elseif automatic == false and burst == true then
2145
			if switchToAutomatic == true then
2146
				automatic = true
2147
				burst = false
2148
				local m = Instance.new("Message", Player)
2149
				m.Text = "Automatic"
2150
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2151
				delay(2.5, function() m:Remove() end)
2152
			elseif switchToSingle == true then
2153
				burst = false
2154
				local m = Instance.new("Message", Player)
2155
				m.Text = "Single"
2156
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2157
				delay(2.5, function() m:Remove() end)
2158
			end
2159
		elseif automatic == true and burst == false then
2160
			if switchToSingle == true then
2161
				automatic = false
2162
				local m = Instance.new("Message", Player)
2163
				m.Text = "Single"
2164
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2165
				delay(2.5, function() m:Remove() end)
2166
			elseif switchToBurst == true then
2167
				automatic = false
2168
				burst = true
2169
				local m = Instance.new("Message", Player)
2170
				m.Text = "Burst"
2171
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2172
				delay(2.5, function() m:Remove() end)
2173
			end
2174
		end
2175
	end
2176
	if key == "c" and dual == false and canFire == true then
2177
		if Hammer == false then
2178
			playAnimation("hammer")
2179
			Hammer = true
2180
		else
2181
			playAnimation("hammer")
2182
			Hammer = false
2183
		end
2184
	end	
2185
	if key == "f" and canFire == true then
2186
		canFire = false
2187
		canHit = true
2188
		playAnimation("whip")
2189
		canHit = false
2190
		wait(1)
2191
		canFire = true
2192
	end		
2193
end
2194
2195
2196
function onSelected(mouse)
2197
	if selected == true then return end
2198
	selected = true
2199
	canFire = false
2200
	mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2201
	while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
2202
		if Player.Character.WeaponActivated.Value == nil then break end
2203
		if Player.Character.WeaponActivated.Value.Parent == nil then break end
2204
		wait()
2205
	end
2206
	updateGui()
2207
	local weapon = Instance.new("ObjectValue")
2208
	weapon.Name = "WeaponActivated"
2209
	weapon.Value = script.Parent
2210
	weapon.Parent = Player.Character
2211
	DisableLimb(1, Player.Character)
2212
	DisableLimb(2, Player.Character)
2213
	ForceAngle(1, 0, Player.Character)
2214
	ForceAngle(2, 0, Player.Character)
2215
	if dual == true then
2216
		coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
2217
		playAnimation("rightEquip")
2218
		removeParts("LeftHolster")
2219
		makeParts("LeftHand")
2220
	else
2221
		playAnimation("equip")
2222
	end
2223
	removeParts("RightHolster")
2224
	makeParts("RightHand")
2225
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
2226
	mouse.Button1Up:connect(function() onButton1Up(mouse) end)
2227
	mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
2228
	mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2229
	canFire = true
2230
end
2231
2232
2233
function onDeselected(mouse)
2234
	if selected == false then return end
2235
	Button1Down = false
2236
	while canFire == false do
2237
		wait()
2238
	end
2239
	selected = false
2240
	if dual == true then
2241
		if math.random(1, 2) == 1 then
2242
			coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
2243
			wait(math.random(1, 10) / 10)
2244
			playAnimation("rightUnequip")
2245
		else
2246
			coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
2247
			wait(math.random(1, 10) / 10)
2248
			playAnimation("leftUnequip")
2249
		end
2250
		removeParts("LeftHand")
2251
		makeParts("LeftHolster")
2252
	else
2253
		playAnimation("unequip")
2254
	end
2255
	removeParts("RightHand")
2256
	makeParts("RightHolster")
2257
	ForceAngle(1, 0, Player.Character)
2258
	ForceAngle(2, 0, Player.Character)
2259
	ResetLimbCFrame(1, Player.Character)
2260
	ResetLimbCFrame(2, Player.Character)
2261
	EnableLimb(1, Player.Character)
2262
	EnableLimb(2, Player.Character)
2263
	if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
2264
	if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
2265
		if Player.Character.WeaponActivated.Value == script.Parent then
2266
			Player.Character.WeaponActivated:Remove()
2267
		end
2268
	end
2269
	while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
2270
		if Player.Character.WeaponActivated.Value == nil then break end
2271
		if Player.Character.WeaponActivated.Value.Parent == nil then break end
2272
		wait()
2273
	end
2274
end
2275
2276
2277
if script.Parent.ClassName ~= "HopperBin" then
2278
	if Player == nil then print("Error: Player not found!") return end
2279
	Tool = Instance.new("HopperBin")
2280
	Tool.Name = Name
2281
	Tool.Parent = Player.Backpack
2282
	script.Name = "Main"
2283
	script.Parent = Tool
2284
end wait() if script.Parent.ClassName == "HopperBin" then
2285
	while script.Parent.Parent.ClassName ~= "Backpack" do
2286
		wait()
2287
	end
2288
	if script.Parent:FindFirstChild("MagazineMax") == nil then
2289
		magazineMax = Instance.new("NumberValue")
2290
		magazineMax.Name = "MagazineMax"
2291
		magazineMax.Value = 10
2292
		magazineMax.Parent = script.Parent
2293
	else
2294
		magazineMax = script.Parent.MagazineMax
2295
	end
2296
	if script.Parent:FindFirstChild("Magazine") == nil then
2297
		magazine = Instance.new("NumberValue")
2298
		magazine.Name = "Magazine"
2299
		magazine.Value = 0
2300
		magazine.Parent = script.Parent
2301
	else
2302
		magazine = script.Parent.Magazine
2303
	end
2304
	if script.Parent:FindFirstChild("AmmoMax") == nil then
2305
		ammoMax = Instance.new("NumberValue")
2306
		ammoMax.Name = "AmmoMax"
2307-
		ammoMax.Value = 260
2307+
		ammoMax.Value = 99999999999999999999999999999999999999999999999999
2308
		ammoMax.Parent = script.Parent
2309
	else
2310
		ammoMax = script.Parent.AmmoMax
2311
	end
2312
	if script.Parent:FindFirstChild("Ammo") == nil then
2313
		ammo = Instance.new("NumberValue")
2314
		ammo.Name = "Ammo"
2315
		ammo.Value = script.Parent.AmmoMax.Value
2316
		ammo.Parent = script.Parent
2317
	else
2318
		ammo = script.Parent.Ammo
2319
	end
2320
	Player = script.Parent.Parent.Parent
2321
	makeParts("RightHolster")
2322
	script.Parent.Selected:connect(onSelected)
2323
	script.Parent.Deselected:connect(onDeselected)
2324
end