Advertisement
thetacolord609

Untitled

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