Ven0ced

Untitled

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