FilthyFrank

HK4 script

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