Advertisement
nicholasXPG

Untitled

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