Advertisement
ergis

Untitled

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