Advertisement
KHSora455

MP412

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