Advertisement
Sergeant_SethZP

Game_Ruiner

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