Advertisement
Lanceron2

Untitled

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