Advertisement
worm246411

Untitled

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