Advertisement
Guest User

SpiritOfRevenge

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