View difference between Paste ID: 5zrsURyi and gnXhsXkx
SHOW: | | - or go back to the newest paste.
1-
1+
2
Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("rebelkiller123")
3-
Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("SlickV")
3+
4
MC = BrickColor.new("Black")
5
DC = BrickColor.new("Black")
6
GC = BrickColor.new("Medium green")
7
BC = BrickColor.new("Dark stone grey")
8
MR = 0
9
GR = 0
10
HP = true
11
selected = false
12
canDual = false
13
dual = false
14
Button1Down = false
15
damage = 95
16
canFire = true
17
canFire2 = false
18
readyTime = 1.8
19
automatic = false
20
burst = false
21
burstCount = 0
22
burstCountMax = 2
23
canSilence = true
24
silenced = false
25
canZoom = true
26
zoom = false
27
switchToSingle = true
28
switchToBurst = true
29
switchToAutomatic = true
30
 
31
ammoGui = Instance.new("ScreenGui")
32
ammoGui.Name = Name
33
local frame = Instance.new("Frame")
34
frame.Name = "Frame"
35
frame.Size = UDim2.new(0, 165, 0, 60)
36
frame.Position = UDim2.new(0, 0, 1, -400)
37
frame.BackgroundColor3 = Color3.new(1, 1, 1)
38
frame.BorderColor3 = Color3.new(0, 0, 0)
39
frame.Parent = ammoGui
40
local label = Instance.new("TextLabel")
41
label.Name = "Weapon"
42
label.Text = "Weapon: " ..Name
43
label.Size = UDim2.new(1, 0, 0, 20)
44
label.Position = UDim2.new(0, 0, 0, 0)
45
label.BackgroundColor3 = Color3.new(1, 0, 0)
46
label.BorderColor3 = Color3.new(0, 0, 0)
47
label.Parent = frame
48
local label = Instance.new("TextLabel")
49
label.Name = "MagazinePrefix"
50
label.Text = "    Magazine:"
51
label.TextXAlignment = "Left"
52
label.Size = UDim2.new(1, 0, 0, 20)
53
label.Position = UDim2.new(0, 0, 0, 20)
54
label.BackgroundColor3 = Color3.new(1, 1, 1)
55
label.BorderColor3 = Color3.new(0, 0, 0)
56
label.Parent = frame
57
local label = Instance.new("TextLabel")
58
label.Name = "Magazine"
59
label.Text = "0/0"
60
label.TextXAlignment = "Right"
61
label.Size = UDim2.new(1, 0, 0, 20)
62
label.Position = UDim2.new(0, -10, 0, 20)
63
label.BackgroundTransparency = 1
64
label.BorderSizePixel = 0
65
label.Parent = frame
66
local label = Instance.new("TextLabel")
67
label.Name = "AmmoPrefix"
68
label.Text = "    Ammunition:"
69
label.TextXAlignment = "Left"
70
label.Size = UDim2.new(1, 0, 0, 20)
71
label.Position = UDim2.new(0, 0, 0, 40)
72
label.BackgroundColor3 = Color3.new(1, 1, 1)
73
label.BorderColor3 = Color3.new(0, 0, 0)
74
label.Parent = frame
75
local label = Instance.new("TextLabel")
76
label.Name = "Ammo"
77
label.Text = "0/0"
78
label.TextXAlignment = "Right"
79
label.Size = UDim2.new(1, 0, 0, 20)
80
label.Position = UDim2.new(0, -10, 0, 40)
81
label.BackgroundTransparency = 1
82
label.BorderSizePixel = 0
83
label.Parent = frame
84
 
85
function updateGui()
86
 if selected == false then return end
87
 if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
88
 if Player.PlayerGui:FindFirstChild(Name) == nil then
89
  ammoGui:Clone().Parent = Player.PlayerGui
90
 end
91
 Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
92
 Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
93
end
94
 
95
function makeParts(format)
96
 local model = Instance.new("Model")
97
 model.Name = Name
98
 local pm = Instance.new("Part")
99
 pm.Name = "Handle"
100
 pm.formFactor = "Symmetric"
101
 pm.Size = Vector3.new(1, 1, 1)
102
 pm.BrickColor = GC
103
 pm.Reflectance = GR
104
 pm.CanCollide = false
105
 pm.Transparency = 1
106
 pm.Locked = true
107
 pm.TopSurface = 0
108
 pm.BottomSurface = 0
109
 pm.Parent = model
110
 local m = Instance.new("BlockMesh")
111
 m.Scale = Vector3.new(0.28, 1.1, 0.19)
112
 m.Offset = Vector3.new(0, -0.25, 0.07)
113
 m.Parent = pm
114
 if format ~= nil then
115
  local w = Instance.new("Weld")
116
  w.Part0 = pm
117
  if format == "RightHand" then
118
   w.Part1 = Player.Character:FindFirstChild("Right Arm")
119
   w.C0 = CFrame.new(0, 1.15, 0.7)
120
   w.C1 = CFrame.new()
121
  elseif format == "RightHolster" then
122
   w.Part1 = Player.Character:FindFirstChild("Torso")
123
   w.C0 = CFrame.new(-0.66, -0.7, 0.3) * CFrame.fromEulerAnglesXYZ(math.rad(-135), math.rad(90), 0)
124
   w.C1 = CFrame.new()
125
   model.Name = Name.. " (Holstered)"
126
  end
127
  w.Parent = pm
128
  model.Parent = Player.Character
129
 end
130
 --[[
131
 sniper1  http://www.roblox.com/asset/?id=1868836
132
 equip    http://www.roblox.com/asset/?id=13510737
133
 fire1     http://www.roblox.com/asset/?id=2760979
134
 fire2    http://www.roblox.com/asset/?id=13510352
135
 fire3    http://www.roblox.com/asset/?id=2692806
136
 fire4    http://www.roblox.com/asset/?id=2691586
137
 fire5    http://www.roblox.com/asset/?id=2920959
138
 fire6    http://www.roblox.com/asset/?id=2697431
139
 fire7    http://www.roblox.com/asset/?id=2920959
140
 reload1   http://www.roblox.com/asset/?id=2691591
141
 reload2   http://www.roblox.com/asset/?id=2697432
142
 reload3  http://www.roblox.com/asset/?id=2920960
143
 reload4  http://www.roblox.com/asset/?id=2761842
144
 shotgun1 http://www.roblox.com/asset/?id=2697294
145
 --]]
146
 local s = Instance.new("Sound")
147
 s.Name = "Fire"
148
 s.SoundId = "http://www.roblox.com/asset/?id=1868836"
149
 s.Volume = 1
150
 s.Pitch = 1
151
 s.Looped = false
152
 s.Parent = pm
153
 local s = Instance.new("Sound")
154
 s.Name = "Fire2"
155
 s.SoundId = "http://roblox.com/asset/?id=10209803"
156
 s.Volume = 1
157
 s.Pitch = 1.4
158
 s.Looped = false
159
 s.Parent = pm
160
 local s = Instance.new("Sound")
161
 s.Name = "Equip"
162
 s.SoundId = "http://www.roblox.com/asset/?id=10209881"
163
 s.Volume = 1
164
 s.Pitch = 0.6
165
 s.Looped = false
166
 s.Parent = pm
167
 local s = Instance.new("Sound")
168
 s.Name = "Reload"
169
 s.SoundId = "http://www.roblox.com/asset/?id=2761842"
170
 s.Volume = 1
171
 s.Pitch = 1.2
172
 s.Looped = false
173
 s.Parent = pm
174
 local s = Instance.new("Sound")
175
 s.Name = "Empty"
176
 s.SoundId = "http://www.roblox.com/asset/?id=2697295"
177
 s.Volume = 1
178
 s.Pitch = 5
179
 s.Looped = false
180
 s.Parent = pm
181
 local s = Instance.new("Sound")
182
 s.Name = "Switch"
183
 s.SoundId = "http://www.roblox.com/asset/?id=2697295"
184
 s.Volume = 1
185
 s.Pitch = 10
186
 s.Looped = false
187
 s.Parent = pm
188
 local p = Instance.new("Part")
189
 p.Name = "ShellOut"
190
 p.formFactor = "Custom"
191
 p.Size = Vector3.new(0.2, 0.2, 0.2)
192
 p.Transparency = 1
193
 p.Locked = true
194
 p.CanCollide = false
195
 p.TopSurface = 0
196
 p.BottomSurface = 0
197
 p.Parent = model
198
 local w = Instance.new("Weld")
199
 w.Part0 = p
200
 w.Part1 = pm
201
 w.C0 = CFrame.new(-0.06, 0.62, -0.06) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
202
 w.C1 = CFrame.new()
203
 w.Parent = p--]]
204
 local p = Instance.new("Part")
205
 p.Name = "Grip"
206
 p.formFactor = "Symmetric"
207
 p.Size = Vector3.new(1, 1, 1)
208
 p.BrickColor = GC
209
 p.Reflectance = GR
210
 p.CanCollide = false
211
 p.Locked = true
212
 p.TopSurface = 0
213
 p.BottomSurface = 0
214
 p.Parent = model
215
 local m = Instance.new("BlockMesh")
216
 m.Scale = Vector3.new(0.3, 0.38, 0.8)
217
 m.Parent = p
218
 local w = Instance.new("Weld")
219
 w.Part0 = p
220
 w.Part1 = pm
221
 w.C0 = CFrame.new(0, -0.15, -0.5) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
222
 w.C1 = CFrame.new()
223
 w.Parent = p
224
 local p = Instance.new("Part")
225
 p.Name = "GripWood"
226
 p.formFactor = "Symmetric"
227
 p.Size = Vector3.new(1, 1, 1)
228
 p.BrickColor = DC
229
 p.Reflectance = MR
230
 p.CanCollide = false
231
 p.Locked = true
232
 p.TopSurface = 0
233
 p.BottomSurface = 0
234
 p.Parent = model
235
 local m = Instance.new("SpecialMesh")
236
 m.MeshType = "Brick"
237
 m.Scale = Vector3.new(0.36, 0.36, 0.6)
238
 m.Parent = p
239
 local w = Instance.new("Weld")
240
 w.Part0 = p
241
 w.Part1 = pm
242
 w.C0 = CFrame.new(0, -0.15, -0.56) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
243
 w.C1 = CFrame.new()
244
 w.Parent = p--]]
245
 local p = Instance.new("Part")
246
 p.Name = "Magazine"
247
 p.formFactor = "Symmetric"
248
 p.Size = Vector3.new(1, 1, 1)
249
 p.BrickColor = DC
250
 p.Reflectance = MR
251
 p.CanCollide = false
252
 p.Locked = true
253
 p.TopSurface = 0
254
 p.BottomSurface = 0
255
 p.Parent = model
256
 local m = Instance.new("BlockMesh")
257
 m.Scale = Vector3.new(0.25, 0.5, 0.5)
258
 m.Parent = p
259
 local w = Instance.new("Weld")
260
 w.Part0 = p
261
 w.Part1 = pm
262
 w.C0 = CFrame.new(0, 0.5, -0.24)
263
 w.C1 = CFrame.new()
264
 w.Parent = p
265
 local p = Instance.new("Part")
266
 p.Name = "Trigger Housing"
267
 p.formFactor = "Symmetric"
268
 p.Size = Vector3.new(1, 1, 1)
269
 p.BrickColor = MC
270
 p.Reflectance = MR
271
 p.CanCollide = false
272
 p.Locked = true
273
 p.TopSurface = 0
274
 p.BottomSurface = 0
275
 p.Parent = model
276
 local m = Instance.new("BlockMesh")
277
 m.Scale = Vector3.new(0.2, 0.4, 0.04)
278
 m.Parent = p
279
 local w = Instance.new("Weld")
280
 w.Part0 = p
281
 w.Part1 = pm
282
 w.C0 = CFrame.new(0, 0.1, -0.36)
283
 w.C1 = CFrame.new()
284
 w.Parent = p
285
 local p = Instance.new("Part")
286
 p.Name = "Trigger"
287
 p.formFactor = "Symmetric"
288
 p.Size = Vector3.new(1, 1, 1)
289
 p.BrickColor = BrickColor.new("Dark stone grey")
290
 p.Reflectance = MR
291
 p.CanCollide = false
292
 p.Locked = true
293
 p.TopSurface = 0
294
 p.BottomSurface = 0
295
 p.Parent = model
296
 local m = Instance.new("BlockMesh")
297
 m.Scale = Vector3.new(0.18, 0.18, 0.18)
298
 m.Parent = p
299
 local w = Instance.new("Weld")
300
 w.Part0 = p
301
 w.Part1 = pm
302
 w.C0 = CFrame.new(0, 0.02, -0.25)
303
 w.C1 = CFrame.new()
304
 w.Parent = p
305
 local p = Instance.new("Part")
306
 p.Name = "Body1" --------------
307
 p.CanCollide = false
308
 p.formFactor = "Symmetric"
309
 p.Size = Vector3.new(1, 1, 1)
310
 p.BrickColor = GC
311
 p.Reflectance = GR
312
 p.Locked = true
313
 p.TopSurface = 0
314
 p.BottomSurface = 0
315
 p.Parent = model
316
 local m = Instance.new("BlockMesh")
317
 m.Scale = Vector3.new(0.3, 2, 0.38)
318
 m.Parent = p
319
 local w = Instance.new("Weld")
320
 w.Part0 = p
321
 w.Part1 = pm
322
 w.C0 = CFrame.new(0, 1.2, -0.12)
323
 w.C1 = CFrame.new()
324
 w.Parent = p
325
 local p = Instance.new("Part")
326
 p.Name = "Body2"
327
 p.CanCollide = false
328
 p.formFactor = "Symmetric"
329
 p.Size = Vector3.new(1, 1, 1)
330
 p.BrickColor = DC
331
 p.Reflectance = MR
332
 p.Locked = true
333
 p.TopSurface = 0
334
 p.BottomSurface = 0
335
 p.Parent = model
336
 local m = Instance.new("SpecialMesh")
337
 m.MeshType = "Brick"
338
 m.Scale = Vector3.new(0.32, 1.4, 0.2)
339
 m.Parent = p
340
 local w = Instance.new("Weld")
341
 w.Part0 = p
342
 w.Part1 = pm
343
 w.C0 = CFrame.new(0, 1.48, -0.08)
344
 w.C1 = CFrame.new()
345
 w.Parent = p
346
 local p = Instance.new("Part")
347
 p.Name = "GripAngle1"
348
 p.CanCollide = false
349
 p.formFactor = "Symmetric"
350
 p.Size = Vector3.new(1, 1, 1)
351
 p.BrickColor = GC
352
 p.Reflectance = GR
353
 p.Locked = true
354
 p.TopSurface = 0
355
 p.BottomSurface = 0
356
 p.Parent = model
357
 local m = Instance.new("SpecialMesh")
358
 m.MeshType = "Wedge"
359
 m.Scale = Vector3.new(0.3, 0.14, 0.6)
360
 m.Parent = p
361
 local w = Instance.new("Weld")
362
 w.Part0 = p
363
 w.Part1 = pm
364
 w.C0 = CFrame.new(0, -0.38, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
365
 w.C1 = CFrame.new()
366
 w.Parent = p
367
 local p = Instance.new("Part")
368
 p.Name = "GripAngle2"
369
 p.CanCollide = false
370
 p.formFactor = "Symmetric"
371
 p.Size = Vector3.new(1, 1, 1)
372
 p.BrickColor = GC
373
 p.Reflectance = GR
374
 p.Locked = true
375
 p.TopSurface = 0
376
 p.BottomSurface = 0
377
 p.Parent = model
378
 local m = Instance.new("SpecialMesh")
379
 m.MeshType = "Wedge"
380
 m.Scale = Vector3.new(0.3, 0.06, 0.8)
381
 m.Parent = p
382
 local w = Instance.new("Weld")
383
 w.Part0 = p
384
 w.Part1 = pm
385
 w.C0 = CFrame.new(0, -0.34, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
386
 w.C1 = CFrame.new()
387
 w.Parent = p
388
 local p = Instance.new("Part")
389
 p.Name = "GripTrigHous"
390
 p.formFactor = "Symmetric"
391
 p.Size = Vector3.new(1, 1, 1)
392
 p.BrickColor = GC
393
 p.Reflectance = GR
394
 p.CanCollide = false
395
 p.Locked = true
396
 p.TopSurface = 0
397
 p.BottomSurface = 0
398
 p.Parent = model
399
 local m = Instance.new("BlockMesh")
400
 m.Scale = Vector3.new(0.3, 0.4, 0.1)
401
 m.Parent = p
402
 local w = Instance.new("Weld")
403
 w.Part0 = p
404
 w.Part1 = pm
405
 w.C0 = CFrame.new(0, 0, -0.4)
406
 w.C1 = CFrame.new()
407
 w.Parent = p
408
 local p = Instance.new("Part")
409
 p.Name = "GripCover"
410
 p.formFactor = "Symmetric"
411
 p.Size = Vector3.new(1, 1, 1)
412
 p.BrickColor = GC
413
 p.Reflectance = GR
414
 p.CanCollide = false
415
 p.Locked = true
416
 p.TopSurface = 0
417
 p.BottomSurface = 0
418
 p.Parent = model
419
 local m = Instance.new("BlockMesh")
420
 m.Scale = Vector3.new(0.3, 1, 0.3)
421
 m.Parent = p
422
 local w = Instance.new("Weld")
423
 w.Part0 = p
424
 w.Part1 = pm
425
 w.C0 = CFrame.new(0, 0.1, -0.08)
426
 w.C1 = CFrame.new()
427
 w.Parent = p
428
 local p = Instance.new("Part")
429
 p.Name = "BoltBlock" --------------
430
 p.CanCollide = false
431
 p.formFactor = "Symmetric"
432
 p.Size = Vector3.new(1, 1, 1)
433
 p.BrickColor = DC
434
 p.Reflectance = MR
435
 p.Locked = true
436
 p.TopSurface = 0
437
 p.BottomSurface = 0
438
 p.Parent = model
439
 local m = Instance.new("SpecialMesh")
440
 m.MeshType = "Brick"
441
 m.Scale = Vector3.new(0.28, 1, 0.3)
442
 m.Parent = p
443
 local w = Instance.new("Weld")
444
 w.Part0 = p
445
 w.Part1 = pm
446
 w.C0 = CFrame.new(0, 0.3, 0.06)
447
 w.C1 = CFrame.new()
448
 w.Parent = p
449
 local p = Instance.new("Part")
450
 p.Name = "BoltShaftI"
451
 p.formFactor = "Symmetric"
452
 p.Size = Vector3.new(1, 1, 1)
453
 p.BrickColor = BC
454
 p.Reflectance = MR
455
 p.Transparency = 0
456
 p.CanCollide = false
457
 p.Locked = true
458
 p.TopSurface = 0
459
 p.BottomSurface = 0
460
 p.Parent = model
461
 local m = Instance.new("SpecialMesh")
462
 m.MeshType = "Brick"
463
 m.Scale = Vector3.new(0.26, 1, 0.26)
464
 m.Parent = p
465
 local w = Instance.new("Weld")
466
 w.Part0 = p
467
 w.Part1 = pm
468
 w.C0 = CFrame.new(0, 0.06, 0.06)
469
 w.C1 = CFrame.new()
470
 w.Parent = p
471
 local p = Instance.new("Part")
472
 p.Name = "BoltKnobI"
473
 p.CanCollide = false
474
 p.formFactor = "Symmetric"
475
 p.Size = Vector3.new(1, 1, 1)
476
 p.BrickColor = BC
477
 p.Reflectance = MR
478
 p.Transparency = 0
479
 p.Locked = true
480
 p.TopSurface = 0
481
 p.BottomSurface = 0
482
 p.Parent = model
483
 local m = Instance.new("SpecialMesh")
484
 m.MeshType = "Brick"
485
 m.Scale = Vector3.new(0.3, 0.14, 0.14)
486
 m.Parent = p
487
 local w = Instance.new("Weld")
488
 w.Part0 = p
489
 w.Part1 = pm
490
 w.C0 = CFrame.new(0.2, -0.3, 0.06)
491
 w.C1 = CFrame.new()
492
 w.Parent = p
493
 local p = Instance.new("Part")
494
 p.Name = "BoltShaftO"
495
 p.formFactor = "Symmetric"
496
 p.Size = Vector3.new(1, 1, 1)
497
 p.BrickColor = BC
498
 p.Reflectance = MR
499
 p.Transparency = 1
500
 p.CanCollide = false
501
 p.Locked = true
502
 p.TopSurface = 0
503
 p.BottomSurface = 0
504
 p.Parent = model
505
 local m = Instance.new("SpecialMesh")
506
 m.MeshType = "Brick"
507
 m.Scale = Vector3.new(0.26, 1, 0.26)
508
 m.Parent = p
509
 local w = Instance.new("Weld")
510
 w.Part0 = p
511
 w.Part1 = pm
512
 w.C0 = CFrame.new(0, -0.06, 0.06)
513
 w.C1 = CFrame.new()
514
 w.Parent = p
515
 local p = Instance.new("Part")
516
 p.Name = "BoltKnobO"
517
 p.CanCollide = false
518
 p.formFactor = "Symmetric"
519
 p.Size = Vector3.new(1, 1, 1)
520
 p.BrickColor = BC
521
 p.Reflectance = MR
522
 p.Transparency = 1
523
 p.Locked = true
524
 p.TopSurface = 0
525
 p.BottomSurface = 0
526
 p.Parent = model
527
 local m = Instance.new("SpecialMesh")
528
 m.MeshType = "Brick"
529
 m.Scale = Vector3.new(0.3, 0.14, 0.14)
530
 m.Parent = p
531
 local w = Instance.new("Weld")
532
 w.Part0 = p
533
 w.Part1 = pm
534
 w.C0 = CFrame.new(0.2, -0.4, 0.06)
535
 w.C1 = CFrame.new()
536
 w.Parent = p
537
 local p = Instance.new("Part")
538
 p.Name = "Barrel 1"
539
 p.formFactor = "Symmetric"
540
 p.Size = Vector3.new(1, 1, 1)
541
 p.BrickColor = DC
542
 p.Reflectance = MR
543
 p.CanCollide = false
544
 p.Locked = true
545
 p.TopSurface = 0
546
 p.BottomSurface = 0
547
 p.Parent = model
548
 local m = Instance.new("CylinderMesh")
549
 m.Scale = Vector3.new(0.2, 4, 0.2)
550
 m.Parent = p
551
 local w = Instance.new("Weld")
552
 w.Part0 = p
553
 w.Part1 = pm
554
 w.C0 = CFrame.new(0, 2.6, 0.06)
555
 w.C1 = CFrame.new()
556
 w.Parent = p
557
 local p = Instance.new("Part")
558
 p.Name = "Muzzle"
559
 p.formFactor = "Symmetric"
560
 p.Size = Vector3.new(1, 1, 1)
561
 p.BrickColor = DC
562
 p.Reflectance = MR
563
 p.CanCollide = false
564
 p.Locked = true
565
 p.TopSurface = 0
566
 p.BottomSurface = 0
567
 p.Parent = model
568
 local m = Instance.new("CylinderMesh")
569
 m.Scale = Vector3.new(0.24, 0.8, 0.24)
570
 m.Parent = p
571
 local w = Instance.new("Weld")
572
 w.Part0 = p
573
 w.Part1 = pm
574
 w.C0 = CFrame.new(0, 4.2, 0.06)
575
 w.C1 = CFrame.new()
576
 w.Parent = p
577
 local s = Instance.new("Smoke")
578
 s.Enabled = false
579
 s.Name = "Smoke"
580
 s.RiseVelocity = -5
581
 s.Opacity = 0.5
582
 s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
583
 s.Size = 2.4
584
 s.Parent = p
585
 local f = Instance.new("Fire")
586
 f.Enabled = false
587
 f.Name = "Fire"
588
 f.Heat = -20
589
 f.Size = 3.6
590
 f.Parent = p
591
 local p = Instance.new("Part")
592
 p.Name = "MuzzleHole"
593
 p.formFactor = "Symmetric"
594
 p.Size = Vector3.new(1, 1, 1)
595
 p.BrickColor = BrickColor.new("Really black")
596
 p.Reflectance = MR
597
 p.CanCollide = false
598
 p.Locked = true
599
 p.TopSurface = 0
600
 p.BottomSurface = 0
601
 p.Parent = model
602
 local m = Instance.new("CylinderMesh")
603
 m.Scale = Vector3.new(0.18, 0.8, 0.18)
604
 m.Parent = p
605
 local w = Instance.new("Weld")
606
 w.Part0 = p
607
 w.Part1 = pm
608
 w.C0 = CFrame.new(0, 4.203, 0.06)
609
 w.C1 = CFrame.new()
610
 w.Parent = p
611
 local p = Instance.new("Part")
612
 p.Name = "Silencer"
613
 p.formFactor = "Symmetric"
614
 p.Size = Vector3.new(1, 1, 1)
615
 p.BrickColor = BrickColor.new("Black")
616
  p.CanCollide = false
617
 p.Transparency = 1
618
 p.Locked = true
619
 p.TopSurface = 0
620
 p.BottomSurface = 0
621
 p.Parent = model
622
 local m = Instance.new("CylinderMesh")
623
 m.Scale = Vector3.new(0.28, 3, 0.28)
624
 m.Parent = p
625
 local w = Instance.new("Weld")
626
 w.Part0 = p
627
 w.Part1 = pm
628
 w.C0 = CFrame.new(0, 4, 0.06)
629
 w.C1 = CFrame.new()
630
 w.Parent = p
631
 local p = Instance.new("Part")
632
 p.Name = "GripStock"
633
 p.formFactor = "Symmetric"
634
 p.Size = Vector3.new(1, 1, 1)
635
 p.BrickColor = GC
636
 p.Reflectance = GR
637
 p.CanCollide = false
638
 p.Locked = true
639
 p.TopSurface = 0
640
 p.BottomSurface = 0
641
 p.Parent = model
642
 local m = Instance.new("BlockMesh")
643
 m.Scale = Vector3.new(0.3, 0.8, 0.3)
644
 m.Parent = p
645
 local w = Instance.new("Weld")
646
 w.Part0 = p
647
 w.Part1 = pm
648
 w.C0 = CFrame.new(0, -0.6, -0.75) * CFrame.fromEulerAnglesXYZ(math.rad(20), 0, 0)
649
 w.C1 = CFrame.new()
650
 w.Parent = p
651
 local p = Instance.new("Part") -- Standard Stock
652
 p.Name = "StockT"
653
 p.CanCollide = false
654
 p.formFactor = "Symmetric"
655
 p.Size = Vector3.new(1, 1, 1)
656
 p.BrickColor = GC
657
 p.Reflectance = GR
658
 p.Locked = true
659
 p.TopSurface = 0
660
 p.BottomSurface = 0
661
 p.Parent = model
662
 local m = Instance.new("BlockMesh")
663
 m.Scale = Vector3.new(0.3, 1.4, 0.25)
664
 m.Parent = p
665
 local w = Instance.new("Weld")
666
 w.Part0 = p
667
 w.Part1 = pm
668
 w.C0 = CFrame.new(0, -0.6, -0.1)
669
 w.C1 = CFrame.new()
670
 w.Parent = p
671
 local p = Instance.new("Part")
672
 p.Name = "CheekRest" --------------
673
 p.CanCollide = false
674
 p.formFactor = "Symmetric"
675
 p.Size = Vector3.new(1, 1, 1)
676
 p.BrickColor = DC
677
 p.Reflectance = MR
678
 p.Locked = true
679
 p.TopSurface = 0
680
 p.BottomSurface = 0
681
 p.Parent = model
682
 local m = Instance.new("SpecialMesh")
683
 m.MeshType = "Brick"
684
 m.Scale = Vector3.new(0.26, 0.6, 0.3)
685
 m.Parent = p
686
 local w = Instance.new("Weld")
687
 w.Part0 = p
688
 w.Part1 = pm
689
 w.C0 = CFrame.new(0, -0.84, -0.04)
690
 w.C1 = CFrame.new()
691
 w.Parent = p
692
 local p = Instance.new("Part")
693
 p.Name = "Stock1"
694
 p.CanCollide = false
695
 p.formFactor = "Symmetric"
696
 p.Size = Vector3.new(1, 1, 1)
697
 p.BrickColor = DC
698
 p.Reflectance = MR
699
 p.Locked = true
700
 p.TopSurface = 0
701
 p.BottomSurface = 0
702
 p.Parent = model
703
 local m = Instance.new("BlockMesh")
704
 m.Scale = Vector3.new(0.34, 0.4, 0.7)
705
 m.Parent = p
706
 local w = Instance.new("Weld")
707
 w.Part0 = p
708
 w.Part1 = pm
709
 w.C0 = CFrame.new(0, -1.38, -0.3) --* CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
710
 w.C1 = CFrame.new()
711
 w.Parent = p
712
 local p = Instance.new("Part")
713
 p.Name = "Stock2"
714
 p.CanCollide = false
715
 p.formFactor = "Symmetric"
716
 p.Size = Vector3.new(1, 1, 1)
717
 p.BrickColor = GC
718
 p.Reflectance = GR
719
 p.Locked = true
720
 p.TopSurface = 0
721
 p.BottomSurface = 0
722
 p.Parent = model
723
 local m = Instance.new("BlockMesh")
724
 m.Scale = Vector3.new(0.3, 0.4, 0.5)
725
 m.Parent = p
726
 local w = Instance.new("Weld")
727
 w.Part0 = p
728
 w.Part1 = pm
729
 w.C0 = CFrame.new(0, -0.38, -1) * CFrame.fromEulerAnglesXYZ(math.rad(270), 0, math.rad(180))
730
 w.C1 = CFrame.new()
731
 w.Parent = p--]]
732
 local p = Instance.new("Part") -------------- SCOPE
733
 p.Name = "Scope Base"
734
 p.formFactor = "Symmetric"
735
 p.CanCollide = false
736
 p.Size = Vector3.new(1, 1, 1)
737
 p.BrickColor = DC
738
 p.Reflectance = MR
739
 p.Locked = true
740
 p.TopSurface = 0
741
 p.BottomSurface = 0
742
 p.Parent = model
743
 local m = Instance.new("BlockMesh")
744
 m.Scale = Vector3.new(0.1, 0.14, 0.4)
745
 m.Parent = p
746
 local w = Instance.new("Weld")
747
 w.Part0 = p
748
 w.Part1 = pm
749
 w.C0 = CFrame.new(0, 0.1, 0.18)
750
 w.C1 = CFrame.new()
751
 w.Parent = p
752
 local p = Instance.new("Part")
753
 p.Name = "Scope Base"
754
 p.formFactor = "Symmetric"
755
 p.CanCollide = false
756
 p.Size = Vector3.new(1, 1, 1)
757
 p.BrickColor = DC
758
 p.Reflectance = MR
759
 p.Locked = true
760
 p.TopSurface = 0
761
 p.BottomSurface = 0
762
 p.Parent = model
763
 local m = Instance.new("BlockMesh")
764
 m.Scale = Vector3.new(0.1, 0.14, 0.4)
765
 m.Parent = p
766
 local w = Instance.new("Weld")
767
 w.Part0 = p
768
 w.Part1 = pm
769
 w.C0 = CFrame.new(0, 0.48, 0.18)
770
 w.C1 = CFrame.new()
771
 w.Parent = p
772
 local p = Instance.new("Part")
773
 p.Name = "Scope End 1" --End = Back
774
 p.CanCollide = false
775
 p.formFactor = "Symmetric"
776
 p.Size = Vector3.new(1, 1, 1)
777
 p.BrickColor = DC
778
 p.Reflectance = MR
779
 p.Locked = true
780
 p.TopSurface = 0
781
 p.BottomSurface = 0
782
 p.Parent = model
783
 local m = Instance.new("CylinderMesh")
784
 m.Scale = Vector3.new(0.24, 0.375, 0.24)
785
 m.Parent = p
786
 local w = Instance.new("Weld")
787
 w.Part0 = p
788
 w.Part1 = pm
789
 w.C0 = CFrame.new(0, -0.2, 0.38)
790
 w.C1 = CFrame.new()
791
 w.Parent = p
792
 local p = Instance.new("Part")
793
 p.Name = "Scope Center 1"
794
 p.CanCollide = false
795
 p.formFactor = "Symmetric"
796
 p.Size = Vector3.new(1, 1, 1)
797
 p.BrickColor = DC
798
 p.Reflectance = MR
799
 p.Locked = true
800
 p.TopSurface = 0
801
 p.BottomSurface = 0
802
 p.Parent = model
803
 local m = Instance.new("CylinderMesh")
804
 m.Scale = Vector3.new(0.2, 0.8, 0.2)
805
 m.Parent = p
806
 local w = Instance.new("Weld")
807
 w.Part0 = p
808
 w.Part1 = pm
809
 w.C0 = CFrame.new(0, 0.3, 0.38)
810
 w.C1 = CFrame.new()
811
 w.Parent = p
812
 local p = Instance.new("Part")
813
 p.Name = "Scope Front 1"
814
 p.CanCollide = false
815
 p.formFactor = "Symmetric"
816
 p.Size = Vector3.new(1, 1, 1)
817
 p.BrickColor = DC
818
 p.Reflectance = MR
819
 p.Locked = true
820
 p.TopSurface = 0
821
 p.BottomSurface = 0
822
 p.Parent = model
823
 local m = Instance.new("CylinderMesh")
824
 m.Scale = Vector3.new(0.28, 0.7, 0.28)
825
 m.Parent = p
826
 local w = Instance.new("Weld")
827
 w.Part0 = p
828
 w.Part1 = pm
829
 w.C0 = CFrame.new(0, 0.94, 0.38)
830
 w.C1 = CFrame.new()
831
 w.Parent = p
832
 local p = Instance.new("Part")
833
 p.Name = "Scope Window F"
834
 p.CanCollide = false
835
 p.formFactor = "Symmetric"
836
 p.Size = Vector3.new(1, 1, 1)
837
 p.BrickColor = BrickColor.new("White")
838
 p.Reflectance = 0.3
839
 p.Locked = true
840
 p.TopSurface = 0
841
 p.BottomSurface = 0
842
 p.Parent = model
843
 local m = Instance.new("CylinderMesh")
844
 m.Scale = Vector3.new(0.27, 0.7, 0.27)
845
 m.Offset = Vector3.new(0, -0.003 ,0)
846
 m.Parent = p
847
 local w = Instance.new("Weld")
848
 w.Part0 = p
849
 w.Part1 = pm
850
 w.C0 = CFrame.new(0, 0.94, 0.38)
851
 w.C1 = CFrame.new()
852
 w.Parent = p
853
 local p = Instance.new("Part")
854
 p.Name = "Scope Window B"
855
 p.CanCollide = false
856
 p.formFactor = "Symmetric"
857
 p.Size = Vector3.new(1, 1, 1)
858
 p.BrickColor = BrickColor.new("White")
859
 p.Reflectance = 0.3
860
 p.Locked = true
861
 p.TopSurface = 0
862
 p.BottomSurface = 0
863
 p.Parent = model
864
 local m = Instance.new("CylinderMesh")
865
 m.Scale = Vector3.new(0.23, 0.375, 0.23)
866
 m.Offset = Vector3.new(0, 0.003 ,0)
867
 m.Parent = p
868
 local w = Instance.new("Weld")
869
 w.Part0 = p
870
 w.Part1 = pm
871
 w.C0 = CFrame.new(0, -0.2, 0.38)
872
 w.C1 = CFrame.new()
873
 w.Parent = p--]]
874
 local p = Instance.new("Part") ---Bipod
875
 p.Name = "BipodM" --------------
876
 p.CanCollide = false
877
 p.formFactor = "Symmetric"
878
 p.Size = Vector3.new(1, 1, 1)
879
 p.BrickColor = DC
880
 p.Reflectance = MR
881
 p.Locked = true
882
 p.TopSurface = 0
883
 p.BottomSurface = 0
884
 p.Parent = model
885
 local m = Instance.new("BlockMesh")
886
 m.Scale = Vector3.new(0.17, 0.25, 0.2)
887
 m.Parent = p
888
 local w = Instance.new("Weld")
889
 w.Part0 = p
890
 w.Part1 = pm
891
 w.C0 = CFrame.new(0, 2, -0.35)
892
 w.C1 = CFrame.new()
893
 w.Parent = p
894
 local p = Instance.new("Part")
895
 p.Name = "BipodArm"
896
 p.formFactor = "Symmetric"
897
 p.Size = Vector3.new(1, 1, 1)
898
 p.CanCollide = false
899
 p.BrickColor = DC
900
 p.Reflectance = MR
901
 p.Locked = true
902
 p.TopSurface = 0
903
 p.BottomSurface = 0
904
 p.Parent = model
905
 local m = Instance.new("CylinderMesh")
906
 m.Scale = Vector3.new(0.15, 1, 0.15)
907
 m.Offset = Vector3.new(0, -0.44 ,0)
908
 m.Parent = p
909
 local w = Instance.new("Weld")
910
 w.Part0 = p
911
 w.Part1 = pm
912
 w.C0 = CFrame.new(-0.09, 2, -0.4)
913
 w.C1 = CFrame.new()
914
 w.Parent = p
915
 local p = Instance.new("Part")
916
 p.Name = "BipodArm"
917
 p.formFactor = "Symmetric"
918
 p.Size = Vector3.new(1, 1, 1)
919
 p.CanCollide = false
920
 p.BrickColor = DC
921
 p.Reflectance = MR
922
 p.Locked = true
923
 p.TopSurface = 0
924
 p.BottomSurface = 0
925
 p.Parent = model
926
 local m = Instance.new("CylinderMesh")
927
 m.Scale = Vector3.new(0.15, 1, 0.15)
928
 m.Offset = Vector3.new(0, -0.44 ,0)
929
 m.Parent = p
930
 local w = Instance.new("Weld")
931
 w.Part0 = p
932
 w.Part1 = pm
933
 w.C0 = CFrame.new(0.09, 2, -0.4)
934
 w.C1 = CFrame.new()
935
 w.Parent = p--]]
936
 return model
937
end
938
 
939
function removeParts(format)
940
 if format == "RightHand" then
941
  pcall(function() Player.Character[Name]:Remove() end)
942
 elseif format == "LeftHand" then
943
  pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
944
 elseif format == "RightHolster" then
945
  pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
946
 elseif format == "LeftHolster" then
947
  pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
948
 end
949
end
950
 
951
function SetAngle(Joint, Angle, Character)
952
 if Character == nil then return false end
953
 local Joints = {
954
  Character.Torso:FindFirstChild("Right Shoulder 2"),
955
  Character.Torso:FindFirstChild("Left Shoulder 2"),
956
  Character.Torso:FindFirstChild("Right Hip 2"),
957
  Character.Torso:FindFirstChild("Left Hip 2")
958
 }
959
 if Joints[Joint] == nil then return false end
960
 if Joint == 1 or Joint == 3 then
961
  Joints[Joint].DesiredAngle = Angle
962
 end
963
 if Joint == 2 or Joint == 4 then
964
  Joints[Joint].DesiredAngle = -Angle
965
 end
966
end
967
 
968
function ForceAngle(Joint, Angle, Character)
969
 if Character == nil then return false end
970
 local Joints = {
971
  Character.Torso:FindFirstChild("Right Shoulder 2"),
972
  Character.Torso:FindFirstChild("Left Shoulder 2"),
973
  Character.Torso:FindFirstChild("Right Hip 2"),
974
  Character.Torso:FindFirstChild("Left Hip 2")
975
 }
976
 if Joints[Joint] == nil then return false end
977
 if Joint == 1 or Joint == 3 then
978
  Joints[Joint].DesiredAngle = Angle
979
  Joints[Joint].CurrentAngle = Angle
980
 end
981
 if Joint == 2 or Joint == 4 then
982
  Joints[Joint].DesiredAngle = -Angle
983
  Joints[Joint].CurrentAngle = -Angle
984
 end
985
end
986
 
987
function SetSpeed(Joint, Speed, Character)
988
 if Character == nil then return false end
989
 local Joints = {
990
  Character.Torso:FindFirstChild("Right Shoulder 2"),
991
  Character.Torso:FindFirstChild("Left Shoulder 2"),
992
  Character.Torso:FindFirstChild("Right Hip 2"),
993
  Character.Torso:FindFirstChild("Left Hip 2")
994
 }
995
 if Joints[Joint] == nil then return false end
996
 Joints[Joint].MaxVelocity = Speed
997
end
998
 
999
function DisableLimb(Limb, Character)
1000
 if Character == nil then return false end
1001
 if Character:FindFirstChild("Torso") == nil then return false end
1002
 local Joints = {
1003
  Character.Torso:FindFirstChild("Right Shoulder"),
1004
  Character.Torso:FindFirstChild("Left Shoulder"),
1005
  Character.Torso:FindFirstChild("Right Hip"),
1006
  Character.Torso:FindFirstChild("Left Hip")
1007
 }
1008
 local Limbs = {
1009
  Character:FindFirstChild("Right Arm"),
1010
  Character:FindFirstChild("Left Arm"),
1011
  Character:FindFirstChild("Right Leg"),
1012
  Character:FindFirstChild("Left Leg")
1013
 }
1014
 if Joints[Limb] == nil then return false end
1015
 if Limbs[Limb] == nil then return false end
1016
 local Joint = Instance.new("Motor")
1017
 Joint.Parent = Character.Torso
1018
 Joint.Part0 = Character.Torso
1019
 Joint.Part1 = Limbs[Limb]
1020
 if Limb == 1 then
1021
  Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1022
  Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1023
  Joint.Name = "Right Shoulder 2"
1024
 elseif Limb == 2 then
1025
  Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1026
  Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1027
  Joint.Name = "Left Shoulder 2"
1028
 elseif Limb == 3 then
1029
  Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1030
  Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1031
  Joint.Name = "Right Hip 2"
1032
 elseif Limb == 4 then
1033
  Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1034
  Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1035
  Joint.Name = "Left Hip 2"
1036
 end
1037
 Joint.MaxVelocity = Joints[Limb].MaxVelocity
1038
 Joint.CurrentAngle = Joints[Limb].CurrentAngle
1039
 Joint.DesiredAngle = Joints[Limb].DesiredAngle
1040
 Joints[Limb]:Remove()
1041
end
1042
 
1043
function ResetLimbCFrame(Limb, Character)
1044
 if Character == nil then return false end
1045
 if Character.Parent == nil then return false end
1046
 if Character:FindFirstChild("Torso") == nil then return false end
1047
 local Joints = {
1048
  Character.Torso:FindFirstChild("Right Shoulder 2"),
1049
  Character.Torso:FindFirstChild("Left Shoulder 2"),
1050
  Character.Torso:FindFirstChild("Right Hip 2"),
1051
  Character.Torso:FindFirstChild("Left Hip 2")
1052
 }
1053
 local Limbs = {
1054
  Character:FindFirstChild("Right Arm"),
1055
  Character:FindFirstChild("Left Arm"),
1056
  Character:FindFirstChild("Right Leg"),
1057
  Character:FindFirstChild("Left Leg")
1058
 }
1059
 if Joints[Limb] == nil then return false end
1060
 if Limbs[Limb] == nil then return false end
1061
 if Limb == 1 then
1062
  Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1063
  Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1064
 elseif Limb == 2 then
1065
  Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1066
  Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1067
 elseif Limb == 3 then
1068
  Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1069
  Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1070
 elseif Limb == 4 then
1071
  Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1072
  Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1073
 end
1074
end
1075
 
1076
function EnableLimb(Limb, Character)
1077
 if Character == nil then return false end
1078
 if Character:FindFirstChild("Torso") == nil then return false end
1079
 local Joints = {
1080
  Character.Torso:FindFirstChild("Right Shoulder 2"),
1081
  Character.Torso:FindFirstChild("Left Shoulder 2"),
1082
  Character.Torso:FindFirstChild("Right Hip 2"),
1083
  Character.Torso:FindFirstChild("Left Hip 2")
1084
 }
1085
 local Limbs = {
1086
  Character:FindFirstChild("Right Arm"),
1087
  Character:FindFirstChild("Left Arm"),
1088
  Character:FindFirstChild("Right Leg"),
1089
  Character:FindFirstChild("Left Leg")
1090
 }
1091
 if Joints[Limb] == nil then return false end
1092
 if Limbs[Limb] == nil then return false end
1093
 if Limb == 1 then
1094
  Joints[Limb].Name = "Right Shoulder"
1095
 elseif Limb == 2 then
1096
  Joints[Limb].Name = "Left Shoulder"
1097
 elseif Limb == 3 then
1098
  Joints[Limb].Name = "Right Hip"
1099
 elseif Limb == 4 then
1100
  Joints[Limb].Name = "Left Hip"
1101
 end
1102
 Animate = Character:FindFirstChild("Animate")
1103
 if Animate == nil then return false end
1104
 Animate = Animate:Clone()
1105
 Character.Animate:Remove()
1106
 Animate.Parent = Character
1107
end
1108
 
1109
function playAnimation(format, mouse)
1110
 if format == "equip" then
1111
  EnableLimb(1, Player.Character)
1112
  EnableLimb(2, Player.Character)
1113
  DisableLimb(2, Player.Character)
1114
  SetSpeed(2, 0.1, Player.Character)
1115
  ForceAngle(2, 0, Player.Character)
1116
  SetAngle(2, math.rad(-50), Player.Character)
1117
  wait(0.25)
1118
  if Player.Character:FindFirstChild(Name.. " (Holstered)") == nil then makeParts("RightHolster") end
1119
  Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
1120
  local w = Instance.new("Weld")
1121
  w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
1122
  w.Part1 = Player.Character:FindFirstChild("Left Arm")
1123
  w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1124
  w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
1125
  w.Parent = Player.Character[Name.. " (Holstered)"].Handle
1126
  SetAngle(2, 0, Player.Character)
1127
  wait(0.25)
1128
  DisableLimb(1, Player.Character)
1129
  ForceAngle(1, 0, Player.Character)
1130
  delay(0.3, function() Player.Character[Name.. " (Holstered)"].Handle.Equip:Play() end)
1131
  for i = 0, 1, 0.05 do
1132
   if Player.Character:FindFirstChild("Torso") ~= nil then
1133
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1134
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1135
     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)
1136
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1137
     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)
1138
     w.C0 = CFrame.new(0.5 - (i * (0.5 * 2)), -0.25 - (i * (-0.25 * 2)), -0.75 - (i * (-0.75 * 2))) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (i * 180)), 0)
1139
     w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
1140
     wait()
1141
    else return false end
1142
   else return false end
1143
  end
1144
  return playAnimation("hold")
1145
 end
1146
if format == "unequip" then
1147
  Player.Character[Name].Handle.Weld:Remove()
1148
  local w = Instance.new("Weld")
1149
  w.Part0 = Player.Character[Name].Handle
1150
  w.Part1 = Player.Character:FindFirstChild("Left Arm")
1151
  w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1152
  w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
1153
  w.Parent = Player.Character[Name].Handle
1154
  for i = 1, 0, -0.05 do
1155
   if Player.Character:FindFirstChild("Torso") ~= nil then
1156
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1157
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1158
     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)
1159
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1160
     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)
1161
     w.C0 = CFrame.new(0.5 - (i * (0.5 * 2)), -0.25 - (i * (-0.25 * 2)), -0.75 - (i * (-0.75 * 2))) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 + (i * 180)), 0)
1162
     w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50 - i * 25), 0, -math.rad(i * 15))
1163
     wait()
1164
    else return false end
1165
   else return false end
1166
  end
1167
  w.C0 = CFrame.new(0.5, -0.25, -0.75) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
1168
  w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(math.rad(50), 0, 0)
1169
  ResetLimbCFrame(1, Player.Character)
1170
  ResetLimbCFrame(2, Player.Character)
1171
  EnableLimb(1, Player.Character)
1172
  EnableLimb(2, Player.Character)
1173
  DisableLimb(2, Player.Character)
1174
  SetSpeed(2, 0.1, Player.Character)
1175
  ForceAngle(2, 0, Player.Character)
1176
  SetAngle(2, math.rad(-50), Player.Character)
1177
  wait(0.25)
1178
  SetAngle(2, 0, Player.Character)
1179
  removeParts("RightHand")
1180
  makeParts("RightHolster")
1181
  wait(0.25)
1182
  makeParts("RightHand")
1183
  removeParts("RightHolster")
1184
  return true
1185
 end
1186
 if format == "hold" then
1187
  if Player.Character:FindFirstChild("Torso") ~= nil then
1188
   if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1189
    Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1190
    Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10), math.rad(-90))
1191
    Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1192
    Player.Character.Torso["Right Shoulder 2"].C1 =  CFrame.new(-0.9, -0.35, 0.51) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
1193
   else return false end
1194
  else return false end
1195
 end
1196
 if format == "reload" then
1197
  Player.Character[Name].Handle.Equip:Play()
1198
  for i = 0, 10, 5 do
1199
   if Player.Character:FindFirstChild("Torso") ~= nil then
1200
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1201
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1202
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
1203
     wait()
1204
    else return false end
1205
   else return false end
1206
  end
1207
  wait(0.1)
1208
  Player.Character[Name].BoltKnobI.Transparency = 1
1209
  Player.Character[Name].BoltShaftI.Transparency = 1
1210
  Player.Character[Name].BoltShaftO.Transparency = 0
1211
  Player.Character[Name].BoltKnobO.Transparency = 0
1212
  for i = 0, 10, 1.5 do
1213
   if Player.Character:FindFirstChild("Torso") ~= nil then
1214
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1215
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1216
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
1217
     wait()
1218
    else return false end
1219
   else return false end
1220
  end
1221
  Player.Character[Name].Handle.Equip:Stop()
1222
  Player.Character[Name].Handle.Reload:Play()
1223
  Player.Character[Name].Magazine.Transparency = 1
1224
  magazineDrop = Player.Character[Name].Magazine:Clone()
1225
  magazineDrop.Transparency = 0
1226
  magazineDrop.CanCollide = true
1227
  magazineDrop.Parent = game.Workspace
1228
  coroutine.resume(coroutine.create(function(part) wait(4.5) for i = 0, 1, 0.1 do part.Transparency = i wait() end part:Remove() end), magazineDrop)
1229
  delay(0.1, function() magazineDrop.CanCollide = true end)
1230
  for i = 0, 25, 5 do
1231
   if Player.Character:FindFirstChild("Torso") ~= nil then
1232
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1233
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1234
     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))
1235
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1236
     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)
1237
     wait()
1238
    else return false end
1239
   else return false end
1240
  end
1241
  magazineNew = Player.Character[Name].Magazine:Clone()
1242
  magazineNew.Name = "New Magazine"
1243
  magazineNew.Transparency = 0
1244
  magazineNew.Parent = Player.Character[Name]
1245
  local w = Instance.new("Weld")
1246
  w.Part0 = magazineNew
1247
  w.Part1 = Player.Character:FindFirstChild("Left Arm")
1248
  w.C0 = CFrame.new(0, 1.1, 0)
1249
  w.C1 = CFrame.new() * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
1250
  w.Parent = magazineNew
1251
  wait(0.2)
1252
  for i = 25, 0, -5 do
1253
   if Player.Character:FindFirstChild("Torso") ~= nil then
1254
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1255
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1256
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 + ((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))
1257
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1258
     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)
1259
     wait()
1260
    else return false end
1261
   else return false end
1262
  end
1263
  Player.Character[Name].Magazine.Transparency = 0
1264
  Player.Character[Name]["New Magazine"]:Remove()
1265
  wait(0.8)
1266
  Player.Character[Name].Handle.Reload:Stop()
1267
  Player.Character[Name].Handle.Equip:Play()
1268
  for i = 10, 0, -1.5 do
1269
   if Player.Character:FindFirstChild("Torso") ~= nil then
1270
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1271
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1272
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
1273
     wait()
1274
    else return false end
1275
   else return false end
1276
  end
1277
  Player.Character[Name].BoltKnobI.Transparency = 0
1278
  Player.Character[Name].BoltShaftI.Transparency = 0
1279
  Player.Character[Name].BoltShaftO.Transparency = 1
1280
  Player.Character[Name].BoltKnobO.Transparency = 1
1281
  for i = 10, 0, -5 do
1282
   if Player.Character:FindFirstChild("Torso") ~= nil then
1283
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1284
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1285
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
1286
     wait()
1287
    else return false end
1288
   else return false end
1289
  end
1290
  for i = 10, 0, -5 do
1291
   if Player.Character:FindFirstChild("Torso") ~= nil then
1292
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1293
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1294
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
1295
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1296
     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)
1297
     wait()
1298
    else return false end
1299
   else return false end
1300
  end
1301
  Player.Character[Name].Handle.Equip:Stop()
1302
 end
1303
 if format == "fire" then
1304
  if Player.Character[Name]:FindFirstChild("Handle") ~= nil then
1305
   if silenced then
1306
    Player.Character[Name].Handle.Fire:Stop()
1307
    Player.Character[Name].Handle.Fire.Volume = math.random(3, 8) / 10
1308
    Player.Character[Name].Handle.Fire.Pitch = math.random(20, 25) / 10
1309
    Player.Character[Name].Handle.Fire:Play()
1310
    --coroutine.resume(coroutine.create(function() for i =  0.8, 0, -0.075 do Player.Character[Name].Handle.Fire.Volume = i wait() end Player.Character[Name].Handle.Fire.Volume = 0 end))
1311
    CamShake(10, 2000)
1312
   else
1313
    Player.Character[Name].Handle.Fire:Stop()
1314
    Player.Character[Name].Handle.Fire.Volume = math.random(9, 10) / 10
1315
    Player.Character[Name].Handle.Fire.Pitch = 1
1316
    Player.Character[Name].Handle.Fire:Play()
1317
    --Player.Character[Name].Handle.Fire2:Play()
1318
    --coroutine.resume(coroutine.create(function() for i =  0.8, 0, -0.075 do Player.Character[Name].Handle.Fire.Volume = i wait() end Player.Character[Name].Handle.Fire.Volume = 0 end))
1319
    CamShake(10, 2000)
1320
   end
1321
  else return false end
1322
  if Player.Character[Name]:FindFirstChild("Muzzle") ~= nil then
1323
   coroutine.resume(coroutine.create(function() Player.Character[Name].Muzzle.Smoke.Enabled = true Player.Character[Name].Muzzle.Fire.Enabled = true wait(0.1) Player.Character[Name].Muzzle.Smoke.Enabled = false Player.Character[Name].Muzzle.Fire.Enabled = false end))
1324
  else return false end
1325
  for i = 0, 10, 5 do
1326
   if Player.Character:FindFirstChild("Torso") ~= nil then
1327
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1328
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1329
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
1330
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1331
     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)
1332
     wait()
1333
    else return false end
1334
   else return false end
1335
  end
1336
  --[[for i = 10, 0, -5 do
1337
   if Player.Character:FindFirstChild("Torso") ~= nil then
1338
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1339
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1340
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
1341
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1342
     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)
1343
     wait()
1344
    else return false end
1345
   else return false end
1346
  end--]]
1347
  wait(0.75) --Bolt Action
1348
  if silenced == true then
1349
   Player.Character[Name].Handle.Equip:Play()
1350
  end
1351
  for i = 0, 10, 5 do
1352
   if Player.Character:FindFirstChild("Torso") ~= nil then
1353
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1354
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1355
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
1356
     wait()
1357
    else return false end
1358
   else return false end
1359
  end
1360
  wait(0.1)
1361
  for i = 0, 10, 1.5 do
1362
   if Player.Character:FindFirstChild("Torso") ~= nil then
1363
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1364
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1365
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
1366
     wait()
1367
    else return false end
1368
   else return false end
1369
  end
1370
  Player.Character[Name].BoltKnobI.Transparency = 1
1371
  Player.Character[Name].BoltShaftI.Transparency = 1
1372
  Player.Character[Name].BoltShaftO.Transparency = 0
1373
  Player.Character[Name].BoltKnobO.Transparency = 0
1374
  makeShell(Player.Character[Name]:FindFirstChild("ShellOut"))
1375
  for i = 10, 0, -1.5 do
1376
   if Player.Character:FindFirstChild("Torso") ~= nil then
1377
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1378
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1379
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.9, 0.2 - (i / 25), 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
1380
     wait()
1381
    else return false end
1382
   else return false end
1383
  end
1384
  Player.Character[Name].BoltKnobI.Transparency = 0
1385
  Player.Character[Name].BoltShaftI.Transparency = 0
1386
  Player.Character[Name].BoltShaftO.Transparency = 1
1387
  Player.Character[Name].BoltKnobO.Transparency = 1
1388
  for i = 10, 0, -5 do
1389
   if Player.Character:FindFirstChild("Torso") ~= nil then
1390
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
1391
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1392
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5 - (i / 25), 0.2, 0.2) * CFrame.fromEulerAnglesXYZ(math.rad(300 - i), math.rad(10 - i), math.rad(-90))
1393
     wait()
1394
    else return false end
1395
   else return false end
1396
  end
1397
  for i = 10, 0, -5 do
1398
   if Player.Character:FindFirstChild("Torso") ~= nil then
1399
    if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
1400
     Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
1401
     Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.5, 1.2, 0.8) * CFrame.fromEulerAnglesXYZ(math.rad(300), math.rad(10 + i), math.rad(-90))
1402
     Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
1403
     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)
1404
     wait()
1405
    else return false end
1406
   else return false end
1407
  end
1408
 end
1409
 return true
1410
end
1411
 
1412
function CamShake(time, freq)
1413
 coroutine.resume(coroutine.create(function()
1414
  local cam = game:GetService("Workspace").CurrentCamera
1415
  local time = 10
1416
  local seed = Vector3.new(math.random(100, 200) / freq, math.random(100, 200) / freq, 0)
1417
  if math.random(1, 2) == 1 then seed = Vector3.new(-seed.x, seed.y, 0) end
1418
  if math.random(1, 2) == 1 then seed = Vector3.new(seed.x, -seed.y, 0) end
1419
  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)
1420
  for i = 1, time do
1421
   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)
1422
   wait()
1423
  end
1424
 end))
1425
end
1426
 
1427
function makeShell(part)
1428
 if part == nil then return false end
1429
 local casing = Instance.new("Part")
1430
 casing.Name = "Shell"
1431
 casing.formFactor = "Symmetric"
1432
 casing.Size = Vector3.new(1, 1, 1)
1433
 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)))
1434
 casing.BrickColor = BrickColor.new("New Yeller")
1435
 local mesh = Instance.new("CylinderMesh")
1436
 mesh.Scale = Vector3.new(0.2, 0.6, 0.2)
1437
 mesh.Parent = casing
1438
 casing.Parent = game:GetService("Workspace")
1439
 casing:BreakJoints()
1440
 casing.Velocity = (part.CFrame.lookVector * 65) + Vector3.new(0, 10, 0)
1441
 coroutine.resume(coroutine.create(function() wait(4.5) for i = 0, 1, 0.1 do casing.Transparency = i wait() end casing:Remove() end))
1442
end
1443
 
1444
function Weld(x, y)
1445
 local weld = Instance.new("Weld")
1446
 weld.Part0 = x
1447
 weld.Part1 = y
1448
 CJ = CFrame.new(x.Position)
1449
 C0 = x.CFrame:inverse() * CJ
1450
 C1 = y.CFrame:inverse() * CJ
1451
 weld.C0 = C0
1452
 weld.C1 = C1
1453
 weld.Parent = x
1454
end
1455
 
1456
function tagHumanoid(humanoid)
1457
 local tag = Instance.new("ObjectValue")
1458
 tag.Name = "creator"
1459
 tag.Value = Player
1460
 tag.Parent = humanoid
1461
 local tag = Instance.new("StringValue")
1462
 tag.Name = "creatorType1"
1463
 tag.Value = Name
1464
 tag.Parent = humanoid
1465
 local tag = Instance.new("StringValue")
1466
 tag.Name = "creatorType2"
1467
 tag.Value = "shot"
1468
 tag.Parent = humanoid
1469
end
1470
 
1471
function untagHumanoid(humanoid)
1472
 if humanoid ~= nil then
1473
  local tag = humanoid:FindFirstChild("creator")
1474
  if tag ~= nil then
1475
   tag:Remove()
1476
  end
1477
  local tag = humanoid:FindFirstChild("creatorType1")
1478
  if tag ~= nil then
1479
   tag:Remove()
1480
  end
1481
  local tag = humanoid:FindFirstChild("creatorType2")
1482
  if tag ~= nil then
1483
   tag:Remove()
1484
  end
1485
 end
1486
end
1487
 
1488
function fire(startPoint, endPoint, hit)
1489
 local trail = Instance.new("Part")
1490
 trail.Name = "Bullet Trail"
1491
 trail.BrickColor = BrickColor.new("Bright yellow")
1492
 trail.TopSurface = 0
1493
 trail.BottomSurface = 0
1494
 trail.formFactor = 0
1495
 trail.Size = Vector3.new(1, 1, 1)
1496
 trail.Transparency = 0.6
1497
 trail.Anchored = true
1498
 trail.CanCollide = false
1499
 trail.CFrame = CFrame.new((startPoint + endPoint) / 2, endPoint)
1500
 trail.Parent = game:GetService("Workspace")
1501
 local mesh = Instance.new("SpecialMesh")
1502
 mesh.MeshType = "Brick"
1503
 mesh.Scale = Vector3.new(0.2, 0.2, (startPoint - endPoint).magnitude)
1504
 mesh.Parent = trail
1505
 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)
1506
 if hit ~= nil then
1507
  if hit.Parent == nil then return end
1508
  if hit.Parent:FindFirstChild("Humanoid") ~= nil then
1509
   tagHumanoid(hit.Parent.Humanoid)
1510
   if hit.Name == "Head" then
1511
    hit.Parent.Humanoid:TakeDamage(damage * 10)
1512
   elseif hit.Name == "Torso" then
1513
    hit.Parent.Humanoid:TakeDamage(damage * 2)
1514
   else
1515
    hit.Parent.Humanoid:TakeDamage(damage)
1516
   end
1517
   if HP == true then
1518
    hit.Parent.Humanoid.Sit = true
1519
   end
1520
   delay(0.1, function() untagHumanoid(hit.Parent.Humanoid) end)
1521
  end
1522
  if hit.Anchored == false then
1523
   hit.Velocity = hit.Velocity + ((endPoint - startPoint).unit * (damage * 2))
1524
  end
1525
 end
1526
end
1527
 
1528
function onButton1Down(mouse)
1529
 if selected == false then return end
1530
 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
1531
  if Player.Character[Name]:FindFirstChild("Handle") == nil then return end
1532
  if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
1533
  if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end end
1534
  if dual == true then if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end end
1535
  mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1536
  Button1Down = true
1537
  canFire = false
1538
  canFire2 = true
1539
  while canFire2 == true do
1540
   local humanoid = Player.Character:FindFirstChild("Humanoid")
1541
   if humanoid == nil then
1542
    canFire2 = false
1543
    break
1544
   end
1545
   if humanoid.Health <= 0 then
1546
    canFire2 = false
1547
    break
1548
   end
1549
   local fireLeft = false
1550
   if automatic == false and burst == false then
1551
    canFire2 = false
1552
   elseif automatic == false and burst == true then
1553
    if burstCount >= burstCountMax then
1554
     canFire2 = false
1555
     burstCount = 0
1556
     break
1557
    end
1558
    burstCount = burstCount + 1
1559
   elseif automatic == true and burst == false then
1560
    fireLeft = true
1561
   end
1562
   if magazine.Value > 0 then
1563
    magazine.Value = magazine.Value - 1
1564
    updateGui()
1565
    fire(Player.Character[Name].Muzzle.Position, mouse.Hit.p, mouse.Target)
1566
    coroutine.resume(coroutine.create(function()
1567
     if dual == true then
1568
      playAnimation("rightFire")
1569
     elseif dual == false then
1570
      playAnimation("fire")
1571
     end
1572
    end))
1573
   else
1574
    Player.Character[Name].Handle.Empty:Play()
1575
   end
1576
   if fireLeft == true and dual == true and automatic == true then
1577
    if magazine.Value > 0 then
1578
     coroutine.resume(coroutine.create(function()
1579
      wait(readyTime / 2)
1580
      magazine.Value = magazine.Value - 1
1581
      updateGui()
1582
      fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
1583
      playAnimation("leftFire")
1584
     end))
1585
    else
1586
     coroutine.resume(coroutine.create(function()
1587
      wait(readyTime / 2)
1588
      Player.Character[Name].Handle.Empty:Play()
1589
     end))
1590
    end
1591
   end
1592
   wait(readyTime)
1593
  end
1594
  mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1595
  canFire = true
1596
 end
1597
end
1598
 
1599
function onButton1Up(mouse)
1600
 if selected == false then return end
1601
 Button1Down = false
1602
 canFire2 = false
1603
 burstCount = 0
1604
 while canFire == false do wait() end
1605
 if dual == true and automatic == false then
1606
  if Player.Character[Name.. " (Left)"]:FindFirstChild("Handle") == nil then return end
1607
  if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
1608
  mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1609
  canFire = false
1610
  canFire2 = true
1611
  while canFire2 == true do
1612
   local humanoid = Player.Character:FindFirstChild("Humanoid")
1613
   if humanoid == nil then
1614
    canFire2 = false
1615
    break
1616
   end
1617
   if humanoid.Health <= 0 then
1618
    canFire2 = false
1619
    break
1620
   end
1621
   if burst == false then
1622
    canFire2 = false
1623
   elseif burst == true then
1624
    if burstCount >= burstCountMax then
1625
     canFire2 = false
1626
     burstCount = 0
1627
     break
1628
    end
1629
    burstCount = burstCount + 1
1630
   end
1631
   if magazine.Value <= 0 then
1632
    Player.Character[Name].Handle.Empty:Play()
1633
   else
1634
    coroutine.resume(coroutine.create(function()
1635
     playAnimation("leftFire")
1636
    end))
1637
    magazine.Value = magazine.Value - 1
1638
    updateGui()
1639
    fire(Player.Character[Name.. " (Left)"].Muzzle.Position, mouse.Hit.p, mouse.Target)
1640
   end
1641
   wait(readyTime)
1642
  end
1643
  mouse.Icon = "http://www.roblox.com/asset/?id=49912389"
1644
  canFire = true
1645
 end
1646
end
1647
 
1648
function onKeyDown(key, mouse)
1649
 if selected == false then return end
1650
 key = key:lower()
1651
 if key == "q" and Button1Down == false and canFire == true then
1652
  if mouse.Target == nil then return end
1653
  if game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent) ~= nil then
1654
   if dual == true then onKeyDown("t", mouse) end
1655
   onDeselected(mouse)
1656
   removeParts("RightHolster")
1657
   script.Parent.Parent = game:GetService("Players"):GetPlayerFromCharacter(mouse.Target.Parent).Backpack
1658
  end
1659
 end
1660
 if key == "e" and Button1Down == false and canFire == true and canSilence == true then
1661
  if silenced then
1662
   silenced = false
1663
   if Player.Character:FindFirstChild(Name) == nil then return end
1664
   if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
1665
   if Player.Character[Name]:FindFirstChild("Muzzle 2") == nil then return end
1666
   Player.Character[Name].Muzzle.Transparency = 1
1667
   Player.Character[Name].Muzzle.Name = "Silencer"
1668
   Player.Character[Name]["Muzzle 2"].Name = "Muzzle"
1669
   if dual == true then
1670
    if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
1671
    if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle 2") == nil then return end
1672
    Player.Character[Name.. " (Left)"].Muzzle.Transparency = 1
1673
    Player.Character[Name.. " (Left)"].Muzzle.Name = "Silencer"
1674
    Player.Character[Name.. " (Left)"]["Muzzle 2"].Name = "Muzzle"
1675
   end
1676
  else
1677
   silenced = true
1678
   if Player.Character:FindFirstChild(Name) == nil then return end
1679
   if Player.Character[Name]:FindFirstChild("Silencer") == nil then return end
1680
   if Player.Character[Name]:FindFirstChild("Muzzle") == nil then return end
1681
   Player.Character[Name].Silencer.Transparency = 0
1682
   Player.Character[Name].Muzzle.Name = "Muzzle 2"
1683
   Player.Character[Name].Silencer.Name = "Muzzle"
1684
   if dual == true then
1685
    if Player.Character[Name.. " (Left)"]:FindFirstChild("Silencer") == nil then return end
1686
    if Player.Character[Name.. " (Left)"]:FindFirstChild("Muzzle") == nil then return end
1687
    Player.Character[Name.. " (Left)"].Silencer.Transparency = 0
1688
    Player.Character[Name.. " (Left)"].Muzzle.Name = "Muzzle 2"
1689
    Player.Character[Name.. " (Left)"].Silencer.Name = "Muzzle"
1690
   end
1691
  end
1692
 end
1693
 if key == "r" and Button1Down == false and canFire == true then
1694
  if ammo.Value > 0 and magazine.Value ~= magazineMax.Value then
1695
   canFire = false
1696
   burstCount = 0
1697
   mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1698
   if magazine.Value > 0 then ammo.Value = ammo.Value + magazine.Value magazine.Value = 0 end
1699
   updateGui()
1700
   if dual == true then
1701
    playAnimation("reloadDual")
1702
   elseif dual == false then
1703
    playAnimation("reload")
1704
   end
1705
   if ammo.Value - magazineMax.Value < 0 then
1706
    magazine.Value = ammo.Value
1707
    ammo.Value = 0
1708
   elseif ammo.Value - magazineMax.Value >= 0 then
1709
    ammo.Value = ammo.Value - magazineMax.Value
1710
    magazine.Value = magazineMax.Value
1711
   end
1712
   updateGui()
1713
   mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1714
   canFire = true
1715
  end
1716
 end
1717
 if key == "t" and Button1Down == false and canFire == true and canDual == true then
1718
  canFire = false
1719
  if dual == false then
1720
   local weapon = nil
1721
   for _, p in pairs(Player.Backpack:GetChildren()) do
1722
    if p.Name == Name and p ~= script.Parent then weapon = p break end
1723
   end
1724
   if weapon ~= nil then
1725
    dual = true
1726
    weapon.Name = "Dual"
1727
    weapon.Parent = script
1728
    silenced = false
1729
    removeParts("RightHand")
1730
    makeParts("RightHand")
1731
    removeParts("RightHolster")
1732
    makeParts("LeftHolster")
1733
    playAnimation("leftEquip")
1734
    removeParts("LeftHolster")
1735
    makeParts("LeftHand")
1736
    magazineMax.Value = math.ceil(magazineMax.Value * 2)
1737
    ammoMax.Value = math.ceil(ammoMax.Value * 2)
1738
    magazine.Value = magazine.Value + weapon.Magazine.Value
1739
    ammo.Value = ammo.Value + weapon.Ammo.Value
1740
    updateGui()
1741
   end
1742
  elseif dual == true then
1743
   local weapon = script:FindFirstChild("Dual")
1744
   if weapon ~= nil then
1745
    dual = false
1746
    weapon.Name = Name
1747
    weapon.Parent = Player.Backpack
1748
    silenced = false
1749
    removeParts("RightHand")
1750
    makeParts("RightHand")
1751
    playAnimation("leftUnequip")
1752
    removeParts("LeftHand")
1753
    makeParts("RightHolster")
1754
    playAnimation("hold")
1755
    weapon.Magazine.Value = math.floor(magazine.Value / 2)
1756
    weapon.Ammo.Value = math.floor(ammo.Value / 2)
1757
    magazineMax.Value = math.ceil(magazineMax.Value / 2)
1758
    ammoMax.Value = math.ceil(ammoMax.Value / 2)
1759
    magazine.Value = math.ceil(magazine.Value / 2)
1760
    ammo.Value = math.ceil(ammo.Value / 2)
1761
    updateGui()
1762
   end
1763
  end
1764
  canFire = true
1765
 end
1766
 if key == "y" and canZoom == true then
1767
  if zoom == false then
1768
   zoom = true
1769
   local pos = mouse.Hit.p
1770
   local target = mouse.Target
1771
   local cam = game:GetService("Workspace").CurrentCamera
1772
   focus = Instance.new("Part", workspace)
1773
   focus.Anchored = true
1774
   focus.CanCollide = false
1775
   focus.Transparency = 1
1776
   focus.TopSurface = 0
1777
   focus.BottomSurface = 0
1778
   focus.formFactor = "Plate"
1779
   focus.Size = Vector3.new(0, 0, 0)
1780
   focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
1781
   cam.CameraSubject = focus
1782
   cam.CameraType = "Attach"
1783
   while zoom == true and selected == true do
1784
    local set = false
1785
    if target ~= nil then
1786
     if target.Parent ~= nil then
1787
      if target.Anchored == false then
1788
       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)
1789
       set = true
1790
      end
1791
     end
1792
    end
1793
    if set == false then
1794
     focus.CFrame = CFrame.new(pos) * (CFrame.new(Player.Character.Torso.CFrame.p, pos) - CFrame.new(Player.Character.Torso.CFrame.p, pos).p)
1795
    end
1796
    wait()
1797
   end
1798
   if focus ~= nil then focus:Remove() focus = nil end
1799
   local cam = game:GetService("Workspace").CurrentCamera
1800
   cam.CameraSubject = Player.Character:FindFirstChild("Humanoid")
1801
   cam.CameraType = "Custom"
1802
  else
1803
   zoom = false
1804
  end
1805
 end
1806
 if key == "u" and Button1Down == false and canFire == true then
1807
  if automatic == false and burst == false then
1808
   if switchToBurst == true then
1809
    burst = true
1810
    local m = Instance.new("Message", Player)
1811
    m.Text = "Burst"
1812
    pcall(function() Player.Character[Name].Handle.Switch:Play() end)
1813
    delay(2.5, function() m:Remove() end)
1814
   elseif switchToAutomatic == true then
1815
    automatic = true
1816
    local m = Instance.new("Message", Player)
1817
    m.Text = "Automatic"
1818
    pcall(function() Player.Character[Name].Handle.Switch:Play() end)
1819
    delay(2.5, function() m:Remove() end)
1820
   end
1821
  elseif automatic == false and burst == true then
1822
   if switchToAutomatic == true then
1823
    automatic = true
1824
    burst = false
1825
    local m = Instance.new("Message", Player)
1826
    m.Text = "Automatic"
1827
    pcall(function() Player.Character[Name].Handle.Switch:Play() end)
1828
    delay(2.5, function() m:Remove() end)
1829
   elseif switchToSingle == true then
1830
    burst = false
1831
    local m = Instance.new("Message", Player)
1832
    m.Text = "Single"
1833
    pcall(function() Player.Character[Name].Handle.Switch:Play() end)
1834
    delay(2.5, function() m:Remove() end)
1835
   end
1836
  elseif automatic == true and burst == false then
1837
   if switchToSingle == true then
1838
    automatic = false
1839
    local m = Instance.new("Message", Player)
1840
    m.Text = "Single"
1841
    pcall(function() Player.Character[Name].Handle.Switch:Play() end)
1842
    delay(2.5, function() m:Remove() end)
1843
   elseif switchToBurst == true then
1844
    automatic = false
1845
    burst = true
1846
    local m = Instance.new("Message", Player)
1847
    m.Text = "Burst"
1848
    pcall(function() Player.Character[Name].Handle.Switch:Play() end)
1849
    delay(2.5, function() m:Remove() end)
1850
   end
1851
  end
1852
 end
1853
end
1854
 
1855
function onSelected(mouse)
1856
 if selected == true then return end
1857
 selected = true
1858
 canFire = false
1859
 mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1860
 while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
1861
  if Player.Character.WeaponActivated.Value == nil then break end
1862
  if Player.Character.WeaponActivated.Value.Parent == nil then break end
1863
  wait()
1864
 end
1865
 updateGui()
1866
 local weapon = Instance.new("ObjectValue")
1867
 weapon.Name = "WeaponActivated"
1868
 weapon.Value = script.Parent
1869
 weapon.Parent = Player.Character
1870
 DisableLimb(1, Player.Character)
1871
 DisableLimb(2, Player.Character)
1872
 ForceAngle(1, 0, Player.Character)
1873
 ForceAngle(2, 0, Player.Character)
1874
 if dual == true then
1875
  coroutine.resume(coroutine.create(function() playAnimation("leftEquip") end))
1876
  playAnimation("rightEquip")
1877
  removeParts("LeftHolster")
1878
  makeParts("LeftHand")
1879
 else
1880
  playAnimation("equip")
1881
 end
1882
 removeParts("RightHolster")
1883
 makeParts("RightHand")
1884
 mouse.Button1Down:connect(function() onButton1Down(mouse) end)
1885
 mouse.Button1Up:connect(function() onButton1Up(mouse) end)
1886
 mouse.KeyDown:connect(function(key) onKeyDown(key, mouse) end)
1887
 mouse.Icon = "http://www.roblox.com/asset/?id=1868836"
1888
 canFire = true
1889
end
1890
 
1891
function onDeselected(mouse)
1892
 if selected == false then return end
1893
 Button1Down = false
1894
 while canFire == false do
1895
  wait()
1896
 end
1897
 selected = false
1898
 if dual == true then
1899
  if math.random(1, 2) == 1 then
1900
   coroutine.resume(coroutine.create(function() playAnimation("leftUnequip") end))
1901
   wait(math.random(1, 10) / 10)
1902
   playAnimation("rightUnequip")
1903
  else
1904
   coroutine.resume(coroutine.create(function() playAnimation("rightUnequip") end))
1905
   wait(math.random(1, 10) / 10)
1906
   playAnimation("leftUnequip")
1907
  end
1908
  removeParts("LeftHand")
1909
  makeParts("LeftHolster")
1910
 else
1911
  playAnimation("unequip")
1912
 end
1913
 removeParts("RightHand")
1914
 makeParts("RightHolster")
1915
 ForceAngle(1, 0, Player.Character)
1916
 ForceAngle(2, 0, Player.Character)
1917
 ResetLimbCFrame(1, Player.Character)
1918
 ResetLimbCFrame(2, Player.Character)
1919
 EnableLimb(1, Player.Character)
1920
 EnableLimb(2, Player.Character)
1921
 silenced = false
1922
 if Player.PlayerGui:FindFirstChild(Name) ~= nil then Player.PlayerGui[Name]:Remove() end
1923
 if Player.Character:FindFirstChild("WeaponActivated") ~= nil then
1924
  if Player.Character.WeaponActivated.Value == script.Parent then
1925
   Player.Character.WeaponActivated:Remove()
1926
  end
1927
 end
1928
 while Player.Character:FindFirstChild("WeaponActivated") ~= nil do
1929
  if Player.Character.WeaponActivated.Value == nil then break end
1930
  if Player.Character.WeaponActivated.Value.Parent == nil then break end
1931
  wait()
1932
 end
1933
end
1934
 
1935
if script.Parent.className ~= "HopperBin" then
1936
 if Player == nil then print("Error: Player not found!") return end
1937
 Tool = Instance.new("HopperBin")
1938
 Tool.Name = Name
1939
 Tool.Parent = Player.Backpack
1940
 script.Name = "Main"
1941
 script.Parent = Tool
1942
elseif script.Parent.className == "HopperBin" then
1943
 while script.Parent.Parent.className ~= "Backpack" do
1944
  wait()
1945
 end
1946
 if script.Parent:FindFirstChild("MagazineMax") == nil then
1947
  magazineMax = Instance.new("NumberValue")
1948
  magazineMax.Name = "MagazineMax"
1949
  magazineMax.Value = 5
1950
  magazineMax.Parent = script.Parent
1951
 else
1952
  magazineMax = script.Parent.MagazineMax
1953
 end
1954
 if script.Parent:FindFirstChild("Magazine") == nil then
1955
  magazine = Instance.new("NumberValue")
1956
  magazine.Name = "Magazine"
1957
  magazine.Value = 0
1958
  magazine.Parent = script.Parent
1959
 else
1960
  magazine = script.Parent.Magazine
1961
 end
1962
 if script.Parent:FindFirstChild("AmmoMax") == nil then
1963
  ammoMax = Instance.new("NumberValue")
1964
  ammoMax.Name = "AmmoMax"
1965
  ammoMax.Value = 300
1966
  ammoMax.Parent = script.Parent
1967
 else
1968
  ammoMax = script.Parent.AmmoMax
1969
 end
1970
 if script.Parent:FindFirstChild("Ammo") == nil then
1971
  ammo = Instance.new("NumberValue")
1972
  ammo.Name = "Ammo"
1973
  ammo.Value = script.Parent.AmmoMax.Value
1974
  ammo.Parent = script.Parent
1975
 else
1976
  ammo = script.Parent.Ammo
1977
 end
1978
 Player = script.Parent.Parent.Parent
1979
 makeParts("RightHolster")
1980
 script.Parent.Selected:connect(onSelected)
1981
 script.Parent.Deselected:connect(onDeselected)
1982
end