Migas3456

m4a1(not made by me)

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