Advertisement
Hebablazin

Vengence

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