Advertisement
brianspy

Untitled

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