View difference between Paste ID: ce2vMHx1 and Ni1LzApr
SHOW: | | - or go back to the newest paste.
1
if script == nil then return end
2
3
4-
Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("Balakyrie")
4+
Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("batdead12")
5
Name = "Spirit of Vengence"
6
-- Mechanics
7
WSPenalty = 50
8
Reliability = 75
9
Jammed = false
10
Mode = 0
11
Spread = 900000
12
-- Appearance
13
Reciever = 0
14
MC = BrickColor.new("White")
15
DC = BrickColor.new("White")
16
GC = BrickColor.new("White")
17
MR = 0
18
GR = 0
19
Magazine = "Beta-C"
20
Sight = 1
21
Grip = true
22
Attachment = true
23
Stock = 1
24
-- Stats/Abilities
25
selected = false
26
canDual = false
27
dual = false
28
Button1Down = false
29
damage = 40
30
canFire = true
31
canFire2 = false
32
readyTime = 0.09
33
automatic = false
34
burst = false
35
burstCount = 0
36
burstCountMax = 15
37
canSilence = true
38
silenced = false
39
canZoom = false
40
zoom = false
41
switchToSingle = true
42
switchToBurst = true
43
switchToAutomatic = true
44
45
46
ammoGui = Instance.new("ScreenGui")
47
ammoGui.Name = Name
48
local frame = Instance.new("Frame")
49
frame.Name = "Frame"
50
frame.Size = UDim2.new(0, 165, 0, 60)
51
frame.Position = UDim2.new(0, 0, 1, -400)
52
frame.BackgroundColor3 = Color3.new(1, 1, 1)
53
frame.BorderColor3 = Color3.new(0, 0, 0)
54
frame.Parent = ammoGui
55
local label = Instance.new("TextLabel")
56
label.Name = "Weapon"
57
label.Text = "Weapon: " ..Name
58
label.Size = UDim2.new(1, 0, 0, 20)
59
label.Position = UDim2.new(0, 0, 0, 0)
60
label.BackgroundColor3 = Color3.new(1, 0, 0)
61
label.BorderColor3 = Color3.new(0, 0, 0)
62
label.Parent = frame
63
local label = Instance.new("TextLabel")
64
label.Name = "MagazinePrefix"
65
label.Text = "    " ..Magazine.. " Magazine:"
66
label.TextXAlignment = "Left"
67
label.Size = UDim2.new(1, 0, 0, 20)
68
label.Position = UDim2.new(0, 0, 0, 20)
69
label.BackgroundColor3 = Color3.new(1, 1, 1)
70
label.BorderColor3 = Color3.new(0, 0, 0)
71
label.Parent = frame
72
local label = Instance.new("TextLabel")
73
label.Name = "Magazine"
74
label.Text = "0/0"
75
label.TextXAlignment = "Right"
76
label.Size = UDim2.new(1, 0, 0, 20)
77
label.Position = UDim2.new(0, -10, 0, 20)
78
label.BackgroundTransparency = 1
79
label.BorderSizePixel = 0
80
label.Parent = frame
81
local label = Instance.new("TextLabel")
82
label.Name = "AmmoPrefix"
83
label.Text = "    5.56x45mm NATO:"
84
label.TextXAlignment = "Left"
85
label.Size = UDim2.new(1, 0, 0, 20)
86
label.Position = UDim2.new(0, 0, 0, 40)
87
label.BackgroundColor3 = Color3.new(1, 1, 1)
88
label.BorderColor3 = Color3.new(0, 0, 0)
89
label.Parent = frame
90
local label = Instance.new("TextLabel")
91
label.Name = "Ammo"
92
label.Text = "0/0"
93
label.TextXAlignment = "Right"
94
label.Size = UDim2.new(1, 0, 0, 20)
95
label.Position = UDim2.new(0, -10, 0, 40)
96
label.BackgroundTransparency = 1
97
label.BorderSizePixel = 0
98
label.Parent = frame
99
100
101
function updateGui()
102
	if selected == false then return end
103
	if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
104
	if Player.PlayerGui:FindFirstChild(Name) == nil then
105
		ammoGui:Clone().Parent = Player.PlayerGui
106
	end
107
	Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
108
	Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
109
end
110
111
112
function makeParts(format)
113
	local model = Instance.new("Model")
114
	model.Name = Name
115
	local pm = Instance.new("Part")
116
	pm.Name = "Handle"
117
	pm.formFactor = "Symmetric"
118
	pm.Size = Vector3.new(1, 1, 1)
119
	pm.BrickColor = MC
120
	pm.Reflectance = MR
121
	pm.CanCollide = false
122
	pm.Locked = true
123
	pm.TopSurface = 0
124
	pm.BottomSurface = 0
125
	pm.Parent = model
126
	local m = Instance.new("BlockMesh")
127
	m.Scale = Vector3.new(0.3, 1.1, 0.41)
128
	m.Offset = Vector3.new(0, -0.14, 0.07)
129
	m.Parent = pm
130
	if format ~= nil then
131
		local w = Instance.new("Weld")
132
		w.Part0 = pm
133
		if format == "RightHand" then
134
			w.Part1 = Player.Character:FindFirstChild("Right Arm")
135
			w.C0 = CFrame.new(0, 1.15, 0.7)
136
			w.C1 = CFrame.new()
137
		elseif format == "RightHolster" then
138
			w.Part1 = Player.Character:FindFirstChild("Torso")
139
			w.C0 = CFrame.new(-0.65, -0.6, 0.4) * CFrame.fromEulerAnglesXYZ(math.rad(40), math.rad(90), 0)
140
			w.C1 = CFrame.new()
141
			model.Name = Name.. " (Holstered)"
142
		end
143
		w.Parent = pm
144
		model.Parent = Player.Character
145
	end
146
	--[[
147
	sniper1  http://www.roblox.com/asset/?id=1868836
148
	equip    http://www.roblox.com/asset/?id=13510737
149
	fire1     http://www.roblox.com/asset/?id=2760979
150
	fire2    http://www.roblox.com/asset/?id=13510352
151
	fire3    http://www.roblox.com/asset/?id=2692806
152
	fire4    http://www.roblox.com/asset/?id=2691586
153
	fire5    http://www.roblox.com/asset/?id=2920959
154
	fire6    http://www.roblox.com/asset/?id=2697431
155
	fire7    http://www.roblox.com/asset/?id=2920959
156
	reload1   http://www.roblox.com/asset/?id=2691591
157
	reload2   http://www.roblox.com/asset/?id=2697432
158
	reload3  http://www.roblox.com/asset/?id=2920960
159
	reload4  http://www.roblox.com/asset/?id=2761842
160
	shotgun1 http://www.roblox.com/asset/?id=2697294
161
	--]]
162
	local s = Instance.new("Sound")
163
	s.Name = "Fire"
164
	s.SoundId = "http://www.roblox.com/Asset/?id=10209803" --"http://www.roblox.com/asset/?id=2920959"
165
	s.Volume = 1
166
	s.Pitch = 2
167
	s.Looped = false
168
	s.Parent = pm
169
	local s = Instance.new("Sound")
170
	s.Name = "Fire2"
171
	s.SoundId = "http://www.roblox.com/Asset/?id=10209633"
172
	s.Volume = 1
173
	s.Pitch = 3
174
	s.Looped = false
175
	s.Parent = pm
176
	local s = Instance.new("Sound")
177
	s.Name = "Jam"
178
	s.SoundId = "http://www.roblox.com/Asset/?id=10209636"
179
	s.Volume = 1
180
	s.Pitch = 2
181
	s.Looped = false
182
	s.Parent = pm	
183
	local s = Instance.new("Sound")
184
	s.Name = "Lock"
185
	s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
186
	s.Volume = 1
187
	s.Pitch = 3
188
	s.Looped = false
189
	s.Parent = pm
190
	local s = Instance.new("Sound")
191
	s.Name = "Release"
192
	s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
193
	s.Volume = 1
194
	s.Pitch = 2
195
	s.Looped = false
196
	s.Parent = pm
197
	local s = Instance.new("Sound")
198
	s.Name = "Reload"
199
	s.SoundId = "http://www.roblox.com/asset/?id=2697295"
200
	s.Volume = 1
201
	s.Pitch = 7.5
202
	s.Looped = false
203
	s.Parent = pm
204
	local s = Instance.new("Sound")
205
	s.Name = "Empty"
206
	s.SoundId = "http://www.roblox.com/asset/?id=2697295"
207
	s.Volume = 1
208
	s.Pitch = 5
209
	s.Looped = false
210
	s.Parent = pm
211
	local s = Instance.new("Sound")
212
	s.Name = "Switch"
213
	s.SoundId = "http://www.roblox.com/asset/?id=2697295"
214
	s.Volume = 1
215
	s.Pitch = 10
216
	s.Looped = false
217
	s.Parent = pm
218
	local s = Instance.new("Sound")
219
	s.Name = "Equip"
220
	s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
221
	s.Volume = 1
222
	s.Pitch = 1.2
223
	s.Looped = false
224
	s.Parent = pm
225
	local p = Instance.new("Part")
226
	p.Name = "ShellOut"
227
	p.formFactor = "Symmetric"
228
	p.Size = Vector3.new(1, 1, 1)
229
	p.Transparency = 1
230
	p.Locked = true
231
	p.CanCollide = false
232
	p.TopSurface = 0
233
	p.BottomSurface = 0
234
	p.Parent = model
235
	local w = Instance.new("Weld")
236
	w.Part0 = p
237
	w.Part1 = pm
238
	w.C0 = CFrame.new(0, 0.4, 0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
239
	w.C1 = CFrame.new()
240
	w.Parent = p	
241
	local p = Instance.new("Part")
242
	p.Name = "Grip"
243
	p.formFactor = "Symmetric"
244
	p.Size = Vector3.new(1, 1, 1)
245
	p.BrickColor = GC
246
	p.Reflectance = GR
247
	p.CanCollide = false
248
	p.Locked = true
249
	p.TopSurface = 0
250
	p.BottomSurface = 0
251
	p.Parent = model
252
	local m = Instance.new("BlockMesh")
253
	m.Scale = Vector3.new(0.29, 0.38, 0.8)
254
	m.Parent = p
255
	local w = Instance.new("Weld")
256
	w.Part0 = p
257
	w.Part1 = pm
258
	w.C0 = CFrame.new(0, -0.15, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
259
	w.C1 = CFrame.new()
260
	w.Parent = p
261
	local p = Instance.new("Part")
262
	p.Name = "Magazine Housing"
263
	p.formFactor = "Symmetric"
264
	p.Size = Vector3.new(1, 1, 1)
265
	p.BrickColor = MC
266
	p.Reflectance = MR
267
	p.CanCollide = false
268
	p.Locked = true
269
	p.TopSurface = 0
270
	p.BottomSurface = 0
271
	p.Parent = model
272
	local m = Instance.new("BlockMesh")
273
	m.Scale = Vector3.new(0.3, 0.46, 0.4)
274
	m.Parent = p
275
	local w = Instance.new("Weld")
276
	w.Part0 = p
277
	w.Part1 = pm
278
	w.C0 = CFrame.new(0, 0.46, -0.21)
279
	w.C1 = CFrame.new()
280
	w.Parent = p
281
	local p = Instance.new("Part")
282
	p.Name = "BoltHole" --------------
283
	p.CanCollide = false
284
	p.formFactor = "Symmetric"
285
	p.Size = Vector3.new(1, 1, 1)
286
	p.BrickColor = BrickColor.new("Really black")
287
	p.Locked = true
288
	p.TopSurface = 0
289
	p.BottomSurface = 0
290
	p.Parent = model
291
	local m = Instance.new("CylinderMesh")
292
	m.Scale = Vector3.new(0.13, 0.29, 0.13)
293
	m.Parent = p
294
	local w = Instance.new("Weld")
295
	w.Part0 = p
296
	w.Part1 = pm
297
	w.C0 = CFrame.new(-0.1, 0.4, -0.04)
298
	w.C1 = CFrame.new()
299
	w.Parent = p	
300
	local p = Instance.new("Part")
301
	p.Name = "MagazineHole"
302
	p.formFactor = "Symmetric"
303
	p.Size = Vector3.new(1, 1, 1)
304
	p.BrickColor = BrickColor.new("Really black")
305
	p.CanCollide = false
306
	p.Locked = true
307
	p.TopSurface = 0
308
	p.BottomSurface = 0
309
	p.Parent = model
310
	local m = Instance.new("BlockMesh")
311
	m.Scale = Vector3.new(0.28, 0.44, 0.406)
312
	m.Parent = p
313
	local w = Instance.new("Weld")
314
	w.Part0 = p
315
	w.Part1 = pm
316
	w.C0 = CFrame.new(0, 0.46, -0.21)
317
	w.C1 = CFrame.new()
318
	w.Parent = p	
319
	if Magazine == "Beta-C" then
320
		local pm2 = Instance.new("Part")
321
		pm2.Name = "Magazine"
322
		pm2.formFactor = "Symmetric"
323
		pm2.Size = Vector3.new(1, 1, 1)
324
		pm2.BrickColor = BrickColor.new("Dark stone grey")
325
		pm2.Locked = true
326
		pm2.CanCollide = false
327
		pm2.TopSurface = 0
328
		pm2.BottomSurface = 0
329
		pm2.Parent = model
330
		local m = Instance.new("BlockMesh")
331
		m.Scale = Vector3.new(0.25, 0.43, 0.6)
332
		m.Parent = pm2
333
		local w = Instance.new("Weld")
334
		w.Part0 = pm2
335
		w.Part1 = pm
336
		w.C0 = CFrame.new(0, 0.425, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-6), 0, 0)
337
		w.C1 = CFrame.new()
338
		w.Parent = p		
339
		local p = Instance.new("Part")
340
		p.Name = "MagPull1"
341
		p.formFactor = "Symmetric"
342
		p.Size = Vector3.new(1, 1, 1)
343
		p.BrickColor = BrickColor.new("Dark stone grey")
344
		p.Locked = true
345
		p.CanCollide = false
346
		p.TopSurface = 0
347
		p.BottomSurface = 0
348
		p.Parent = model
349
		local m = Instance.new("CylinderMesh")
350
		m.Scale = Vector3.new(0.5, 0.43, 0.5)
351
		m.Parent = p
352
		local w = Instance.new("Weld")
353
		w.Part0 = p
354
		w.Part1 = pm2
355
		w.C0 = CFrame.new(-0.26, 0, -0.12)
356
		w.C1 = CFrame.new()
357
		w.Parent = p
358
		local p = Instance.new("Part")
359
		p.Name = "MagPull2"
360
		p.formFactor = "Symmetric"
361
		p.Size = Vector3.new(1, 1, 1)
362
		p.BrickColor = BrickColor.new("Dark stone grey")
363
		p.Locked = true
364
		p.CanCollide = false
365
		p.TopSurface = 0
366
		p.BottomSurface = 0
367
		p.Parent = model
368
		local m = Instance.new("CylinderMesh")
369
		m.Scale = Vector3.new(0.5, 0.43, 0.5)
370
		m.Parent = p
371
		local w = Instance.new("Weld")
372
		w.Part0 = p
373
		w.Part1 = pm2
374
		w.C0 = CFrame.new(0.26, 0, -0.12)
375
		w.C1 = CFrame.new()
376
		w.Parent = p	
377
	elseif Magazine == "STANAG" then
378
		local pm2 = Instance.new("Part")
379
		pm2.Name = "Magazine"
380
		pm2.formFactor = "Symmetric"
381
		pm2.Size = Vector3.new(1, 1, 1)
382
		pm2.BrickColor = BrickColor.new("Dark stone grey")
383
		pm2.Locked = true
384
		pm2.CanCollide = false
385
		pm2.TopSurface = 0
386
		pm2.BottomSurface = 0
387
		pm2.Parent = model
388
		local m = Instance.new("BlockMesh")
389
		m.Scale = Vector3.new(0.25, 0.43, 0.8)
390
		m.Parent = pm2
391
		local w = Instance.new("Weld")
392
		w.Part0 = pm2
393
		w.Part1 = pm
394
		w.C0 = CFrame.new(0, 0.425, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-6), 0, 0)
395
		w.C1 = CFrame.new()
396
		w.Parent = p			
397
		local p = Instance.new("Part")
398
		p.Name = "MagPull1"
399
		p.formFactor = "Symmetric"
400
		p.Size = Vector3.new(1, 1, 1)
401
		p.BrickColor = BrickColor.new("Sand green")
402
		p.Locked = true
403
		p.CanCollide = false
404
		p.TopSurface = 0
405
		p.BottomSurface = 0
406
		p.Parent = model
407
		local m = Instance.new("BlockMesh")
408
		m.Scale = Vector3.new(0.26, 0.44, 0.2)
409
		m.Parent = p
410
		local w = Instance.new("Weld")
411
		w.Part0 = p
412
		w.Part1 = pm2
413
		w.C0 = CFrame.new(0, 0, -0.15)
414
		w.C1 = CFrame.new()
415
		w.Parent = p
416
		local p = Instance.new("Part")
417
		p.Name = "MagPull2"
418
		p.formFactor = "Symmetric"
419
		p.Size = Vector3.new(1, 1, 1)
420
		p.BrickColor = BrickColor.new("Sand green")
421
		p.Locked = true
422
		p.CanCollide = false
423
		p.TopSurface = 0
424
		p.BottomSurface = 0
425
		p.Parent = model
426
		local m = Instance.new("BlockMesh")
427
		m.Scale = Vector3.new(0.26, 0.2, 0.3)
428
		m.Parent = p
429
		local w = Instance.new("Weld")
430
		w.Part0 = p
431
		w.Part1 = pm2
432
		w.C0 = CFrame.new(0, 0, -0.3)
433
		w.C1 = CFrame.new()
434
		w.Parent = p	
435
	else end		
436
	local p = Instance.new("Part")
437
	p.Name = "Trigger Housing"
438
	p.formFactor = "Symmetric"
439
	p.Size = Vector3.new(1, 1, 1)
440
	p.BrickColor = MC
441
	p.Reflectance = MR
442
	p.CanCollide = false
443
	p.Locked = true
444
	p.TopSurface = 0
445
	p.BottomSurface = 0
446
	p.Parent = model
447
	local m = Instance.new("BlockMesh")
448
	m.Scale = Vector3.new(0.1, 0.4, 0.025)
449
	m.Parent = p
450
	local w = Instance.new("Weld")
451
	w.Part0 = p
452
	w.Part1 = pm
453
	w.C0 = CFrame.new(0, 0.1, -0.38)
454
	w.C1 = CFrame.new()
455
	w.Parent = p
456
	local p = Instance.new("Part")
457
	p.Name = "Trigger"
458
	p.formFactor = "Symmetric"
459
	p.Size = Vector3.new(1, 1, 1)
460
	p.BrickColor = MC
461
	p.Reflectance = MR
462
	p.CanCollide = false
463
	p.Locked = true
464
	p.TopSurface = 0
465
	p.BottomSurface = 0
466
	p.Parent = model
467
	local m = Instance.new("BlockMesh")
468
	m.Scale = Vector3.new(0.1, 0.05, 0.15)
469
	m.Parent = p
470
	local w = Instance.new("Weld")
471
	w.Part0 = p
472
	w.Part1 = pm
473
	w.C0 = CFrame.new(0, 0.03, -0.275)
474
	w.C1 = CFrame.new()
475
	w.Parent = p
476
	local p = Instance.new("Part")
477
	p.Name = "Center" --------------
478
	p.CanCollide = false
479
	p.formFactor = "Symmetric"
480
	p.Size = Vector3.new(1, 1, 1)
481
	p.BrickColor = MC
482
	p.Reflectance = MR
483
	p.Locked = true
484
	p.TopSurface = 0
485
	p.BottomSurface = 0
486
	p.Parent = model
487
	local m = Instance.new("CylinderMesh")
488
	m.Scale = Vector3.new(0.32, 1.1, 0.32)
489
	m.Parent = p
490
	local w = Instance.new("Weld")
491
	w.Part0 = p
492
	w.Part1 = pm
493
	w.C0 = CFrame.new(0, 0.14, -0.04)
494
	w.C1 = CFrame.new()
495
	w.Parent = p
496
	local p = Instance.new("Part")
497
	p.Name = "CHandleC" --------------
498
	p.CanCollide = false
499
	p.formFactor = "Symmetric"
500
	p.Size = Vector3.new(1, 1, 1)
501
	p.BrickColor = DC
502
	p.Reflectance = MR
503
	p.Locked = true
504
	p.TopSurface = 0
505
	p.BottomSurface = 0
506
	p.Parent = model
507
	local m = Instance.new("CylinderMesh")
508
	m.Scale = Vector3.new(0.32, 0.1, 0.32)
509
	m.Parent = p
510
	local w = Instance.new("Weld")
511
	w.Part0 = p
512
	w.Part1 = pm
513
	w.C0 = CFrame.new(0, -0.08, -0.38) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
514
	w.C1 = CFrame.new()
515
	w.Parent = p
516
	local p = Instance.new("Part")
517
	p.Name = "CHandleB" --------------
518
	p.CanCollide = false
519
	p.formFactor = "Symmetric"
520
	p.Size = Vector3.new(1, 1, 1)
521
	p.BrickColor = DC
522
	p.Reflectance = MR
523
	p.Transparency = 1
524
	p.Locked = true
525
	p.TopSurface = 0
526
	p.BottomSurface = 0
527
	p.Parent = model
528
	local m = Instance.new("CylinderMesh")
529
	m.Scale = Vector3.new(0.32, 0.1, 0.32)
530
	m.Parent = p
531
	local w = Instance.new("Weld")
532
	w.Part0 = p
533
	w.Part1 = pm
534
	w.C0 = CFrame.new(0, -0.08, -0.72) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
535
	w.C1 = CFrame.new()
536
	w.Parent = p
537
	local p = Instance.new("Part")
538
	p.Name = "CHandleB1" --------------
539
	p.CanCollide = false
540
	p.formFactor = "Symmetric"
541
	p.Size = Vector3.new(1, 1, 1)
542
	p.BrickColor = DC
543
	p.Reflectance = MR
544
	p.Transparency = 1
545
	p.Locked = true
546
	p.TopSurface = 0
547
	p.BottomSurface = 0
548
	p.Parent = model
549
	local m = Instance.new("BlockMesh")
550
	m.Scale = Vector3.new(0.15, 0.8, 0.1)
551
	m.Parent = p
552
	local w = Instance.new("Weld")
553
	w.Part0 = p
554
	w.Part1 = pm
555
	w.C0 = CFrame.new(0, -0.3, 0.08)
556
	w.C1 = CFrame.new()
557
	w.Parent = p	
558
	local p = Instance.new("Part")
559
	p.Name = "Bolt" --------------
560
	p.CanCollide = false
561
	p.formFactor = "Symmetric"
562
	p.Size = Vector3.new(1, 1, 1)
563
	p.BrickColor = BrickColor.new("Dark stone grey")
564
	p.Locked = true
565
	p.TopSurface = 0
566
	p.BottomSurface = 0
567
	p.Parent = model
568
	local m = Instance.new("CylinderMesh")
569
	m.Name = "Mesh"
570
	m.Scale = Vector3.new(0.14, 0.3, 0.14)
571
	m.Offset = Vector3.new(0, 0, 0)
572
	m.Parent = p
573
	local w = Instance.new("Weld")
574
	w.Part0 = p
575
	w.Part1 = pm
576
	w.C0 = CFrame.new(-0.1, 0.4, -0.04)
577
	w.C1 = CFrame.new()
578
	w.Parent = p
579
	local p = Instance.new("Part")
580
	p.Name = "DustCover" --------------
581
	p.CanCollide = false
582
	p.formFactor = "Symmetric"
583
	p.Size = Vector3.new(1, 1, 1)
584
	p.BrickColor = DC
585
	p.Locked = true
586
	p.TopSurface = 0
587
	p.BottomSurface = 0
588
	p.Parent = model
589
	local m = Instance.new("BlockMesh")
590
	m.Name = "Mesh"
591
	m.Scale = Vector3.new(0.14, 0.34, 0.14)
592
	m.Offset = Vector3.new(0, 0, 0)
593
	m.Parent = p
594
	local s = Instance.new("Smoke")
595
	s.Enabled = false
596
	s.Name = "Smoke"
597
	s.RiseVelocity = 0
598
	s.Opacity = 0.1
599
	s.Color = Color3.new(90 / 225, 90 / 225, 90 / 225)
600
	s.Size = 0.2
601
	s.Parent = p	
602
	local w = Instance.new("Weld")
603
	w.Part0 = p
604
	w.Part1 = pm
605
	w.C0 = CFrame.new(0, 0, 1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
606
	w.C1 = CFrame.new()
607
	w.Parent = p	
608
	local w = Instance.new("Weld")
609
	w.Part0 = p
610
	w.Part1 = pm
611
	w.C0 = CFrame.new(-0.105, 0.4, -0.06) * CFrame.fromEulerAnglesXYZ(0, math.rad(-6), 0)
612
	w.C1 = CFrame.new()
613
	w.Parent = p
614
	local p = Instance.new("Part")
615
	p.Name = "ForeBarrel"
616
	p.CanCollide = false
617
	p.formFactor = "Symmetric"
618
	p.Size = Vector3.new(1, 1, 1)
619
	p.BrickColor = GC
620
	p.Reflectance = GR
621
	p.Locked = true
622
	p.TopSurface = 0
623
	p.BottomSurface = 0
624
	p.Parent = model
625
	local m = Instance.new("CylinderMesh")
626
	m.Scale = Vector3.new(0.36, 0.8, 0.36)
627
	m.Parent = p
628
	local w = Instance.new("Weld")
629
	w.Part0 = p
630
	w.Part1 = pm
631
	w.C0 = CFrame.new(0, 1.08, -0.04)
632
	w.C1 = CFrame.new()
633
	w.Parent = p
634
	local p = Instance.new("Part")
635
	p.Name = "Rail" --------------
636
	p.CanCollide = false
637
	p.formFactor = "Symmetric"
638
	p.Size = Vector3.new(1, 1, 1)
639
	p.BrickColor = MC
640
	p.Reflectance = MR
641
	p.Locked = true
642
	p.TopSurface = 0
643
	p.BottomSurface = 0
644
	p.Parent = model
645
	local m = Instance.new("BlockMesh")
646
	m.Scale = Vector3.new(0.36, 0.7, 0.18)
647
	m.Parent = p
648
	local w = Instance.new("Weld")
649
	w.Part0 = p
650
	w.Part1 = pm
651
	w.C0 = CFrame.new(0, 1.08, -0.04)
652
	w.C1 = CFrame.new()
653
	w.Parent = p
654
	local p = Instance.new("Part")
655
	p.Name = "Rail" --------------
656
	p.CanCollide = false
657
	p.formFactor = "Symmetric"
658
	p.Size = Vector3.new(1, 1, 1)
659
	p.BrickColor = MC
660
	p.Reflectance = MR
661
	p.Locked = true
662
	p.TopSurface = 0
663
	p.BottomSurface = 0
664
	p.Parent = model
665
	local m = Instance.new("BlockMesh")
666
	m.Scale = Vector3.new(0.18, 0.7, 0.36)
667
	m.Parent = p
668
	local w = Instance.new("Weld")
669
	w.Part0 = p
670
	w.Part1 = pm
671
	w.C0 = CFrame.new(0, 1.08, -0.04)
672
	w.C1 = CFrame.new()
673
	w.Parent = p		
674
	if Reciever == 0 then
675
		local p = Instance.new("Part")
676
		p.Name = "Barrel 1"
677
		p.formFactor = "Symmetric"
678
		p.Size = Vector3.new(1, 1, 1)
679
		p.BrickColor = DC
680
		p.Reflectance = MR
681
		p.CanCollide = false
682
		p.Locked = true
683
		p.TopSurface = 0
684
		p.BottomSurface = 0
685
		p.Parent = model
686
		local m = Instance.new("CylinderMesh")
687
		m.Scale = Vector3.new(0.15, 0.8, 0.15)
688
		m.Parent = p
689
		local w = Instance.new("Weld")
690
		w.Part0 = p
691
		w.Part1 = pm
692
		w.C0 = CFrame.new(0, 1.6, -0.04)
693
		w.C1 = CFrame.new()
694
		w.Parent = p
695
		local p = Instance.new("Part")
696
		p.Name = "Hole"
697
		p.formFactor = "Symmetric"
698
		p.Size = Vector3.new(1, 1, 1)
699
		p.BrickColor = BrickColor.new("Really black")
700
		p.CanCollide = false
701
		p.Locked = true
702
		p.TopSurface = 0
703
		p.BottomSurface = 0
704
		p.Parent = model
705
		local m = Instance.new("CylinderMesh")
706
		m.Scale = Vector3.new(0.1, 0.4, 0.1)
707
		m.Offset = Vector3.new(0, 0.2, 0)
708
		m.Parent = p
709
		local w = Instance.new("Weld")
710
		w.Part0 = p
711
		w.Part1 = pm
712
		w.C0 = CFrame.new(0, 2.403, -0.04)
713
		w.C1 = CFrame.new()
714
		w.Parent = p	
715
		local p = Instance.new("Part")
716
		if silenced == false then
717
			p.Name = "Muzzle"
718
		else
719
			p.Name = "Muzzle 2"
720
		end
721
		p.formFactor = "Symmetric"
722
		p.Size = Vector3.new(1, 1, 1)
723
		p.BrickColor = DC
724
		p.Reflectance = MR
725
		p.CanCollide = false
726
		p.Locked = true
727
		p.TopSurface = 0
728
		p.BottomSurface = 0
729
		p.Parent = model
730
		local m = Instance.new("CylinderMesh")
731
		m.Scale = Vector3.new(0.18, 0.4, 0.18)
732
		m.Offset = Vector3.new(0, 0.2, 0)
733
		m.Parent = p
734
		local w = Instance.new("Weld")
735
		w.Part0 = p
736
		w.Part1 = pm
737
		w.C0 = CFrame.new(0, 2.4, -0.04)
738
		w.C1 = CFrame.new()
739
		w.Parent = p
740
		local s = Instance.new("Smoke")
741
		s.Enabled = false
742
		s.Name = "Smoke"
743
		s.RiseVelocity = -5
744
		s.Opacity = 0.3
745
		s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
746
		s.Size = 1
747
		s.Parent = p
748
		local f = Instance.new("Fire")
749
		f.Enabled = false
750
		f.Name = "Fire"
751
		f.Heat = -35
752
		f.Size = 1
753
		f.Parent = p
754
		local p = Instance.new("Part")
755
		p.formFactor = "Symmetric"
756
		p.Size = Vector3.new(1, 1, 1)
757
		p.BrickColor = MC
758
		p.CanCollide = false
759
		if silenced == false then
760
			p.Name = "Silencer"
761
			p.Transparency = 1
762
		else	
763
			p.Name = "Muzzle"
764
			p.Transparency = 0
765
		end
766
		p.Locked = true
767
		p.TopSurface = 0
768
		p.BottomSurface = 0
769
		p.Parent = model
770
		local m = Instance.new("CylinderMesh")
771
		m.Scale = Vector3.new(0.25, 0.8, 0.25)
772
		m.Parent = p
773
		local w = Instance.new("Weld")
774
		w.Part0 = p
775
		w.Part1 = pm
776
		w.C0 = CFrame.new(0, 2.5, -0.04)
777
		w.C1 = CFrame.new()
778
		w.Parent = p
779
		local p = Instance.new("Part")
780
		p.Name = "Silencer1"
781
		p.formFactor = "Symmetric"
782
		p.Size = Vector3.new(1, 1, 1)
783
		p.BrickColor = BrickColor.new("Dark stone grey")
784
		p.CanCollide = false
785
		if silenced == false then
786
			p.Transparency = 1
787
		else	
788
			p.Transparency = 0
789
		end
790
		p.Locked = true
791
		p.TopSurface = 0
792
		p.BottomSurface = 0
793
		p.Parent = model
794
		local m = Instance.new("CylinderMesh")
795
		m.Scale = Vector3.new(0.255, 0.6, 0.255)
796
		m.Parent = p
797
		local w = Instance.new("Weld")
798
		w.Part0 = p
799
		w.Part1 = pm
800
		w.C0 = CFrame.new(0, 2.5, -0.04)
801
		w.C1 = CFrame.new()
802
		w.Parent = p
803
		local p = Instance.new("Part")
804
		p.Name = "Silencer2"
805
		p.formFactor = "Symmetric"
806
		p.Size = Vector3.new(1, 1, 1)
807
		p.BrickColor = BrickColor.new("Really black")
808
		p.CanCollide = false
809
		if silenced == false then
810
			p.Transparency = 1
811
		else	
812
			p.Transparency = 0
813
		end
814
		p.Locked = true
815
		p.TopSurface = 0
816
		p.BottomSurface = 0
817
		p.Parent = model
818
		local m = Instance.new("CylinderMesh")
819
		m.Scale = Vector3.new(0.1, 0.803, 0.1)
820
		m.Parent = p
821
		local w = Instance.new("Weld")
822
		w.Part0 = p
823
		w.Part1 = pm
824
		w.C0 = CFrame.new(0, 2.5, -0.04)
825
		w.C1 = CFrame.new()
826
		w.Parent = p		
827
		local p = Instance.new("Part") -- Gas Block
828
		p.Name = "Frontsight"
829
		p.formFactor = "Symmetric"
830
		p.Size = Vector3.new(1, 1, 1)
831
		p.BrickColor = DC
832
		p.Reflectance = MR
833
		p.CanCollide = false
834
		p.Locked = true
835
		p.TopSurface = 0
836
		p.BottomSurface = 0
837
		p.Parent = model
838
		local m = Instance.new("BlockMesh")
839
		m.Scale = Vector3.new(0.08, 0.1, 0.3)
840
		m.Parent = p
841
		local w = Instance.new("Weld")
842
		w.Part0 = p
843
		w.Part1 = pm
844
		w.C0 = CFrame.new(0, 1.7, 0.1)
845
		w.C1 = CFrame.new()
846
		w.Parent = p	
847
		local p = Instance.new("Part")
848
		p.Name = "Frontsight"
849
		p.formFactor = "Symmetric"
850
		p.Size = Vector3.new(1, 1, 1)
851
		p.BrickColor = DC
852
		p.Reflectance = MR
853
		p.CanCollide = false
854
		p.Locked = true
855
		p.TopSurface = 0
856
		p.BottomSurface = 0
857
		p.Parent = model
858
		local m = Instance.new("CylinderMesh")
859
		m.Scale = Vector3.new(0.1, 0.1, 0.1)
860
		m.Parent = p
861
		local w = Instance.new("Weld")
862
		w.Part0 = p
863
		w.Part1 = pm
864
		w.C0 = CFrame.new(0, 1.7, 0.28)
865
		w.C1 = CFrame.new()
866
		w.Parent = p
867
		local p = Instance.new("Part")
868
		p.Name = "FrontSight"
869
		p.CanCollide = false
870
		p.formFactor = "Symmetric"
871
		p.Size = Vector3.new(1, 1, 1)
872
		p.BrickColor = MC
873
		p.Reflectance = MR
874
		p.Locked = true
875
		p.TopSurface = 0
876
		p.BottomSurface = 0
877
		p.Parent = model
878
		local m = Instance.new("SpecialMesh")
879
		m.MeshType = "Wedge"
880
		m.Scale = Vector3.new(0.08, 0.45, 0.3)
881
		m.Parent = p
882
		local w = Instance.new("Weld")
883
		w.Part0 = p
884
		w.Part1 = pm
885
		w.C0 = CFrame.new(0, 1.45, 0.14)
886
		w.C1 = CFrame.new()
887
		w.Parent = p	
888
	elseif Reciever == 1 then
889
		local p = Instance.new("Part")
890
		p.Name = "Barrel 1"
891
		p.formFactor = "Symmetric"
892
		p.Size = Vector3.new(1, 1, 1)
893
		p.BrickColor = DC
894
		p.Reflectance = MR
895
		p.CanCollide = false
896
		p.Locked = true
897
		p.TopSurface = 0
898
		p.BottomSurface = 0
899
		p.Parent = model
900
		local m = Instance.new("CylinderMesh")
901
		m.Scale = Vector3.new(0.15, 0.8, 0.15)
902
		m.Parent = p
903
		local w = Instance.new("Weld")
904
		w.Part0 = p
905
		w.Part1 = pm
906
		w.C0 = CFrame.new(0, 1.4, -0.04)
907
		w.C1 = CFrame.new()
908
		w.Parent = p
909
		local p = Instance.new("Part")
910
		p.Name = "Hole"
911
		p.formFactor = "Symmetric"
912
		p.Size = Vector3.new(1, 1, 1)
913
		p.BrickColor = BrickColor.new("Really black")
914
		p.CanCollide = false
915
		p.Locked = true
916
		p.TopSurface = 0
917
		p.BottomSurface = 0
918
		p.Parent = model
919
		local m = Instance.new("CylinderMesh")
920
		m.Scale = Vector3.new(0.1, 0.4, 0.1)
921
		m.Offset = Vector3.new(0, 0.2, 0)
922
		m.Parent = p
923
		local w = Instance.new("Weld")
924
		w.Part0 = p
925
		w.Part1 = pm
926
		w.C0 = CFrame.new(0, 2.203, -0.04)
927
		w.C1 = CFrame.new()
928
		w.Parent = p	
929
		local p = Instance.new("Part")
930
		if silenced == false then
931
			p.Name = "Muzzle"
932
		else
933
			p.Name = "Muzzle 2"
934
		end
935
		p.formFactor = "Symmetric"
936
		p.Size = Vector3.new(1, 1, 1)
937
		p.BrickColor = DC
938
		p.Reflectance = MR
939
		p.CanCollide = false
940
		p.Locked = true
941
		p.TopSurface = 0
942
		p.BottomSurface = 0
943
		p.Parent = model
944
		local m = Instance.new("CylinderMesh")
945
		m.Scale = Vector3.new(0.18, 0.4, 0.18)
946
		m.Offset = Vector3.new(0, 0.2, 0)
947
		m.Parent = p
948
		local w = Instance.new("Weld")
949
		w.Part0 = p
950
		w.Part1 = pm
951
		w.C0 = CFrame.new(0, 2.2, -0.04)
952
		w.C1 = CFrame.new()
953
		w.Parent = p
954
		local s = Instance.new("Smoke")
955
		s.Enabled = false
956
		s.Name = "Smoke"
957
		s.RiseVelocity = -5
958
		s.Opacity = 0.3
959
		s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
960
		s.Size = 1
961
		s.Parent = p
962
		local f = Instance.new("Fire")
963
		f.Enabled = false
964
		f.Name = "Fire"
965
		f.Heat = -35
966
		f.Size = 1
967
		f.Parent = p
968
		local p = Instance.new("Part")
969
		p.formFactor = "Symmetric"
970
		p.Size = Vector3.new(1, 1, 1)
971
		p.BrickColor = MC
972
		p.CanCollide = false
973
		if silenced == false then
974
			p.Name = "Silencer"
975
			p.Transparency = 1
976
		else	
977
			p.Name = "Muzzle"
978
			p.Transparency = 0
979
		end
980
		p.Locked = true
981
		p.TopSurface = 0
982
		p.BottomSurface = 0
983
		p.Parent = model
984
		local m = Instance.new("CylinderMesh")
985
		m.Scale = Vector3.new(0.25, 0.8, 0.25)
986
		m.Parent = p
987
		local w = Instance.new("Weld")
988
		w.Part0 = p
989
		w.Part1 = pm
990
		w.C0 = CFrame.new(0, 2.3, -0.04)
991
		w.C1 = CFrame.new()
992
		w.Parent = p
993
		local p = Instance.new("Part")
994
		p.Name = "Silencer1"
995
		p.formFactor = "Symmetric"
996
		p.Size = Vector3.new(1, 1, 1)
997
		p.BrickColor = BrickColor.new("Dark stone grey")
998
		p.CanCollide = false
999
		if silenced == false then
1000
			p.Transparency = 1
1001
		else	
1002
			p.Transparency = 0
1003
		end
1004
		p.Locked = true
1005
		p.TopSurface = 0
1006
		p.BottomSurface = 0
1007
		p.Parent = model
1008
		local m = Instance.new("CylinderMesh")
1009
		m.Scale = Vector3.new(0.255, 0.6, 0.255)
1010
		m.Parent = p
1011
		local w = Instance.new("Weld")
1012
		w.Part0 = p
1013
		w.Part1 = pm
1014
		w.C0 = CFrame.new(0, 2.3, -0.04)
1015
		w.C1 = CFrame.new()
1016
		w.Parent = p
1017
		local p = Instance.new("Part")
1018
		p.Name = "Silencer2"
1019
		p.formFactor = "Symmetric"
1020
		p.Size = Vector3.new(1, 1, 1)
1021
		p.BrickColor = BrickColor.new("Really black")
1022
		p.CanCollide = false
1023
		if silenced == false then
1024
			p.Transparency = 1
1025
		else	
1026
			p.Transparency = 0
1027
		end
1028
		p.Locked = true
1029
		p.TopSurface = 0
1030
		p.BottomSurface = 0
1031
		p.Parent = model
1032
		local m = Instance.new("CylinderMesh")
1033
		m.Scale = Vector3.new(0.1, 0.803, 0.1)
1034
		m.Parent = p
1035
		local w = Instance.new("Weld")
1036
		w.Part0 = p
1037
		w.Part1 = pm
1038
		w.C0 = CFrame.new(0, 2.3, -0.04)
1039
		w.C1 = CFrame.new()
1040
		w.Parent = p
1041
		local p = Instance.new("Part") -- Gas Block
1042
		p.Name = "GasBlock"
1043
		p.formFactor = "Symmetric"
1044
		p.Size = Vector3.new(1, 1, 1)
1045
		p.BrickColor = DC
1046
		p.Reflectance = MR
1047
		p.CanCollide = false
1048
		p.Locked = true
1049
		p.TopSurface = 0
1050
		p.BottomSurface = 0
1051
		p.Parent = model
1052
		local m = Instance.new("BlockMesh")
1053
		m.Scale = Vector3.new(0.14, 0.18, 0.15)
1054
		m.Parent = p
1055
		local w = Instance.new("Weld")
1056
		w.Part0 = p
1057
		w.Part1 = pm
1058
		w.C0 = CFrame.new(0, 1.55, 0.02)
1059
		w.C1 = CFrame.new()
1060
		w.Parent = p
1061
	else end
1062
	if Stock == 1 then
1063
		local p = Instance.new("Part")
1064
		p.Name = "StockHinge" 
1065
		p.CanCollide = false
1066
		p.formFactor = "Symmetric"
1067
		p.Size = Vector3.new(1, 1, 1)
1068
		p.BrickColor = DC
1069
		p.Reflectance = MR
1070
		p.Locked = true
1071
		p.TopSurface = 0
1072
		p.BottomSurface = 0
1073
		p.Parent = model
1074
		local m = Instance.new("CylinderMesh")
1075
		m.Scale = Vector3.new(0.1, 0.26, 0.1)
1076
		m.Parent = p
1077
		local w = Instance.new("Weld")
1078
		w.Part0 = p
1079
		w.Part1 = pm
1080
		w.C0 = CFrame.new(-0.14, 0.15, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
1081
		w.C1 = CFrame.new()
1082
		w.Parent = p	
1083
		local ps = Instance.new("Part") -- Stock
1084
		ps.Name = "StockBase"
1085
		ps.CanCollide = false
1086
		ps.formFactor = "Symmetric"
1087
		ps.Size = Vector3.new(1, 1, 1)
1088
		ps.BrickColor = GC
1089
		ps.Reflectance = GR
1090
		ps.Locked = true
1091
		ps.TopSurface = 0
1092
		ps.BottomSurface = 0
1093
		ps.Parent = model
1094
		local m = Instance.new("BlockMesh")
1095
		m.Scale = Vector3.new(0.18, 0.6, 0.28)
1096
		m.Parent = ps
1097
		local w = Instance.new("Weld")
1098
		w.Part0 = ps
1099
		w.Part1 = pm
1100
		if selected == true then
1101
			w.C0 = CFrame.new(0, -0.65, -0.15)
1102
		else
1103
			w.C0 = CFrame.new(0.25, 0.1, -0.15) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(180))	
1104
		end
1105
		w.C1 = CFrame.new()
1106
		w.Parent = ps	
1107
		local p = Instance.new("Part")
1108
		p.Name = "Stock 1"
1109
		p.CanCollide = false
1110
		p.formFactor = "Symmetric"
1111
		p.Size = Vector3.new(1, 1, 1)
1112
		p.BrickColor = GC
1113
		p.Reflectance = GR
1114
		p.Locked = true
1115
		p.TopSurface = 0
1116
		p.BottomSurface = 0
1117
		p.Parent = model
1118
		local m = Instance.new("BlockMesh")
1119
		m.Scale = Vector3.new(0.18, 1, 0.28)
1120
		m.Parent = p
1121
		local w = Instance.new("Weld")
1122
		w.Part0 = p
1123
		w.Part1 = ps
1124
		w.C0 = CFrame.new(0, -0.38, 0)
1125
		w.C1 = CFrame.new()
1126
		w.Parent = p	
1127
		local p = Instance.new("Part")
1128
		p.Name = "Stock 2"
1129
		p.CanCollide = false
1130
		p.formFactor = "Symmetric"
1131
		p.Size = Vector3.new(1, 1, 1)
1132
		p.BrickColor = GC
1133
		p.Reflectance = GR
1134
		p.Locked = true
1135
		p.TopSurface = 0
1136
		p.BottomSurface = 0
1137
		p.Parent = model
1138
		local m = Instance.new("BlockMesh")
1139
		m.Scale = Vector3.new(0.18, 0.2, 0.58)
1140
		m.Parent = p
1141
		local w = Instance.new("Weld")
1142
		w.Part0 = p
1143
		w.Part1 = ps
1144
		w.C0 = CFrame.new(0, -0.775, -0.28)
1145
		w.C1 = CFrame.new()
1146
		w.Parent = p
1147
		local p = Instance.new("Part")
1148
		p.Name = "StockAngle1"
1149
		p.CanCollide = false
1150
		p.formFactor = "Symmetric"
1151
		p.Size = Vector3.new(1, 1, 1)
1152
		p.BrickColor = GC
1153
		p.Reflectance = GR
1154
		p.Locked = true
1155
		p.TopSurface = 0
1156
		p.BottomSurface = 0
1157
		p.Parent = model
1158
		local m = Instance.new("BlockMesh")
1159
		m.Scale = Vector3.new(0.18, 0.18, 0.65)
1160
		m.Parent = p
1161
		local w = Instance.new("Weld")
1162
		w.Part0 = p
1163
		w.Part1 = ps
1164
		w.C0 = CFrame.new(0, -0.12, -0.56) * CFrame.fromEulerAnglesXYZ(math.rad(48), 0, 0)
1165
		w.C1 = CFrame.new()
1166
		w.Parent = p
1167
	elseif Stock == 2 then
1168
		local p = Instance.new("Part") -- Standard Stock
1169
		p.Name = "StockC"
1170
		p.CanCollide = false
1171
		p.formFactor = "Symmetric"
1172
		p.Size = Vector3.new(1, 1, 1)
1173
		p.BrickColor = GC
1174
		p.Reflectance = GR
1175
		p.Locked = true
1176
		p.TopSurface = 0
1177
		p.BottomSurface = 0
1178
		p.Parent = model
1179
		local m = Instance.new("CylinderMesh")
1180
		m.Scale = Vector3.new(0.2, 1, 0.2)
1181
		m.Parent = p
1182
		local w = Instance.new("Weld")
1183
		w.Part0 = p
1184
		w.Part1 = pm
1185
		w.C0 = CFrame.new(0, -0.6, -0.1)
1186
		w.C1 = CFrame.new()
1187
		w.Parent = p	
1188
		local pt = Instance.new("Part")
1189
		pt.Name = "StockT"
1190
		pt.CanCollide = false
1191
		pt.formFactor = "Symmetric"
1192
		pt.Size = Vector3.new(1, 1, 1)
1193
		pt.BrickColor = GC
1194
		pt.Reflectance = GR
1195
		pt.Locked = true
1196
		pt.TopSurface = 0
1197
		pt.BottomSurface = 0
1198
		pt.Parent = model
1199
		local m = Instance.new("CylinderMesh")
1200
		m.Scale = Vector3.new(0.25, 0.8, 0.25)
1201
		m.Offset = Vector3.new(0, 0.4, 0)
1202
		m.Parent = pt
1203
		local w = Instance.new("Weld")
1204
		w.Part0 = pt
1205
		w.Part1 = pm
1206
		if selected == true then
1207
			w.C0 = CFrame.new(0, -0.8, -0.1)
1208
		else
1209
			w.C0 = CFrame.new(0, -0.4, -0.1)	
1210
		end
1211
		w.C1 = CFrame.new()
1212
		w.Parent = pt
1213
		local p = Instance.new("Part")
1214
		p.Name = "StockAngle1"
1215
		p.CanCollide = false
1216
		p.formFactor = "Symmetric"
1217
		p.Size = Vector3.new(1, 1, 1)
1218
		p.BrickColor = GC
1219
		p.Reflectance = GR
1220
		p.Locked = true
1221
		p.TopSurface = 0
1222
		p.BottomSurface = 0
1223
		p.Parent = model
1224
		local m = Instance.new("SpecialMesh")
1225
		m.MeshType = "Wedge"
1226
		m.Scale = Vector3.new(0.2, 0.5, 0.5)
1227
		m.Parent = p
1228
		local w = Instance.new("Weld")
1229
		w.Part0 = p
1230
		w.Part1 = pt
1231
		w.C0 = CFrame.new(0, -0.3, -0.55) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
1232
		w.C1 = CFrame.new()
1233
		w.Parent = p
1234
		local p = Instance.new("Part")
1235
		p.Name = "StockAngle2"
1236
		p.CanCollide = false
1237
		p.formFactor = "Symmetric"
1238
		p.Size = Vector3.new(1, 1, 1)
1239
		p.BrickColor = GC
1240
		p.Reflectance = GR
1241
		p.Locked = true
1242
		p.TopSurface = 0
1243
		p.BottomSurface = 0
1244
		p.Parent = model
1245
		local m = Instance.new("SpecialMesh")
1246
		m.MeshType = "Wedge"
1247
		m.Scale = Vector3.new(0.2, 0.4, 0.6)
1248
		m.Parent = p
1249
		local w = Instance.new("Weld")
1250
		w.Part0 = p
1251
		w.Part1 = pt
1252
		w.C0 = CFrame.new(0, -0.24, -0.3) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
1253
		w.C1 = CFrame.new()
1254
		w.Parent = p--]]
1255
	else end
1256
	if Sight == 0 then
1257
		local p = Instance.new("Part")
1258
		p.Name = "RearSight" 
1259
		p.CanCollide = false
1260
		p.formFactor = "Symmetric"
1261
		p.Size = Vector3.new(1, 1, 1)
1262
		p.BrickColor = MC
1263
		p.Reflectance = MR
1264
		p.Locked = true
1265
		p.TopSurface = 0
1266
		p.BottomSurface = 0
1267
		p.Parent = model
1268
		local m = Instance.new("CylinderMesh")
1269
		m.Scale = Vector3.new(0.2, 0.46, 0.2)
1270
		m.Parent = p
1271
		local w = Instance.new("Weld")
1272
		w.Part0 = p
1273
		w.Part1 = pm
1274
		w.C0 = CFrame.new(0, -0.06, -0.26) * CFrame.fromEulerAnglesXYZ(math.rad(100), 0, 0)
1275
		w.C1 = CFrame.new()
1276
		w.Parent = p
1277
		if Reciever == 1 then
1278
			local p = Instance.new("Part")
1279
			p.Name = "Frontsight"
1280
			p.formFactor = "Symmetric"
1281
			p.Size = Vector3.new(1, 1, 1)
1282
			p.BrickColor = DC
1283
			p.Reflectance = MR
1284
			p.CanCollide = false
1285
			p.Locked = true
1286
			p.TopSurface = 0
1287
			p.BottomSurface = 0
1288
			p.Parent = model
1289
			local m = Instance.new("BlockMesh")
1290
			m.Scale = Vector3.new(0.08, 0.1, 0.3)
1291
			m.Parent = p
1292
			local w = Instance.new("Weld")
1293
			w.Part0 = p
1294
			w.Part1 = pm
1295
			w.C0 = CFrame.new(0, 1.3, 0.1)
1296
			w.C1 = CFrame.new()
1297
			w.Parent = p	
1298
			local p = Instance.new("Part")
1299
			p.Name = "Frontsight"
1300
			p.formFactor = "Symmetric"
1301
			p.Size = Vector3.new(1, 1, 1)
1302
			p.BrickColor = DC
1303
			p.Reflectance = MR
1304
			p.CanCollide = false
1305
			p.Locked = true
1306
			p.TopSurface = 0
1307
			p.BottomSurface = 0
1308
			p.Parent = model
1309
			local m = Instance.new("CylinderMesh")
1310
			m.Scale = Vector3.new(0.1, 0.1, 0.1)
1311
			m.Parent = p
1312
			local w = Instance.new("Weld")
1313
			w.Part0 = p
1314
			w.Part1 = pm
1315
			w.C0 = CFrame.new(0, 1.3, 0.28)
1316
			w.C1 = CFrame.new()
1317
			w.Parent = p
1318
		else end
1319
	elseif Sight == 1 then
1320
		local p = Instance.new("Part") -------- RDS Attachment
1321
		p.Name = "Ring"
1322
		p.formFactor = "Symmetric"
1323
		p.Size = Vector3.new(1, 1, 1)
1324
		p.BrickColor = MC
1325
		p.Reflectance = MR
1326
		p.CanCollide = false
1327
		p.Locked = true
1328
		p.TopSurface = 0
1329
		p.BottomSurface = 0
1330
		p.Parent = model	
1331
		local m = Instance.new("SpecialMesh")
1332
		m.MeshType = "FileMesh"
1333
		m.MeshId = "http://www.roblox.com/asset/?id=3270017"
1334
		m.Scale = Vector3.new(0.25, 0.25, 0.8)
1335
		m.Parent = p
1336
		local w = Instance.new("Weld")
1337
		w.Part0 = p
1338
		w.Part1 = pm
1339
		w.C0 = CFrame.new(0, -0.25, 0.34) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
1340
		w.C1 = CFrame.new()
1341
		w.Parent = p
1342
		local p = Instance.new("Part")
1343
		p.Name = "SightBottom"
1344
		p.CanCollide = false
1345
		p.formFactor = "Symmetric"
1346
		p.Size = Vector3.new(1, 1, 1)
1347
		p.BrickColor = MC
1348
		p.Reflectance = MR
1349
		p.Locked = true
1350
		p.TopSurface = 0
1351
		p.BottomSurface = 0
1352
		p.Parent = model
1353
		local m = Instance.new("BlockMesh")
1354
		m.Scale = Vector3.new(0.25, 0.4, 0.18)
1355
		m.Parent = p
1356
		local w = Instance.new("Weld")
1357
		w.Part0 = p
1358
		w.Part1 = pm
1359
		w.C0 = CFrame.new(0, 0.2, 0.1)
1360
		w.C1 = CFrame.new()
1361
		w.Parent = p
1362
		local p = Instance.new("Part")
1363
		p.Name = "Image"
1364
		p.CanCollide = false
1365
		p.formFactor = "Symmetric"
1366
		p.Size = Vector3.new(1, 1, 1)
1367
		p.BrickColor = MC
1368
		p.Transparency = 1
1369
		p.Locked = true
1370
		p.TopSurface = 0
1371
		p.BottomSurface = 0
1372
		p.Parent = model
1373
		local d = Instance.new("Decal")
1374
		d.Face = "Top"
1375
		d.Texture = "http://www.roblox.com/asset/?id=29712167"
1376
		d.Parent = p
1377
		local m = Instance.new("BlockMesh")
1378
		m.Scale = Vector3.new(0.1, 0.001, 0.1)
1379
		m.Parent = p
1380
		local w = Instance.new("Weld")
1381
		w.Part0 = p
1382
		w.Part1 = pm
1383
		w.C0 = CFrame.new(0, 0.34, 0.25)
1384
		w.C1 = CFrame.new()
1385
		w.Parent = p
1386
	elseif Sight == 2 then
1387
		local c = Instance.new("Part")
1388
		c.Name = "SightCube"
1389
		c.CanCollide = false
1390
		c.formFactor = "Symmetric"
1391
		c.Size = Vector3.new(1, 1, 1)
1392
		c.BrickColor = DC
1393
		c.Reflectance = MR
1394
		c.Transparency = 0.8
1395
		c.Locked = true
1396
		c.TopSurface = 0
1397
		c.BottomSurface = 0
1398
		c.Parent = model
1399
		local m = Instance.new("BlockMesh")
1400
		m.Scale = Vector3.new(0.25, 0.25, 0.25)
1401
		m.Parent = c
1402
		local w = Instance.new("Weld")
1403
		w.Part0 = c
1404
		w.Part1 = pm
1405
		w.C0 = CFrame.new(0, 0.1, 0.25)
1406
		w.C1 = CFrame.new()
1407
		w.Parent = c
1408
		local p = Instance.new("Part")
1409
		p.Name = "SightBottom"
1410
		p.CanCollide = false
1411
		p.formFactor = "Symmetric"
1412
		p.Size = Vector3.new(1, 1, 1)
1413
		p.BrickColor = DC
1414
		p.Reflectance = MR
1415
		p.Locked = true
1416
		p.TopSurface = 0
1417
		p.BottomSurface = 0
1418
		p.Parent = model
1419
		local m = Instance.new("BlockMesh")
1420
		m.Scale = Vector3.new(0.2, 0.5, 0.18)
1421
		m.Parent = p
1422
		local w = Instance.new("Weld")
1423
		w.Part0 = p
1424
		w.Part1 = c
1425
		w.C0 = CFrame.new(0, 0.125, -0.12)
1426
		w.C1 = CFrame.new()
1427
		w.Parent = p		
1428
		local p = Instance.new("Part")
1429
		p.Name = "Image"
1430
		p.CanCollide = false
1431
		p.formFactor = "Symmetric"
1432
		p.Size = Vector3.new(1, 1, 1)
1433
		p.BrickColor = MC
1434
		p.Transparency = 1
1435
		p.Locked = true
1436
		p.TopSurface = 0
1437
		p.BottomSurface = 0
1438
		p.Parent = model
1439
		local d = Instance.new("Decal")
1440
		d.Face = "Top"
1441
		d.Texture = "http://www.roblox.com/asset/?id=29712167"
1442
		d.Parent = p
1443
		local m = Instance.new("BlockMesh")
1444
		m.Scale = Vector3.new(0.1, 0.001, 0.1)
1445
		m.Parent = p
1446
		local w = Instance.new("Weld")
1447
		w.Part0 = p
1448
		w.Part1 = c
1449
		w.C0 = CFrame.new(0, 0, 0)
1450
		w.C1 = CFrame.new()
1451
		w.Parent = p				
1452
		local p = Instance.new("Part")
1453
		p.Name = "SightBox"
1454
		p.CanCollide = false
1455
		p.formFactor = "Symmetric"
1456
		p.Size = Vector3.new(1, 1, 1)
1457
		p.BrickColor = DC
1458
		p.Reflectance = MR
1459
		p.Locked = true
1460
		p.TopSurface = 0
1461
		p.BottomSurface = 0
1462
		p.Parent = model
1463
		local m = Instance.new("BlockMesh")
1464
		m.Scale = Vector3.new(0.05, 0.25, 0.25)
1465
		m.Offset = Vector3.new(0.1, 0, 0)
1466
		m.Parent = p
1467
		local w = Instance.new("Weld")
1468
		w.Part0 = p
1469
		w.Part1 = c
1470
		w.C0 = CFrame.new(0, 0, 0)
1471
		w.C1 = CFrame.new()
1472
		w.Parent = p
1473
		local p = Instance.new("Part")
1474
		p.Name = "SightBox"
1475
		p.CanCollide = false
1476
		p.formFactor = "Symmetric"
1477
		p.Size = Vector3.new(1, 1, 1)
1478
		p.BrickColor = DC
1479
		p.Reflectance = MR
1480
		p.Locked = true
1481
		p.TopSurface = 0
1482
		p.BottomSurface = 0
1483
		p.Parent = model
1484
		local m = Instance.new("BlockMesh")
1485
		m.Scale = Vector3.new(0.05, 0.25, 0.25)
1486
		m.Offset = Vector3.new(-0.1, 0, 0)
1487
		m.Parent = p
1488
		local w = Instance.new("Weld")
1489
		w.Part0 = p
1490
		w.Part1 = c
1491
		w.C0 = CFrame.new(0, 0, 0)
1492
		w.C1 = CFrame.new()
1493
		w.Parent = p
1494
		local p = Instance.new("Part")
1495
		p.Name = "SightBox"
1496
		p.CanCollide = false
1497
		p.formFactor = "Symmetric"
1498
		p.Size = Vector3.new(1, 1, 1)
1499
		p.BrickColor = DC
1500
		p.Reflectance = MR
1501
		p.Locked = true
1502
		p.TopSurface = 0
1503
		p.BottomSurface = 0
1504
		p.Parent = model
1505
		local m = Instance.new("BlockMesh")
1506
		m.Scale = Vector3.new(0.25, 0.25, 0.05)
1507
		m.Offset = Vector3.new(0, 0, -0.1)
1508
		m.Parent = p
1509
		local w = Instance.new("Weld")
1510
		w.Part0 = p
1511
		w.Part1 = c
1512
		w.C0 = CFrame.new(0, 0, 0)
1513
		w.C1 = CFrame.new()
1514
		w.Parent = p
1515
		local p = Instance.new("Part")
1516
		p.Name = "SightBox"
1517
		p.CanCollide = false
1518
		p.formFactor = "Symmetric"
1519
		p.Size = Vector3.new(1, 1, 1)
1520
		p.BrickColor = DC
1521
		p.Reflectance = MR
1522
		p.Locked = true
1523
		p.TopSurface = 0
1524
		p.BottomSurface = 0
1525
		p.Parent = model
1526
		local m = Instance.new("BlockMesh")
1527
		m.Scale = Vector3.new(0.25, 0.25, 0.05)
1528
		m.Offset = Vector3.new(0, 0, 0.1)
1529
		m.Parent = p
1530
		local w = Instance.new("Weld")
1531
		w.Part0 = p
1532
		w.Part1 = c
1533
		w.C0 = CFrame.new(0, 0, 0)
1534
		w.C1 = CFrame.new()
1535
		w.Parent = p
1536
	elseif Sight == 3 then
1537
		local l = Instance.new("Part") -- Aimpoint Scope
1538
		l.Name = "SightBottom"
1539
		l.CanCollide = false
1540
		l.formFactor = "Symmetric"
1541
		l.Size = Vector3.new(1, 1, 1)
1542
		l.BrickColor = DC
1543
		l.Reflectance = MR
1544
		l.Locked = true
1545
		l.TopSurface = 0
1546
		l.BottomSurface = 0
1547
		l.Parent = model
1548
		local m = Instance.new("BlockMesh")
1549
		m.Scale = Vector3.new(0.2, 0.4, 0.18)
1550
		m.Parent = l
1551
		local w = Instance.new("Weld")
1552
		w.Part0 = l
1553
		w.Part1 = pm
1554
		w.C0 = CFrame.new(0, 0.26, 0.13)
1555
		w.C1 = CFrame.new()
1556
		w.Parent = l
1557
		canZoom = true
1558
		local p = Instance.new("Part")
1559
		p.Name = "Scope"
1560
		p.formFactor = "Symmetric"
1561
		p.Size = Vector3.new(1, 1, 1)
1562
		p.BrickColor = MC
1563
		p.Reflectance = MR
1564
		p.CanCollide = false
1565
		p.Locked = true
1566
		p.TopSurface = 0
1567
		p.BottomSurface = 0
1568
		p.Parent = model	
1569
		local m = Instance.new("CylinderMesh")
1570
		m.Scale = Vector3.new(0.28, 0.5, 0.28)
1571
		m.Parent = p
1572
		local w = Instance.new("Weld")
1573
		w.Part0 = p
1574
		w.Part1 = l
1575
		w.C0 = CFrame.new(0, 0, 0.16)
1576
		w.C1 = CFrame.new()
1577
		w.Parent = p
1578
		local p = Instance.new("Part")
1579
		p.Name = "ScopeInt"
1580
		p.formFactor = "Symmetric"
1581
		p.Size = Vector3.new(1, 1, 1)
1582
		p.BrickColor = BrickColor.new("White")
1583
		p.Reflectance = 0.3
1584
		p.CanCollide = false
1585
		p.Locked = true
1586
		p.TopSurface = 0
1587
		p.BottomSurface = 0
1588
		p.Parent = model	
1589
		local m = Instance.new("CylinderMesh")
1590
		m.Scale = Vector3.new(0.26, 0.604, 0.26)
1591
		m.Parent = p
1592
		local w = Instance.new("Weld")
1593
		w.Part0 = p
1594
		w.Part1 = l
1595
		w.C0 = CFrame.new(0, 0, 0.16)
1596
		w.C1 = CFrame.new()
1597
		w.Parent = p		
1598
		local p = Instance.new("Part")
1599
		p.Name = "Scope"
1600
		p.formFactor = "Symmetric"
1601
		p.Size = Vector3.new(1, 1, 1)
1602
		p.BrickColor = MC
1603
		p.Reflectance = MR
1604
		p.CanCollide = false
1605
		p.Locked = true
1606
		p.TopSurface = 0
1607
		p.BottomSurface = 0
1608
		p.Parent = model	
1609
		local m = Instance.new("CylinderMesh")
1610
		m.Scale = Vector3.new(0.3, 0.1, 0.3)
1611
		m.Parent = p
1612
		local w = Instance.new("Weld")
1613
		w.Part0 = p
1614
		w.Part1 = l
1615
		w.C0 = CFrame.new(0, -0.25, 0.16)
1616
		w.C1 = CFrame.new()
1617
		w.Parent = p
1618
		local p = Instance.new("Part")
1619
		p.Name = "Scope"
1620
		p.formFactor = "Symmetric"
1621
		p.Size = Vector3.new(1, 1, 1)
1622
		p.BrickColor = MC
1623
		p.Reflectance = MR
1624
		p.CanCollide = false
1625
		p.Locked = true
1626
		p.TopSurface = 0
1627
		p.BottomSurface = 0
1628
		p.Parent = model	
1629
		local m = Instance.new("CylinderMesh")
1630
		m.Scale = Vector3.new(0.3, 0.1, 0.3)
1631
		m.Parent = p
1632
		local w = Instance.new("Weld")
1633
		w.Part0 = p
1634
		w.Part1 = l
1635
		w.C0 = CFrame.new(0, 0.25, 0.16)
1636
		w.C1 = CFrame.new()
1637
		w.Parent = p				
1638
		local p = Instance.new("Part")
1639
		p.Name = "Scope"
1640
		p.formFactor = "Symmetric"
1641
		p.Size = Vector3.new(1, 1, 1)
1642
		p.BrickColor = MC
1643
		p.Reflectance = MR
1644
		p.CanCollide = false
1645
		p.Locked = true
1646
		p.TopSurface = 0
1647
		p.BottomSurface = 0
1648
		p.Parent = model	
1649
		local m = Instance.new("CylinderMesh")
1650
		m.Scale = Vector3.new(0.12, 0.5, 0.12)
1651
		m.Parent = p
1652
		local w = Instance.new("Weld")
1653
		w.Part0 = p
1654
		w.Part1 = l
1655
		w.C0 = CFrame.new(-0.12, 0, 0.24)
1656
		w.C1 = CFrame.new()
1657
		w.Parent = p
1658
		local p = Instance.new("Part")
1659
		p.Name = "Scope"
1660
		p.formFactor = "Symmetric"
1661
		p.Size = Vector3.new(1, 1, 1)
1662
		p.BrickColor = MC
1663
		p.Reflectance = MR
1664
		p.CanCollide = false
1665
		p.Locked = true
1666
		p.TopSurface = 0
1667
		p.BottomSurface = 0
1668
		p.Parent = model	
1669
		local m = Instance.new("CylinderMesh")
1670
		m.Scale = Vector3.new(0.13, 0.1, 0.13)
1671
		m.Parent = p
1672
		local w = Instance.new("Weld")
1673
		w.Part0 = p
1674
		w.Part1 = l
1675
		w.C0 = CFrame.new(-0.12, 0.25, 0.24)
1676
		w.C1 = CFrame.new()
1677
		w.Parent = p
1678
		local p = Instance.new("Part")
1679
		p.Name = "Scope"
1680
		p.formFactor = "Symmetric"
1681
		p.Size = Vector3.new(1, 1, 1)
1682
		p.BrickColor = MC
1683
		p.Reflectance = MR
1684
		p.CanCollide = false
1685
		p.Locked = true
1686
		p.TopSurface = 0
1687
		p.BottomSurface = 0
1688
		p.Parent = model	
1689
		local m = Instance.new("CylinderMesh")
1690
		m.Scale = Vector3.new(0.13, 0.1, 0.13)
1691
		m.Parent = p
1692
		local w = Instance.new("Weld")
1693
		w.Part0 = p
1694
		w.Part1 = l
1695
		w.C0 = CFrame.new(-0.12, -0.25, 0.24)
1696
		w.C1 = CFrame.new()
1697
		w.Parent = p								
1698
	else end
1699
	if Grip == true then
1700
		local p = Instance.new("Part") --------------- ForeGrip Attachment
1701
		p.Name = "ForeGrip"
1702
		p.formFactor = "Symmetric"
1703
		p.Size = Vector3.new(1, 1, 1)
1704
		p.BrickColor = BrickColor.new("Black")
1705
		p.CanCollide = false
1706
		p.Locked = true
1707
		p.TopSurface = 0
1708
		p.BottomSurface = 0
1709
		p.Parent = model
1710
		local m = Instance.new("CylinderMesh")
1711
		m.Scale = Vector3.new(0.25, 0.6, 0.25)
1712
		m.Parent = p
1713
		local w = Instance.new("Weld")
1714
		w.Part0 = p
1715
		w.Part1 = pm
1716
		w.C0 = CFrame.new(0, 0.4, 1.1) * CFrame.fromEulerAnglesXYZ(math.rad(90), 0, 0)
1717
		w.C1 = CFrame.new()
1718
		w.Parent = p
1719
	else end
1720
	if Attachment == true then
1721
		local p = Instance.new("Part")
1722
		p.Name = "LaserPod"
1723
		p.formFactor = "Symmetric"
1724
		p.Size = Vector3.new(1, 1, 1)
1725
		p.CanCollide = false
1726
		p.BrickColor = DC
1727
		p.Reflectance = MR
1728
		p.Locked = true
1729
		p.TopSurface = 0
1730
		p.BottomSurface = 0
1731
		p.Parent = model
1732
		local m = Instance.new("BlockMesh")
1733
		m.Scale = Vector3.new(0.1, 0.35, 0.25)
1734
		m.Parent = p
1735
		local w = Instance.new("Weld")
1736
		w.Part0 = p
1737
		w.Part1 = pm
1738
		w.C0 = CFrame.new(-0.22, 1.1, -0.04)
1739
		w.C1 = CFrame.new()
1740
		w.Parent = p--]]
1741
		local p = Instance.new("Part")
1742
		p.Name = "LaserPod"
1743
		p.formFactor = "Symmetric"
1744
		p.Size = Vector3.new(1, 1, 1)
1745
		p.CanCollide = false
1746
		p.BrickColor = DC
1747
		p.Reflectance = MR
1748
		p.Locked = true
1749
		p.TopSurface = 0
1750
		p.BottomSurface = 0
1751
		p.Parent = model
1752
		local m = Instance.new("CylinderMesh")
1753
		m.Scale = Vector3.new(0.12, 0.35, 0.12)
1754
		m.Parent = p
1755
		local w = Instance.new("Weld")
1756
		w.Part0 = p
1757
		w.Part1 = pm
1758
		w.C0 = CFrame.new(-0.22, 1.1, 0.1)
1759
		w.C1 = CFrame.new()
1760
		w.Parent = p
1761
		local p = Instance.new("Part")
1762
		p.Name = "Laser"
1763
		p.CanCollide = false
1764
		p.formFactor = "Symmetric"
1765
		p.Size = Vector3.new(1, 1, 1)
1766
		p.BrickColor = BrickColor.new("Bright red")
1767
		p.Locked = true
1768
		if selected == true and Mode == 1 then
1769
			p.Transparency = 0.4
1770
		else
1771
			p.Transparency = 1
1772
		end
1773
		p.TopSurface = 0
1774
		p.BottomSurface = 0
1775
		p.Parent = model
1776
		local m = Instance.new("BlockMesh")
1777
		m.Scale = Vector3.new(0.01, 500, 0.01)
1778
		m.Offset = Vector3.new(0, -250, 0)
1779
		m.Parent = p
1780
		local w = Instance.new("Weld")
1781
		w.Part0 = p
1782
		w.Part1 = pm
1783
		w.C0 = CFrame.new(-0.22, 1.1, 0.1)
1784
		w.C1 = CFrame.new()
1785
		w.Parent = p	
1786
		local p = Instance.new("Part")
1787
		p.Name = "LaserPod"
1788
		p.formFactor = "Symmetric"
1789
		p.Size = Vector3.new(1, 1, 1)
1790
		p.CanCollide = false
1791
		p.BrickColor = DC
1792
		p.Reflectance = MR
1793
		p.Locked = true
1794
		p.TopSurface = 0
1795
		p.BottomSurface = 0
1796
		p.Parent = model
1797
		local m = Instance.new("CylinderMesh")
1798
		m.Scale = Vector3.new(0.12, 0.35, 0.12)
1799
		m.Parent = p
1800
		local w = Instance.new("Weld")
1801
		w.Part0 = p
1802
		w.Part1 = pm
1803
		w.C0 = CFrame.new(-0.22, 1.1, -0.14)
1804
		w.C1 = CFrame.new()
1805
		w.Parent = p
1806
		local p = Instance.new("Part")
1807
		p.Name = "LightAttach"
1808
		p.formFactor = "Symmetric"
1809
		p.Size = Vector3.new(1, 1, 1)
1810
		p.CanCollide = false
1811
		p.BrickColor = DC
1812
		p.Reflectance = MR
1813
		p.Locked = true
1814
		p.TopSurface = 0
1815
		p.BottomSurface = 0
1816
		p.Parent = model
1817
		local m = Instance.new("CylinderMesh")
1818
		m.Scale = Vector3.new(0.2, 0.35, 0.2)
1819
		m.Parent = p
1820
		local w = Instance.new("Weld")
1821
		w.Part0 = p
1822
		w.Part1 = pm
1823
		w.C0 = CFrame.new(0.25, 1.1, -0.04)
1824
		w.C1 = CFrame.new()
1825
		w.Parent = p
1826
		local p = Instance.new("Part")
1827
		p.Name = "Light"
1828
		p.CanCollide = false
1829
		p.formFactor = "Custom"
1830
		p.Size = Vector3.new(0.2, 0.2, 0.2)
1831
		p.BrickColor = BrickColor.new("Bright yellow")
1832
		p.Locked = true
1833
		if selected == true and Mode == 2 and dual == false then
1834
			p.Transparency = 0.5
1835
		else
1836
			p.Transparency = 1
1837
		end
1838
		p.TopSurface = 0
1839
		p.BottomSurface = 0
1840
		p.Parent = model
1841
		local m = Instance.new("SpecialMesh")
1842
		m.MeshType = "FileMesh"
1843
		m.Scale = Vector3.new(2, 50, 2)
1844
		m.MeshId = "http://www.roblox.com/asset/?id=1033714"
1845
		m.Parent = p
1846
		local w = Instance.new("Weld")
1847
		w.Part0 = p
1848
		w.Part1 = pm
1849
		w.C0 = CFrame.new(0.25, 20, -0.04)
1850
		w.C1 = CFrame.new()
1851
		w.Parent = p			
1852
	else end	
1853
	return model
1854
end
1855
1856
1857
function removeParts(format)
1858
	if format == "RightHand" then
1859
		pcall(function() Player.Character[Name]:Remove() end)
1860
	elseif format == "LeftHand" then
1861
		pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
1862
	elseif format == "RightHolster" then
1863
		pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
1864
	elseif format == "LeftHolster" then
1865
		pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
1866
	end
1867
end
1868
1869
1870
function SetAngle(Joint, Angle, Character)
1871
	if Character == nil then return false end
1872
	local Joints = {
1873
		Character.Torso:FindFirstChild("Right Shoulder 2"),
1874
		Character.Torso:FindFirstChild("Left Shoulder 2"),
1875
		Character.Torso:FindFirstChild("Right Hip 2"),
1876
		Character.Torso:FindFirstChild("Left Hip 2")
1877
	}
1878
	if Joints[Joint] == nil then return false end
1879
	if Joint == 1 or Joint == 3 then
1880
		Joints[Joint].DesiredAngle = Angle
1881
	end
1882
	if Joint == 2 or Joint == 4 then
1883
		Joints[Joint].DesiredAngle = -Angle
1884
	end
1885
end
1886
1887
1888
function ForceAngle(Joint, Angle, Character)
1889
	if Character == nil then return false end
1890
	local Joints = {
1891
		Character.Torso:FindFirstChild("Right Shoulder 2"),
1892
		Character.Torso:FindFirstChild("Left Shoulder 2"),
1893
		Character.Torso:FindFirstChild("Right Hip 2"),
1894
		Character.Torso:FindFirstChild("Left Hip 2")
1895
	}
1896
	if Joints[Joint] == nil then return false end
1897
	if Joint == 1 or Joint == 3 then
1898
		Joints[Joint].DesiredAngle = Angle
1899
		Joints[Joint].CurrentAngle = Angle
1900
	end
1901
	if Joint == 2 or Joint == 4 then
1902
		Joints[Joint].DesiredAngle = -Angle
1903
		Joints[Joint].CurrentAngle = -Angle
1904
	end
1905
end
1906
1907
1908
function SetSpeed(Joint, Speed, Character)
1909
	if Character == nil then return false end
1910
	local Joints = {
1911
		Character.Torso:FindFirstChild("Right Shoulder 2"),
1912
		Character.Torso:FindFirstChild("Left Shoulder 2"),
1913
		Character.Torso:FindFirstChild("Right Hip 2"),
1914
		Character.Torso:FindFirstChild("Left Hip 2")
1915
	}
1916
	if Joints[Joint] == nil then return false end
1917
	Joints[Joint].MaxVelocity = Speed
1918
end
1919
1920
1921
function DisableLimb(Limb, Character)
1922
	if Character == nil then return false end
1923
	if Character:FindFirstChild("Torso") == nil then return false end
1924
	local Joints = {
1925
		Character.Torso:FindFirstChild("Right Shoulder"),
1926
		Character.Torso:FindFirstChild("Left Shoulder"),
1927
		Character.Torso:FindFirstChild("Right Hip"),
1928
		Character.Torso:FindFirstChild("Left Hip")
1929
	}
1930
	local Limbs = {
1931
		Character:FindFirstChild("Right Arm"),
1932
		Character:FindFirstChild("Left Arm"),
1933
		Character:FindFirstChild("Right Leg"),
1934
		Character:FindFirstChild("Left Leg")
1935
	}
1936
	if Joints[Limb] == nil then return false end
1937
	if Limbs[Limb] == nil then return false end
1938
	local Joint = Instance.new("Motor")
1939
	Joint.Parent = Character.Torso
1940
	Joint.Part0 = Character.Torso
1941
	Joint.Part1 = Limbs[Limb]
1942
	if Limb == 1 then
1943
		Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1944
		Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1945
		Joint.Name = "Right Shoulder 2"
1946
	elseif Limb == 2 then
1947
		Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1948
		Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1949
		Joint.Name = "Left Shoulder 2"
1950
	elseif Limb == 3 then
1951
		Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1952
		Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1953
		Joint.Name = "Right Hip 2"
1954
	elseif Limb == 4 then
1955
		Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1956
		Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1957
		Joint.Name = "Left Hip 2"
1958
	end
1959
	Joint.MaxVelocity = Joints[Limb].MaxVelocity
1960
	Joint.CurrentAngle = Joints[Limb].CurrentAngle
1961
	Joint.DesiredAngle = Joints[Limb].DesiredAngle
1962
	Joints[Limb]:Remove()
1963
end
1964
1965
1966
function ResetLimbCFrame(Limb, Character)
1967
	if Character == nil then return false end
1968
	if Character.Parent == nil then return false end
1969
	if Character:FindFirstChild("Torso") == nil then return false end
1970
	local Joints = {
1971
		Character.Torso:FindFirstChild("Right Shoulder 2"),
1972
		Character.Torso:FindFirstChild("Left Shoulder 2"),
1973
		Character.Torso:FindFirstChild("Right Hip 2"),
1974
		Character.Torso:FindFirstChild("Left Hip 2")
1975
	}
1976
	local Limbs = {
1977
		Character:FindFirstChild("Right Arm"),
1978
		Character:FindFirstChild("Left Arm"),
1979
		Character:FindFirstChild("Right Leg"),
1980
		Character:FindFirstChild("Left Leg")
1981
	}
1982
	if Joints[Limb] == nil then return false end
1983
	if Limbs[Limb] == nil then return false end
1984
	if Limb == 1 then
1985
		Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1986
		Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1987
	elseif Limb == 2 then
1988
		Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1989
		Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1990
	elseif Limb == 3 then
1991
		Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1992
		Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1993
	elseif Limb == 4 then
1994
		Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1995
		Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1996
	end
1997
end
1998
1999
2000
function EnableLimb(Limb, Character)
2001
	if Character == nil then return false end
2002
	if Character:FindFirstChild("Torso") == nil then return false end
2003
	local Joints = {
2004
		Character.Torso:FindFirstChild("Right Shoulder 2"),
2005
		Character.Torso:FindFirstChild("Left Shoulder 2"),
2006
		Character.Torso:FindFirstChild("Right Hip 2"),
2007
		Character.Torso:FindFirstChild("Left Hip 2")
2008
	}
2009
	local Limbs = {
2010
		Character:FindFirstChild("Right Arm"),
2011
		Character:FindFirstChild("Left Arm"),
2012
		Character:FindFirstChild("Right Leg"),
2013
		Character:FindFirstChild("Left Leg")
2014
	}
2015
	if Joints[Limb] == nil then return false end
2016
	if Limbs[Limb] == nil then return false end
2017
	if Limb == 1 then
2018
		Joints[Limb].Name = "Right Shoulder"
2019
	elseif Limb == 2 then
2020
		Joints[Limb].Name = "Left Shoulder"
2021
	elseif Limb == 3 then
2022
		Joints[Limb].Name = "Right Hip"
2023
	elseif Limb == 4 then
2024
		Joints[Limb].Name = "Left Hip"
2025
	end
2026
	Animate = Character:FindFirstChild("Animate")
2027
	if Animate == nil then return false end
2028
	Animate = Animate:Clone()
2029
	Character.Animate:Remove()
2030
	Animate.Parent = Character
2031
end
2032
2033
2034
function playAnimation(format, mouse)
2035
	if format == "equip" then
2036
		Player.Character.Humanoid.WalkSpeed = WSPenalty
2037
		Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
2038
		local w = Instance.new("Weld")
2039
		w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
2040
		w.Part1 = Player.Character:FindFirstChild("Right Arm")
2041
		w.C0 = CFrame.new(0, 1.2, 0.7)
2042
		w.C1 = CFrame.new()
2043
		w.Parent = Player.Character[Name.. " (Holstered)"].Handle
2044
		for i = 0.01, 1, 0.1 do
2045
			if Player.Character:FindFirstChild("Torso") ~= nil then
2046
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2047
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2048
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i)
2049
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2050
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
2051
					wait()
2052
				else return false end
2053
			else return false end
2054
		end
2055
		return playAnimation("hold")
2056
	end
2057
	if format == "unequip" then
2058
		Mode = 0
2059
		if Attachment == true then
2060
			Player.Character[Name].Laser.Transparency = 1
2061
			Player.Character[Name].Light.Transparency = 1			
2062
		end	
2063
		Player.Character.Humanoid.WalkSpeed = 16	
2064
		for i = 1, 0.01, -0.1 do
2065
			if Player.Character:FindFirstChild("Torso") ~= nil then
2066
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2067
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2068
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.5 * i) + (1.5 * (1 - i)), 1.2 * i, 0.8 * i) * CFrame.fromEulerAnglesXYZ(math.rad(300 + ((1 - i) * 50)), math.rad(10), math.rad(-90) * i)
2069
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2070
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new((-0.9 * i) + (-1.5 * (1 - i)), -0.35 * i, 0.51 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
2071
					wait()
2072
				else return false end
2073
			else return false end
2074
		end
2075
		return true
2076
	end
2077
	if format == "hold" then
2078
		if Player.Character:FindFirstChild("Torso") ~= nil then
2079
			if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2080
				Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2081
				Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
2082
				Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2083
				Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
2084
			else return false end
2085
		else return false end
2086
	end
2087
	if format == "reload" then
2088
		for i = 5, 0, -1 do
2089
			if Player.Character:FindFirstChild("Torso") ~= nil then
2090
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2091
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2092
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 0.75, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(315 + (i * 1.5)), math.rad(i * 4), math.rad(-90))
2093
					wait()
2094
				else return false end
2095
			else return false end
2096
		end							
2097
		coroutine.resume(coroutine.create(function()
2098
			for i = 0, 25, 5 do
2099
				if Player.Character:FindFirstChild("Torso") ~= nil then
2100
					if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2101
						Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2102
						Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
2103
						wait()
2104
					else return false end
2105
				else return false end
2106
			end
2107
		end))
2108
		Player.Character[Name].Handle.Release:Play()
2109
		Player.Character[Name].Magazine.Transparency = 1
2110
		Player.Character[Name].MagPull1.Transparency = 1
2111
		Player.Character[Name].MagPull2.Transparency = 1	
2112
		local Mag = Instance.new("Model")
2113
		Mag.Name = "Spent Magazine"		
2114
		local source = Player.Character[Name]:FindFirstChild("Magazine")
2115
		if source == nil then return end
2116
		source = source:Clone()
2117
		source.CanCollide = true
2118
		source.Transparency = 0
2119
		source.Parent = Mag
2120
		coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do source.Transparency = i wait() end source:Remove() end))
2121
		for _, Part in pairs(Player.Character[Name]:GetChildren()) do
2122
			if Part.Name == "MagPull1" or Part.Name == "MagPull2" then
2123
				local new = Part:Clone()
2124
				new.Parent = Mag
2125
				new.Transparency = 0
2126
				new.CanCollide = true
2127
				local w = Instance.new("Weld", new)
2128
				w.Part0 = w.Parent
2129
				w.Part1 = source
2130
				w.C0 = Part.Weld.C0
2131
				w.C1 = Part.Weld.C1
2132
				coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do new.Transparency = i wait() end new:Remove() end))
2133
			else end
2134
		end
2135
		Mag.Parent = game.Workspace
2136
		for i = 0, 25, 5 do
2137
			if Player.Character:FindFirstChild("Torso") ~= nil then
2138
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2139
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2140
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + (i / 60), 1.2 - (i / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 + -i * 3.5), math.rad(-90))
2141
					wait()
2142
				else return false end
2143
			else return false end
2144
		end
2145
		magazineNew = Player.Character[Name].Magazine:Clone()
2146
		magazineNew.Name = "New Magazine" 
2147
		magazineNew.Transparency = 0
2148
		magazineNew.Parent = Player.Character[Name]
2149
		local w = Instance.new("Weld")
2150
		w.Part0 = magazineNew
2151
		w.Part1 = Player.Character:FindFirstChild("Left Arm")
2152
		w.C0 = CFrame.new(0, 1.1, 0)
2153
		w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
2154
		w.Parent = magazineNew
2155
		wait(0.2)
2156
		for i = 25, 0, -5 do
2157
			if Player.Character:FindFirstChild("Torso") ~= nil then
2158
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2159
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2160
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3 + ((i + 10) / 60), 1.2 - ((i + 10) / 20), 0.8 + (i / 35)) * CFrame.fromEulerAnglesXYZ(math.rad(300 - (i - 10)), math.rad(10 + -i * 3.5), math.rad(-90))
2161
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2162
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9 + ((25 - i) / 30), -0.35, 0.51 + ((25 - i) / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), math.rad((25 * 2) - (i * 2)))
2163
					wait()
2164
				else return false end
2165
			else return false end
2166
		end
2167
		Player.Character[Name].Magazine.Transparency = 0
2168
		Player.Character[Name].MagPull1.Transparency = 0
2169
		Player.Character[Name].MagPull2.Transparency = 0
2170
		CamShake(1, 30000)	
2171
		CamShake(1, -30000)													
2172
		Player.Character[Name]["New Magazine"]:Remove()
2173
		wait(0.1)
2174
		if Player.Character:FindFirstChild("Torso") ~= nil then
2175
			if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2176
				Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2177
				Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
2178
				Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2179
				Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
2180
			else return false end
2181
		else return false end
2182
		Player.Character[Name].Handle.Reload:Play()	
2183
		Player.Character[Name].Handle.Jam:Play()				
2184
		wait(0.2)
2185
		if magazine.Value == 0 or Jammed == true then
2186
			playAnimation("charge")
2187
		end
2188
	end
2189
	if format == "charge" then
2190
		Player.Character[Name].Handle.Weld:Remove()
2191
		local w = Instance.new("Weld")
2192
		w.Part0 = Player.Character[Name].Handle
2193
		w.Part1 = Player.Character:FindFirstChild("Left Arm")
2194
		w.C0 = CFrame.new(-0.85, -0.3, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), math.rad(90), 0)
2195
		w.C1 = CFrame.new(0, 0.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(40), 0, 0)
2196
		w.Parent = Player.Character[Name].Handle
2197
		if Player.Character:FindFirstChild("Torso") ~= nil then
2198
			if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2199
				Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2200
				Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.4, 0.9, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(280), math.rad(-10), math.rad(-90))
2201
			else return false end
2202
		else return false end
2203
		wait(0.2)
2204
		Player.Character[Name].Handle.Equip:Play()
2205
		Player.Character[Name].CHandleC.Transparency = 1
2206
		Player.Character[Name].CHandleB.Transparency = 0
2207
		Player.Character[Name].CHandleB1.Transparency = 0	
2208
		Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0.115, 0)
2209
		Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.1, 0.14)		
2210
		Player.Character[Name].DustCover.Mesh.Offset = Vector3.new(0, 0, 0.115)	
2211
		Jammed = false	
2212
		if magazine.Value ~= 0 then
2213
			makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))	
2214
		else end					
2215
		for i = 0, 1, 0.25 do
2216
			if Player.Character:FindFirstChild("Torso") ~= nil then
2217
				if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2218
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2219
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1.2, 0 - (i / 1.5), 0.9) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
2220
					wait()
2221
				else return false end
2222
			else return false end
2223
		end
2224
		wait(0.08)
2225
		Player.Character[Name].CHandleC.Transparency = 0
2226
		Player.Character[Name].CHandleB.Transparency = 1
2227
		Player.Character[Name].CHandleB1.Transparency = 1
2228
		Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0, 0)
2229
		Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.3, 0.14)			
2230
		wait(0.02)
2231
		removeParts("RightHand")
2232
		makeParts("RightHand")	
2233
		Player.Character[Name].DustCover.Mesh.Offset = Vector3.new(0, 0, 0.115)			
2234
		playAnimation("hold")
2235
		return true
2236
	end
2237
	if format == "fire" then
2238
		Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0.115, 0)
2239
		Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.1, 0.14)		
2240
		Player.Character[Name].DustCover.Mesh.Offset = Vector3.new(0, 0, 0.115)		
2241
		makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
2242
		if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
2243
			if silenced then
2244
				Player.Character[Name].Handle.Fire2.Volume = math.random(8, 10) / 10
2245
				Player.Character[Name].Handle.Fire2.Pitch = math.random(1.8, 2)
2246
				Player.Character[Name].Handle.Fire2:Play()
2247
				CamShake(10, 40000)
2248
			else
2249
				Player.Character[Name].Handle.Fire.Volume = math.random(9, 10) / 10
2250
				Player.Character[Name].Handle.Fire.Pitch = math.random(1.6, 1.8)
2251
				Player.Character[Name].Handle.Fire:Play()
2252
				CamShake(10, 50000)
2253
			end
2254
		else return false end
2255
		if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
2256
			if silenced == false then
2257
				coroutine.resume(coroutine.create(function() Player.Character[Name].DustCover.Smoke.Enabled = true Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].DustCover.Smoke.Enabled = false Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
2258
			else end
2259
		else return false end
2260
		for i = 0, 6, 3 do
2261
			if Player.Character:FindFirstChild("Torso") ~= nil then
2262
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2263
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2264
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
2265
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2266
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
2267
					wait()
2268
				else return false end
2269
			else return false end
2270
		end
2271
		if magazine.Value ~= 0 then
2272
			Player.Character[Name].Bolt.Mesh.Offset = Vector3.new(0, 0, 0)
2273
			Player.Character[Name].Bolt.Mesh.Scale = Vector3.new(0.14, 0.3, 0.14)				
2274
		elseif magazine.Value == 0 then
2275
			Player.Character[Name].Handle.Lock:Play()
2276
		end
2277
		if math.random(1, Reliability) == 1 then 
2278
			Jammed = true
2279
			Player.Character[Name].Handle.Jam:Play()			
2280
		end
2281
		for i = 6, 0, -3 do
2282
			if Player.Character:FindFirstChild("Torso") ~= nil then
2283
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2284
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2285
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.3, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
2286
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2287
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
2288
					wait()
2289
				else return false end
2290
			else return false end
2291
		end
2292
	end
2293
	if format == "silence" then
2294
		Player.Character[Name].Handle.Jam:Play()
2295
		if Player.Character:FindFirstChild("Torso") ~= nil then
2296
			if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2297
				Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2298
				Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.6, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
2299
			else return false end
2300
		else return false end		
2301
		for i = 0, 10, 1.5 do
2302
			if Player.Character:FindFirstChild("Torso") ~= nil then
2303
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
2304
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2305
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 1.4 - (i / 25), 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
2306
					wait()
2307
				end
2308
			end
2309
		end
2310
		for i = 10, 0, -1.5 do
2311
			if Player.Character:FindFirstChild("Torso") ~= nil then
2312
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
2313
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2314
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 1.4 - (i / 25), 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
2315
					wait()
2316
				end
2317
			end
2318
		end
2319
		playAnimation("hold")
2320
		return
2321
	end
2322
	if format == "attachment" then
2323
		Player.Character[Name].Handle.Switch:Play()
2324
		for i = 0, 10, 5 do
2325
			if Player.Character:FindFirstChild("Torso") ~= nil then
2326
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
2327
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2328
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
2329
					wait()
2330
				end
2331
			end
2332
		end
2333
		for i = 10, 0, -5 do
2334
			if Player.Character:FindFirstChild("Torso") ~= nil then
2335
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
2336
					Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
2337
					Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
2338
					wait()
2339
				end
2340
			end
2341
		end
2342
	end
2343
	if format == "switch" then
2344
		for i = 10, 0, -3 do
2345
			if Player.Character:FindFirstChild("Torso") ~= nil then
2346
				if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
2347
					Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
2348
					Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-1 + (i / 30), -0.35, 0.51 + (i / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad((25 * 2) - ((25 - i) * 2)))
2349
					wait()
2350
				else return false end
2351
			else return false end
2352
		end	
2353
	end
2354
	return true
2355
end
2356
2357
2358
function CamShake(time, freq)
2359
	coroutine.resume(coroutine.create(function()
2360
		local cam = game:GetService("Workspace").CurrentCamera
2361
		local time = 10
2362
		local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
2363
		if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
2364
		if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
2365
		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)
2366
		for i = 1, time do
2367
			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)
2368
			wait()
2369
		end
2370
	end))
2371
end
2372
2373
2374
function makeShell(part)
2375
	if part == nil then return false end
2376
	local casing = Instance.new("Part")
2377
	casing.Name = "Shell"
2378
	casing.formFactor = "Custom"
2379
	casing.Size = Vector3.new(0.2, 0.25, 0.2)
2380
	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)))
2381
	casing.BrickColor = BrickColor.new("New Yeller")
2382
	local mesh = Instance.new("CylinderMesh")
2383
	mesh.Scale = Vector3.new(0.3, 1, 0.3)
2384
	mesh.Parent = casing
2385
	casing.Parent = game:GetService("Workspace")
2386
	casing:BreakJoints()
2387
	casing.Velocity = (part.CFrame.lookVector * 50) + Vector3.new(0, 10, 0)
2388
	coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
2389
end
2390
2391
2392
function Weld(x, y)
2393
	local weld = Instance.new("Weld")
2394
	weld.Part0 = x
2395
	weld.Part1 = y
2396
	CJ = CFrame.new(x.Position)
2397
	C0 = x.CFrame:inverse() * CJ
2398
	C1 = y.CFrame:inverse() * CJ
2399
	weld.C0 = C0
2400
	weld.C1 = C1
2401
	weld.Parent = x
2402
end
2403
2404
2405
function tagHumanoid(humanoid)
2406
	local tag = Instance.new("ObjectValue")
2407
	tag.Name = "creator"
2408
	tag.Value = Player
2409
	tag.Parent = humanoid
2410
	local tag = Instance.new("StringValue")
2411
	tag.Name = "creatorType1"
2412
	tag.Value = Name
2413
	tag.Parent = humanoid
2414
	local tag = Instance.new("StringValue")
2415
	tag.Name = "creatorType2"
2416
	tag.Value = "shot"
2417
	tag.Parent = humanoid
2418
end
2419
2420
2421
function untagHumanoid(humanoid)
2422
	if humanoid ~= nil then
2423
		local tag = humanoid:FindFirstChild("creator")
2424
		if tag ~= nil then
2425
			tag:Remove()
2426
		end
2427
		local tag = humanoid:FindFirstChild("creatorType1")
2428
		if tag ~= nil then
2429
			tag:Remove()
2430
		end
2431
		local tag = humanoid:FindFirstChild("creatorType2")
2432
		if tag ~= nil then
2433
			tag:Remove()
2434
		end
2435
	end
2436
end
2437
2438
2439
function fire(startPoint, endPoint, hit)
2440
	local trail = Instance.new("Part")
2441
	trail.Name = "Bullet Trail"
2442
	trail.BrickColor = BrickColor.new("Dark stone grey")
2443
	trail.TopSurface = 0
2444
	trail.BottomSurface = 0
2445
	trail.formFactor = 0
2446
	trail.Size = Vector3.new(1, 1, 1)
2447
	trail.Transparency = 0.5
2448
	trail.Anchored = true
2449
	trail.CanCollide = false
2450
	trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
2451
	trail.Parent = game:GetService("Workspace")
2452
	local mesh = Instance.new("SpecialMesh")
2453
	mesh.MeshType = "Brick"
2454
	mesh.Scale = Vector3.new(0.1, 0.1, (startPoint - endPoint).magnitude)
2455
	mesh.Parent = trail
2456
	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)
2457
	if hit ~= nil then
2458
		if hit.Parent == nil then return end
2459
		if hit.Parent.ClassName == "Hat" then
2460
			if hit.Parent.Parent.Humanoid ~= nil then
2461
				hit.Parent.Parent.Humanoid:TakeDamage(damage * 5)
2462
			end
2463
		end		
2464
		if hit.Parent:FindFirstChild("Humanoid") ~= nil then
2465
			tagHumanoid(hit.Parent.Humanoid)
2466
			if hit.Name == "Head" then
2467
				hit.Parent.Humanoid:TakeDamage(damage * 10)
2468
			elseif hit.Name == "Torso" then
2469
				hit.Parent.Humanoid:TakeDamage(damage * 2)
2470
			elseif hit.Name == "Left Leg" then
2471
				hit.Parent.Humanoid:TakeDamage(damage)	
2472
				hit.Parent.Humanoid.Sit = true	
2473
			elseif hit.Name == "Right Leg" then
2474
				hit.Parent.Humanoid:TakeDamage(damage)	
2475
				hit.Parent.Humanoid.Sit = true								
2476
			else
2477
				hit.Parent.Humanoid:TakeDamage(damage)
2478
			end
2479
			if math.random(1, 10) == 1 then
2480
				hit.Parent.Humanoid.Sit = true
2481
			end
2482
			delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
2483
		end
2484
		if hit.Anchored == false then
2485
			hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
2486
		end
2487
	end
2488
end
2489
2490
2491
function onButton1Down(mouse)
2492
	if selected == false then return end
2493
	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
2494
		if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
2495
		if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
2496
		if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
2497
		if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
2498
		mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2499
		Button1Down = true
2500
		canFire = false
2501
		canFire2 = true
2502
		while canFire2 == true do
2503
			local humanoid = Player.Character:FindFirstChild("Humanoid")
2504
			if humanoid == nil then
2505
				canFire2 = false
2506
				break
2507
			end
2508
			if humanoid.Health <= 0 then
2509
				canFire2 = false
2510
				break
2511
			end
2512
			local fireLeft = false
2513
			if automatic == false and burst == false then
2514
				canFire2 = false
2515
			elseif automatic == false and burst == true then
2516
				if burstCount >= burstCountMax then
2517
					canFire2 = false
2518
					burstCount = 0
2519
					break
2520
				end
2521
				burstCount = burstCount + 1
2522
			elseif automatic == true and burst == false then
2523
				fireLeft = true
2524
			end
2525
			if Jammed ~= true then
2526
				if magazine.Value > 0 then
2527
					magazine.Value = magazine.Value - 1
2528
					updateGui()
2529
					if silenced == true then
2530
						CamShake(1, Spread)
2531
					else end		
2532
					fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
2533
					coroutine.resume(coroutine.create(function()
2534
						if dual == true then
2535
							playAnimation("rightFire")
2536
						elseif dual == false then
2537
							playAnimation("fire")
2538
						end
2539
					end))
2540
				else
2541
					Player.Character[Name].Handle.Empty:Play()
2542
				end
2543
			else
2544
				Player.Character[Name].Handle.Jam:Play()	
2545
			end
2546
			if fireLeft == true and dual == true and automatic == true then
2547
				if magazine.Value > 0 then
2548
					coroutine.resume(coroutine.create(function()
2549
						wait(readyTime / 2)
2550
						magazine.Value = magazine.Value - 1
2551
						updateGui()
2552
						fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
2553
						playAnimation("leftFire")
2554
					end))
2555
				else
2556
					coroutine.resume(coroutine.create(function()
2557
						wait(readyTime / 2)
2558
						Player.Character[Name].Handle.Empty:Play()
2559
					end))
2560
				end
2561
			end
2562
			wait(readyTime)
2563
		end
2564
		if magazine.Value ~= 0 then
2565
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2566
		else end
2567
		canFire = true
2568
	end
2569
end
2570
2571
2572
function onButton1Up(mouse)
2573
	if selected == false then return end
2574
	Button1Down = false
2575
	canFire2 = false
2576
	burstCount = 0
2577
	while canFire == false do wait() end
2578
	if dual == true and automatic == false then
2579
		if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
2580
		if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
2581
		mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2582
		canFire = false
2583
		canFire2 = true
2584
		while canFire2 == true do
2585
			local humanoid = Player.Character:FindFirstChild("Humanoid")
2586
			if humanoid == nil then
2587
				canFire2 = false
2588
				break
2589
			end
2590
			if humanoid.Health <= 0 then
2591
				canFire2 = false
2592
				break
2593
			end
2594
			if burst == false then
2595
				canFire2 = false
2596
			elseif burst == true then
2597
				if burstCount >= burstCountMax then
2598
					canFire2 = false
2599
					burstCount = 0
2600
					break
2601
				end
2602
				burstCount = burstCount + 1
2603
			end
2604
			if magazine.Value <= 0 then
2605
				Player.Character[Name].Handle.Empty:Play()
2606
			else
2607
				coroutine.resume(coroutine.create(function()
2608
					playAnimation("leftFire")
2609
				end))
2610
				magazine.Value = magazine.Value - 1
2611
				updateGui()
2612
				fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
2613
			end
2614
			wait(readyTime)
2615
		end
2616
		if magazine.Value ~= 0 then
2617
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2618
		else end
2619
		canFire = true
2620
	end
2621
end
2622
2623
2624
function onKeyDown(key, mouse)
2625
	if selected == false then return end
2626
	key = key:lower()
2627
	if key == "q" and Button1Down == false and canFire == true then
2628
		if mouse.Target == nil then return end
2629
		if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
2630
			if dual == true then onKeyDown("t", mouse) end
2631
			onDeselected(mouse)
2632
			removeParts("RightHolster")
2633
			script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
2634
		end
2635
	end
2636
	if key == "e" and Button1Down == false and canFire == true and canSilence == true then
2637
		canFire = false
2638
		if silenced then
2639
			playAnimation("silence")
2640
			silenced = false
2641
			if Player.Character:FindFirstChild(Name) == nil then return end
2642
			if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
2643
			if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
2644
			Player.Character[Name].Muzzle.Transparency = 1
2645
			Player.Character[Name].Silencer1.Transparency = 1
2646
			Player.Character[Name].Silencer2.Transparency = 1						
2647
			Player.Character[Name].Muzzle.Name = "Silencer"
2648
			Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
2649
			if dual == true then
2650
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
2651
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
2652
				Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
2653
				Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
2654
				Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
2655
			end
2656
		else
2657
			playAnimation("silence")
2658
			silenced = true
2659
			if Player.Character:FindFirstChild(Name) == nil then return end
2660
			if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
2661
			if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
2662
			Player.Character[Name].Silencer.Transparency = 0
2663
			Player.Character[Name].Silencer1.Transparency = 0
2664
			Player.Character[Name].Silencer2.Transparency = 0									
2665
			Player.Character[Name].Muzzle.Name = "Muzzle 2"
2666
			Player.Character[Name].Silencer.Name = "Muzzle"
2667
			if dual == true then
2668
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
2669
				if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
2670
				Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
2671
				Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
2672
				Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
2673
			end
2674
		end
2675
		canFire = true
2676
	end
2677
	if key == "r" and Button1Down == false and canFire == true then
2678
		if ammo.Value > 0 and magazine.Value ~= magazineMax.Value + 1 then
2679
			canFire = false
2680
			burstCount = 0
2681
			mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2682
			if magazine.Value > 0 then magazine.Value = 1 end
2683
			updateGui()
2684
			if dual == true then
2685
				playAnimation("reloadDual")
2686
			elseif dual == false then
2687
				playAnimation("reload")
2688
			end
2689
			if ammo.Value - magazineMax.Value < 0 then
2690
				magazine.Value = ammo.Value
2691
				ammo.Value = 0
2692
			elseif ammo.Value - magazineMax.Value >= 0 then
2693
				ammo.Value = ammo.Value - magazineMax.Value
2694
				magazine.Value = magazine.Value + magazineMax.Value
2695
			end
2696
			updateGui()
2697
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2698
			canFire = true
2699
		end
2700
	end
2701
	if key == "t" and Button1Down == false and canFire == true and canDual == true then
2702
		canFire = false
2703
		if dual == false then
2704
			local weapon = nil
2705
			for _, p in pairs(Player.Backpack:GetChildren()) do
2706
				if p.Name == Name and p ~= script.Parent then weapon = p break end
2707
			end
2708
			if weapon ~= nil then
2709
				dual = true
2710
				weapon.Name = "Dual"
2711
				weapon.Parent = script
2712
				silenced = false
2713
				removeParts("RightHand")
2714
				makeParts("RightHand")
2715
				removeParts("RightHolster")
2716
				makeParts("LeftHolster")
2717
				playAnimation("leftEquip")
2718
				removeParts("LeftHolster")
2719
				makeParts("LeftHand")
2720
				magazineMax.Value = math.ceil(magazineMax.Value * 2)
2721
				ammoMax.Value = math.ceil(ammoMax.Value * 2)
2722
				magazine.Value = magazine.Value + weapon.Magazine.Value
2723
				ammo.Value = ammo.Value + weapon.Ammo.Value
2724
				updateGui()
2725
			end
2726
		elseif dual == true then
2727
			local weapon = script:FindFirstChild("Dual")
2728
			if weapon ~= nil then
2729
				dual = false
2730
				weapon.Name = Name
2731
				weapon.Parent = Player.Backpack
2732
				silenced = false
2733
				removeParts("RightHand")
2734
				makeParts("RightHand")
2735
				playAnimation("leftUnequip")
2736
				removeParts("LeftHand")
2737
				makeParts("RightHolster")
2738
				playAnimation("hold")
2739
				weapon.Magazine.Value = math.floor(magazine.Value / 2)
2740
				weapon.Ammo.Value = math.floor(ammo.Value / 2)
2741
				magazineMax.Value = math.ceil(magazineMax.Value / 2)
2742
				ammoMax.Value = math.ceil(ammoMax.Value / 2)
2743
				magazine.Value = math.ceil(magazine.Value / 2)
2744
				ammo.Value = math.ceil(ammo.Value / 2)
2745
				updateGui()
2746
			end
2747
		end
2748
		canFire = true
2749
	end
2750
	if key == "y" and canZoom == true then
2751
		if zoom == false then
2752
			zoom = true
2753
			local pos = mouse.Hit.p
2754
			local target = mouse.Target
2755
			local cam = game:GetService("Workspace").CurrentCamera
2756
			focus = Instance.new("Part", workspace)
2757
			focus.Anchored = true
2758
			focus.CanCollide = false
2759
			focus.Transparency = 1
2760
			focus.TopSurface = 0
2761
			focus.BottomSurface = 0
2762
			focus.formFactor = "Plate"
2763
			focus.Size = Vector3.new(0, 0, 0)
2764
			focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
2765
			cam.CameraSubject = focus
2766
			cam.CameraType = "Attach"
2767
			while zoom == true and selected == true do
2768
				local set = false
2769
				if target ~= nil then
2770
					if target.Parent ~= nil then
2771
						if target.Anchored == false then
2772
							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)
2773
							set = true
2774
						end
2775
					end
2776
				end
2777
				if set == false then
2778
					focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
2779
				end
2780
				wait()
2781
			end
2782
			if focus ~= nil then focus:Remove() focus = nil end
2783
			local cam = game:GetService("Workspace").CurrentCamera
2784
			cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
2785
			cam.CameraType = "Custom"
2786
		else
2787
			zoom = false
2788
		end
2789
	end
2790
	if key == "u" and Button1Down == false and canFire == true then
2791
		playAnimation("switch")
2792
		if automatic == false and burst == false then
2793
			if switchToBurst == true then
2794
				burst = true
2795
				local m = Instance.new("Message", Player)
2796
				m.Text = "Burst"
2797
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2798
				delay(2.5, function() m:Remove() end)
2799
			elseif switchToAutomatic == true then
2800
				automatic = true
2801
				local m = Instance.new("Message", Player)
2802
				m.Text = "Automatic"
2803
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2804
				delay(2.5, function() m:Remove() end)
2805
			end
2806
		elseif automatic == false and burst == true then
2807
			if switchToAutomatic == true then
2808
				automatic = true
2809
				burst = false
2810
				local m = Instance.new("Message", Player)
2811
				m.Text = "Automatic"
2812
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2813
				delay(2.5, function() m:Remove() end)
2814
			elseif switchToSingle == true then
2815
				burst = false
2816
				local m = Instance.new("Message", Player)
2817
				m.Text = "Single"
2818
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2819
				delay(2.5, function() m:Remove() end)
2820
			end
2821
		elseif automatic == true and burst == false then
2822
			if switchToSingle == true then
2823
				automatic = false
2824
				local m = Instance.new("Message", Player)
2825
				m.Text = "Single"
2826
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2827
				delay(2.5, function() m:Remove() end)
2828
			elseif switchToBurst == true then
2829
				automatic = false
2830
				burst = true
2831
				local m = Instance.new("Message", Player)
2832
				m.Text = "Burst"
2833
				pcall(function() Player.Character[Name].Handle.Switch:Play() end)
2834
				delay(2.5, function() m:Remove() end)
2835
			end
2836
		end
2837
	end
2838
	if key == "f" and Button1Down == false and canFire == true and Attachment == true and dual == false then
2839
		playAnimation("attachment")
2840
		if Mode == 1 and Mode ~= 2 and Mode ~= 0 then
2841
			Player.Character[Name].Handle.Switch:Play()
2842
			Player.Character[Name].Laser.Transparency = 1
2843
			Player.Character[Name].Light.Transparency = 0.5
2844
			Mode = 2
2845
		elseif Mode == 2 and Mode ~= 1 and Mode ~= 0 then
2846
			Player.Character[Name].Handle.Switch:Play()		
2847
			Player.Character[Name].Laser.Transparency = 1
2848
			Player.Character[Name].Light.Transparency = 1
2849
			Mode = 0
2850
		elseif Mode == 0 and Mode ~= 1 and Mode ~= 2 then
2851
			Player.Character[Name].Handle.Switch:Play()		
2852
			Player.Character[Name].Laser.Transparency = 0.4
2853
			Player.Character[Name].Light.Transparency = 1
2854
			Mode = 1
2855
		end
2856
	else end
2857
	if key == "c" and Button1Down == false and canFire == true then
2858
		if magazine.Value ~= 0 then
2859
			canFire = false
2860
			burstCount = 0
2861
			mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2862
			if magazine.Value ~= 0 then magazine.Value = magazine.Value - 1 end
2863
			updateGui()
2864
			playAnimation("charge")
2865
			mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2866
			canFire = true
2867
		end
2868
	end	
2869
end
2870
2871
2872
function onSelected(mouse)
2873
	if selected == true then return end
2874
	selected = true
2875
	canFire = false
2876
	mouse.Icon = "http://www.roblox.com/asset/?id=59125642"
2877
	while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
2878
		if Player.Character.WeaponActivated.Value == nil then break end
2879
		if Player.Character.WeaponActivated.Value.Parent == nil then break end
2880
		wait()
2881
	end
2882
	updateGui()
2883
	local weapon = Instance.new("ObjectValue")
2884
	weapon.Name = "WeaponActivated"
2885
	weapon.Value = script.Parent
2886
	weapon.Parent = Player.Character
2887
	DisableLimb(1, Player.Character)
2888
	DisableLimb(2, Player.Character)
2889
	ForceAngle(1, 0, Player.Character)
2890
	ForceAngle(2, 0, Player.Character)
2891
	if dual == true then
2892
		coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
2893
		playAnimation("rightEquip")
2894
		removeParts("LeftHolster")
2895
		makeParts("LeftHand")
2896
	else
2897
		playAnimation("equip")
2898
	end
2899
	removeParts("RightHolster")
2900
	makeParts("RightHand")
2901
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
2902
	mouse.Button1Up:connect(function() onButton1Up(mouse) end)
2903
	mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
2904
	mouse.Icon = "http://www.roblox.com/asset/?id=59125633"
2905
	canFire = true
2906
end
2907
2908
2909
function onDeselected(mouse)
2910
	if selected == false then return end
2911
	Button1Down = false
2912
	while canFire == false do
2913
		wait()
2914
	end
2915
	selected = false
2916
	if dual == true then
2917
		if math.random(1, 2) == 1 then
2918
			coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
2919
			wait(math.random(1, 10) / 10)
2920
			playAnimation("rightUnequip")
2921
		else
2922
			coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
2923
			wait(math.random(1, 10) / 10)
2924
			playAnimation("leftUnequip")
2925
		end
2926
		removeParts("LeftHand")
2927
		makeParts("LeftHolster")
2928
	else
2929
		playAnimation("unequip")
2930
	end
2931
	removeParts("RightHand")
2932
	makeParts("RightHolster")
2933
	ForceAngle(1, 0, Player.Character)
2934
	ForceAngle(2, 0, Player.Character)
2935
	ResetLimbCFrame(1, Player.Character)
2936
	ResetLimbCFrame(2, Player.Character)
2937
	EnableLimb(1, Player.Character)
2938
	EnableLimb(2, Player.Character)
2939
	if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
2940
	if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
2941
		if Player.Character.WeaponActivated.Value == script.Parent then
2942
			Player.Character.WeaponActivated:Remove()
2943
		end
2944
	end
2945
	while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
2946
		if Player.Character.WeaponActivated.Value == nil then break end
2947
		if Player.Character.WeaponActivated.Value.Parent == nil then break end
2948
		wait()
2949
	end
2950
end
2951
2952
2953
if script.Parent.className ~= "HopperBin" then
2954
	if Player == nil then print("Error: Player not found!") return end
2955
	Tool = Instance.new("HopperBin")
2956
	Tool.Name = Name
2957
	Tool.Parent = Player.Backpack
2958
	script.Name = "Main"
2959
	script.Parent = Tool
2960
elseif script.Parent.className == "HopperBin" then
2961
	while script.Parent.Parent.className ~= "Backpack" do
2962
		wait()
2963
	end
2964
	if script.Parent:FindFirstChild("MagazineMax") == nil then
2965
		magazineMax = Instance.new("NumberValue")
2966
		magazineMax.Name = "MagazineMax"
2967
		if Magazine == "STANAG" then
2968
			magazineMax.Value = 30
2969
		elseif Magazine == "Beta-C" then
2970
			magazineMax.Value = 100
2971
		else end
2972
		magazineMax.Parent = script.Parent
2973
	else
2974
		magazineMax = script.Parent.MagazineMax
2975
	end
2976
	if script.Parent:FindFirstChild("Magazine") == nil then
2977
		magazine = Instance.new("NumberValue")
2978
		magazine.Name = "Magazine"
2979
		magazine.Value = 0
2980
		magazine.Parent = script.Parent
2981
	else
2982
		magazine = script.Parent.Magazine
2983
	end
2984
	if script.Parent:FindFirstChild("AmmoMax") == nil then
2985
		ammoMax = Instance.new("NumberValue")
2986
		ammoMax.Name = "AmmoMax"
2987
		if Magazine == "STANAG" then
2988
			ammoMax.Value = 180
2989
		elseif Magazine == "Beta-C" then
2990
			ammoMax.Value = 300
2991
		else end
2992
		ammoMax.Parent = script.Parent
2993
	else
2994
		ammoMax = script.Parent.AmmoMax
2995
	end
2996
	if script.Parent:FindFirstChild("Ammo") == nil then
2997
		ammo = Instance.new("NumberValue")
2998
		ammo.Name = "Ammo"
2999
		ammo.Value = script.Parent.AmmoMax.Value
3000
		ammo.Parent = script.Parent
3001
	else
3002
		ammo = script.Parent.Ammo
3003
	end
3004
	Player = script.Parent.Parent.Parent
3005
	makeParts("RightHolster")
3006
	script.Parent.Selected:connect(onSelected)
3007
	script.Parent.Deselected:connect(onDeselected)
3008
end
3009
--lego
3010
game.Workspace.epicikr.Humanoid.MaxHealth = math.huge  -----Replace epicikr with your name, it gives you INF health, enjoy. C:
3011
--print(lego)
3012
--Meidafire