Advertisement
PASTEBINWARRIOR

Untitled

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