Advertisement
brainaqweqww

Untitled

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