xZkills_Guerreroser

more nothing

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