Advertisement
PASTEBINWARRIOR

Untitled

Aug 7th, 2015
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 110.06 KB | None | 0 0
  1.  
  2.  
  3. --[[
  4. Jaginator's MP412
  5. --]]
  6.  
  7.  
  8. if script == nil then return end
  9.  
  10.  
  11. Player = game.Players.Your Name Here
  12. Name = "MP412"
  13. MC = BrickColor.new("Really blue")
  14. GC = BrickColor.new("Really red")
  15. Spread = 90000
  16. MR = 0.15
  17. Chamber = 1
  18. Loaded = 0
  19. Scoped = false
  20. Scoped = false
  21. selected = false
  22. Hammer = true
  23. canDual = false
  24. dual = true
  25. Button1Down = false
  26. damage = 10
  27. canFire = false
  28. canFire2 = true
  29. readyTime = 0.000023
  30. automatic = false
  31. burst = false
  32. burstCount = 0
  33. burstCountMax = 3
  34. canSilence = false
  35. silenced = false
  36. canZoom = true
  37. zoom = false
  38. switchToSingle = true
  39. switchToBurst = true
  40. switchToAutomatic = true
  41.  
  42.  
  43. ammoGui = Instance.new("ScreenGui")
  44. ammoGui.Name = Name
  45. local frame = Instance.new("Frame")
  46. frame.Name = "Frame"
  47. frame.Size = UDim2.new(0, 165, 0, 60)
  48. frame.Position = UDim2.new(0, 0, 1, -400)
  49. frame.BackgroundColor3 = Color3.new(1, 1, 1)
  50. frame.BorderColor3 = Color3.new(0, 0, 0)
  51. frame.Parent = ammoGui
  52. local label = Instance.new("TextLabel")
  53. label.Name = "Weapon"
  54. label.Text = "Weapon: " ..Name
  55. label.Size = UDim2.new(1, 0, 0, 20)
  56. label.Position = UDim2.new(0, 0, 0, 0)
  57. label.BackgroundColor3 = Color3.new(1, 0, 0)
  58. label.BorderColor3 = Color3.new(0, 0, 0)
  59. label.Parent = frame
  60. local label = Instance.new("TextLabel")
  61. label.Name = "MagazinePrefix"
  62. label.Text = " Magazine:"
  63. label.TextXAlignment = "Left"
  64. label.Size = UDim2.new(1, 0, 0, 20)
  65. label.Position = UDim2.new(0, 0, 0, 20)
  66. label.BackgroundColor3 = Color3.new(1, 1, 1)
  67. label.BorderColor3 = Color3.new(0, 0, 0)
  68. label.Parent = frame
  69. local label = Instance.new("TextLabel")
  70. label.Name = "Magazine"
  71. label.Text = "0/0"
  72. label.TextXAlignment = "Right"
  73. label.Size = UDim2.new(1, 0, 0, 20)
  74. label.Position = UDim2.new(0, -10, 0, 20)
  75. label.BackgroundTransparency = 1
  76. label.BorderSizePixel = 0
  77. label.Parent = frame
  78. local label = Instance.new("TextLabel")
  79. label.Name = "AmmoPrefix"
  80. label.Text = " .357 Magnum:"
  81. label.TextXAlignment = "Left"
  82. label.Size = UDim2.new(1, 0, 0, 20)
  83. label.Position = UDim2.new(0, 0, 0, 40)
  84. label.BackgroundColor3 = Color3.new(1, 1, 1)
  85. label.BorderColor3 = Color3.new(0, 0, 0)
  86. label.Parent = frame
  87. local label = Instance.new("TextLabel")
  88. label.Name = "Ammo"
  89. label.Text = "0/0"
  90. label.TextXAlignment = "Right"
  91. label.Size = UDim2.new(1, 0, 0, 20)
  92. label.Position = UDim2.new(0, -10, 0, 40)
  93. label.BackgroundTransparency = 1
  94. label.BorderSizePixel = 0
  95. label.Parent = frame
  96.  
  97.  
  98. function updateGui()
  99. if selected == false then return end
  100. if Player:FindFirstChild("PlayerGui") == nil then Instance.new("PlayerGui").Parent = Player end
  101. if Player.PlayerGui:FindFirstChild(Name) == nil then
  102. ammoGui:Clone().Parent = Player.PlayerGui
  103. end
  104. Player.PlayerGui[Name].Frame.Magazine.Text = tostring(magazine.Value).. "/" ..tostring(magazineMax.Value)
  105. Player.PlayerGui[Name].Frame.Ammo.Text = tostring(ammo.Value).. "/" ..tostring(ammoMax.Value)
  106. end
  107.  
  108.  
  109. function makeParts(format)
  110. local model = Instance.new("Model")
  111. model.Name = Name
  112. local pm = Instance.new("Part")
  113. pm.Name = "Handle"
  114. pm.formFactor = "Symmetric"
  115. pm.Size = Vector3.new(1, 1, 1)
  116. pm.BrickColor = MC
  117. pm.Reflectance = MR
  118. pm.Transparency = 1
  119. pm.CanCollide = false
  120. pm.Locked = true
  121. pm.TopSurface = 0
  122. pm.BottomSurface = 0
  123. pm.Parent = model
  124. local m = Instance.new("SpecialMesh")
  125. m.MeshType = "Brick"
  126. m.Scale = Vector3.new(0.3, 0.8, 0.4)
  127. m.Parent = pm
  128. if format ~= nil then
  129. local w = Instance.new("Weld")
  130. w.Part0 = pm
  131. if format == "RightHand" then
  132. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  133. w.C0 = CFrame.new(0, 0.9, 0.68)
  134. w.C1 = CFrame.new()
  135. elseif format == "LeftHand" then
  136. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  137. w.C0 = CFrame.new(0, 0.9, 0.68)
  138. w.C1 = CFrame.new()
  139. model.Name = Name.. " (Left)"
  140. elseif format == "RightHolster" then
  141. w.Part1 = Player.Character:FindFirstChild("Right Leg")
  142. w.C0 = CFrame.new(-0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
  143. w.C1 = CFrame.new()
  144. w.Parent = pm
  145. model.Name = Name.. " (Holstered)"
  146. elseif format == "LeftHolster" then
  147. w.Part1 = Player.Character:FindFirstChild("Left Leg")
  148. w.C0 = CFrame.new(0.65, -0.25, 0) * CFrame.fromEulerAnglesXYZ(math.rad(25), 0, 0)
  149. w.C1 = CFrame.new()
  150. model.Name = Name.. " (Holstered, Left)"
  151. end
  152. w.Parent = pm
  153. model.Parent = Player.Character
  154. end
  155. local s = Instance.new("Sound")
  156. s.Name = "Fire"
  157. s.SoundId = "http://www.roblox.com/Asset/?id=10209875"
  158. s.Volume = .5
  159. s.Pitch = 50
  160. s.Looped = false
  161. s.Parent = pm
  162. local s = Instance.new("Sound")
  163. s.Name = "Reload"
  164. s.SoundId = "http://www.roblox.com/Asset/?id=10209894"
  165. s.Volume = 0.8
  166. s.Pitch = 4
  167. s.Looped = false
  168. s.Parent = pm
  169. local s = Instance.new("Sound")
  170. s.Name = "Empty"
  171. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  172. s.Volume = 1
  173. s.Pitch = 5
  174. s.Looped = false
  175. s.Parent = pm
  176. local s = Instance.new("Sound")
  177. s.Name = "Lock"
  178. s.SoundId = "http://www.roblox.com/Asset/?id=10209845"
  179. s.Volume = 1
  180. s.Pitch = 3
  181. s.Looped = false
  182. s.Parent = pm
  183. local s = Instance.new("Sound")
  184. s.Name = "Release"
  185. s.SoundId = "http://www.roblox.com/Asset/?id=10209813"
  186. s.Volume = 1
  187. s.Pitch = 4
  188. s.Looped = false
  189. s.Parent = pm
  190. local s = Instance.new("Sound")
  191. s.Name = "Switch"
  192. s.SoundId = "http://www.roblox.com/asset/?id=2697295"
  193. s.Volume = 1
  194. s.Pitch = 10
  195. s.Looped = false
  196. s.Parent = pm
  197. local p = Instance.new("Part")
  198. p.Name = "ShellOut"
  199. p.formFactor = "Symmetric"
  200. p.Size = Vector3.new(1, 1, 1)
  201. p.Transparency = 1
  202. p.Locked = true
  203. p.CanCollide = false
  204. p.TopSurface = 0
  205. p.BottomSurface = 0
  206. p.Parent = model
  207. local w = Instance.new("Weld")
  208. w.Part0 = p
  209. w.Part1 = pm
  210. w.C0 = CFrame.new(0.5, 0, 0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0)
  211. w.C1 = CFrame.new()
  212. w.Parent = p
  213. local p = Instance.new("Part")
  214. p.Name = "Grip"
  215. p.formFactor = "Symmetric"
  216. p.Size = Vector3.new(1, 1, 1)
  217. p.BrickColor = GC
  218. p.CanCollide = false
  219. p.Locked = true
  220. p.TopSurface = 0
  221. p.BottomSurface = 0
  222. p.Parent = model
  223. local m = Instance.new("BlockMesh")
  224. m.Scale = Vector3.new(0.261, 0.42, 0.7)
  225. m.Parent = p
  226. local w = Instance.new("Weld")
  227. w.Part0 = p
  228. w.Part1 = pm
  229. w.C0 = CFrame.new(0, -0.022, -0.4) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  230. w.C1 = CFrame.new()
  231. w.Parent = p
  232. local p = Instance.new("Part")
  233. p.Name = "TriggerGuard"
  234. p.formFactor = "Symmetric"
  235. p.Size = Vector3.new(1, 1, 1)
  236. p.BrickColor = GC
  237. p.CanCollide = false
  238. p.Locked = true
  239. p.TopSurface = 0
  240. p.BottomSurface = 0
  241. p.Parent = model
  242. local m = Instance.new("SpecialMesh")
  243. m.MeshType = "FileMesh"
  244. m.MeshId = "http://www.roblox.com/asset/?id=3270017"
  245. m.Scale = Vector3.new(0.3, 0.3, 0.8)
  246. m.Parent = p
  247. local w = Instance.new("Weld")
  248. w.Part0 = p
  249. w.Part1 = pm
  250. w.C0 = CFrame.new(-0.21, 0.16, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  251. w.C1 = CFrame.new()
  252. w.Parent = p
  253. local p = Instance.new("Part")
  254. p.Name = "Trigger"
  255. p.formFactor = "Symmetric"
  256. p.Size = Vector3.new(1, 1, 1)
  257. p.BrickColor = GC
  258. p.CanCollide = false
  259. p.Locked = true
  260. p.TopSurface = 0
  261. p.BottomSurface = 0
  262. p.Parent = model
  263. local m = Instance.new("BlockMesh")
  264. m.Scale = Vector3.new(0.1, 0.4, 0.16)
  265. m.Parent = p
  266. local w = Instance.new("Weld")
  267. w.Part0 = p
  268. w.Part1 = pm
  269. w.C0 = CFrame.new(0, 0.04, -0.22)
  270. w.C1 = CFrame.new()
  271. w.Parent = p
  272. local p = Instance.new("Part")
  273. p.Name = "Base"
  274. p.CanCollide = false
  275. p.formFactor = "Symmetric"
  276. p.Size = Vector3.new(1, 1, 1)
  277. p.BrickColor = GC
  278. p.Locked = true
  279. p.TopSurface = 0
  280. p.BottomSurface = 0
  281. p.Parent = model
  282. local m = Instance.new("BlockMesh")
  283. m.Scale = Vector3.new(0.26, 0.72, 0.1)
  284. m.Parent = p
  285. local w = Instance.new("Weld")
  286. w.Part0 = p
  287. w.Part1 = pm
  288. w.C0 = CFrame.new(0, 0.09, -0.1)
  289. w.C1 = CFrame.new()
  290. w.Parent = p
  291. local p = Instance.new("Part")
  292. p.Name = "Body"
  293. p.formFactor = "Symmetric"
  294. p.Size = Vector3.new(1, 1, 1)
  295. p.BrickColor = GC
  296. p.CanCollide = false
  297. p.Locked = true
  298. p.TopSurface = 0
  299. p.BottomSurface = 0
  300. p.Parent = model
  301. local m = Instance.new("BlockMesh")
  302. m.Scale = Vector3.new(0.26, 0.1, 0.28)
  303. m.Parent = p
  304. local w = Instance.new("Weld")
  305. w.Part0 = p
  306. w.Part1 = pm
  307. w.C0 = CFrame.new(0, 0, 0.03)
  308. w.C1 = CFrame.new()
  309. w.Parent = p
  310. local p = Instance.new("Part")
  311. p.Name = "Body"
  312. p.formFactor = "Symmetric"
  313. p.Size = Vector3.new(1, 1, 1)
  314. p.BrickColor = GC
  315. p.CanCollide = false
  316. p.Locked = true
  317. p.TopSurface = 0
  318. p.BottomSurface = 0
  319. p.Parent = model
  320. local m = Instance.new("SpecialMesh")
  321. m.MeshType = "Wedge"
  322. m.Scale = Vector3.new(0.086, 0.2, 0.15)
  323. m.Parent = p
  324. local w = Instance.new("Weld")
  325. w.Part0 = p
  326. w.Part1 = pm
  327. w.C0 = CFrame.new(0.086, -0.15, 0.08)
  328. w.C1 = CFrame.new()
  329. w.Parent = p
  330. local p = Instance.new("Part")
  331. p.Name = "Body"
  332. p.formFactor = "Symmetric"
  333. p.Size = Vector3.new(1, 1, 1)
  334. p.BrickColor = GC
  335. p.CanCollide = false
  336. p.Locked = true
  337. p.TopSurface = 0
  338. p.BottomSurface = 0
  339. p.Parent = model
  340. local m = Instance.new("SpecialMesh")
  341. m.MeshType = "Wedge"
  342. m.Scale = Vector3.new(0.086, 0.2, 0.15)
  343. m.Parent = p
  344. local w = Instance.new("Weld")
  345. w.Part0 = p
  346. w.Part1 = pm
  347. w.C0 = CFrame.new(-0.086, -0.15, 0.08)
  348. w.C1 = CFrame.new()
  349. w.Parent = p
  350. local p = Instance.new("Part")
  351. p.Name = "Body"
  352. p.formFactor = "Symmetric"
  353. p.Size = Vector3.new(1, 1, 1)
  354. p.BrickColor = GC
  355. p.CanCollide = false
  356. p.Locked = true
  357. p.TopSurface = 0
  358. p.BottomSurface = 0
  359. p.Parent = model
  360. local m = Instance.new("SpecialMesh")
  361. m.MeshType = "Wedge"
  362. m.Scale = Vector3.new(0.086, 0.2, 0.075)
  363. m.Parent = p
  364. local w = Instance.new("Weld")
  365. w.Part0 = p
  366. w.Part1 = pm
  367. w.C0 = CFrame.new(0, -0.15, 0.02)
  368. w.C1 = CFrame.new()
  369. w.Parent = p
  370. local p = Instance.new("Part")
  371. p.Name = "Hammer"
  372. p.formFactor = "Symmetric"
  373. p.Size = Vector3.new(1, 1, 1)
  374. p.BrickColor = MC
  375. p.Reflectance = MR
  376. p.CanCollide = false
  377. p.Locked = true
  378. p.TopSurface = 0
  379. p.BottomSurface = 0
  380. p.Parent = model
  381. local m = Instance.new("BlockMesh")
  382. m.Scale = Vector3.new(0.086, 0.1, 0.3)
  383. m.Parent = p
  384. local w = Instance.new("Weld")
  385. w.Part0 = p
  386. w.Part1 = pm
  387. if Hammer == false then
  388. w.C0 = CFrame.new(0, -0.1, 0.08)
  389. else
  390. w.C0 = CFrame.new(0, -0.1, 0.1) * CFrame.fromEulerAnglesXYZ(math.rad(-35), 0, 0)
  391. end
  392. w.C1 = CFrame.new()
  393. w.Parent = p
  394. local p = Instance.new("Part")
  395. p.Name = "Body"
  396. p.formFactor = "Symmetric"
  397. p.Size = Vector3.new(1, 1, 1)
  398. p.BrickColor = GC
  399. p.CanCollide = false
  400. p.Locked = true
  401. p.TopSurface = 0
  402. p.BottomSurface = 0
  403. p.Parent = model
  404. local m = Instance.new("BlockMesh")
  405. m.Scale = Vector3.new(0.26, 0.22, 0.1)
  406. m.Parent = p
  407. local w = Instance.new("Weld")
  408. w.Part0 = p
  409. w.Part1 = pm
  410. w.C0 = CFrame.new(0, -0.16, -0.02)
  411. w.C1 = CFrame.new()
  412. w.Parent = p
  413. local pv1 = Instance.new("Part")
  414. pv1.Name = "Pivot1"
  415. pv1.formFactor = "Symmetric"
  416. pv1.Size = Vector3.new(1, 1, 1)
  417. pv1.BrickColor = MC
  418. pv1.Reflectance = MR
  419. pv1.CanCollide = false
  420. pv1.Locked = true
  421. pv1.TopSurface = 0
  422. pv1.BottomSurface = 0
  423. pv1.Parent = model
  424. local m = Instance.new("CylinderMesh")
  425. m.Scale = Vector3.new(0.15, 0.261, 0.15)
  426. m.Parent = pv1
  427. local w = Instance.new("Weld")
  428. w.Part0 = pv1
  429. w.Part1 = pm
  430. w.C0 = CFrame.new(-0.45, 0, -0.04) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  431. w.C1 = CFrame.new()
  432. w.Parent = pv1
  433. local pv = Instance.new("Part")
  434. pv.Name = "Pivot"
  435. pv.formFactor = "Symmetric"
  436. pv.Size = Vector3.new(1, 1, 1)
  437. pv.BrickColor = BrickColor.new("Lime green")
  438. pv.Reflectance = MR
  439. pv.CanCollide = false
  440. pv.Locked = true
  441. pv.TopSurface = 0
  442. pv.BottomSurface = 0
  443. pv.Parent = model
  444. local m = Instance.new("CylinderMesh")
  445. m.Scale = Vector3.new(0.1, 0.27, 0.1)
  446. m.Parent = pv
  447. local w = Instance.new("Weld")
  448. w.Part0 = pv
  449. w.Part1 = pv1
  450. w.C0 = CFrame.new(0, 0, 0)
  451. w.C1 = CFrame.new()
  452. w.Parent = pv
  453. local p = Instance.new("Part")
  454. p.Name = "Barrel1"
  455. p.formFactor = "Symmetric"
  456. p.Size = Vector3.new(1, 1, 1)
  457. p.BrickColor = MC
  458. p.Reflectance = MR
  459. p.CanCollide = false
  460. p.Locked = true
  461. p.TopSurface = 0
  462. p.BottomSurface = 0
  463. p.Parent = model
  464. local m = Instance.new("BlockMesh")
  465. m.Scale = Vector3.new(0.15, 0.26, 0.28)
  466. m.Parent = p
  467. local w = Instance.new("Weld")
  468. w.Part0 = p
  469. w.Part1 = pv
  470. w.C0 = CFrame.new(0, 0, 0.14)
  471. w.C1 = CFrame.new()
  472. w.Parent = p
  473. local p = Instance.new("Part")
  474. p.Name = "Barrel2"
  475. p.formFactor = "Symmetric"
  476. p.Size = Vector3.new(1, 1, 1)
  477. p.BrickColor = MC
  478. p.Reflectance = MR
  479. p.CanCollide = false
  480. p.Locked = true
  481. p.TopSurface = 0
  482. p.BottomSurface = 0
  483. p.Parent = model
  484. local m = Instance.new("BlockMesh")
  485. m.Scale = Vector3.new(0.6, 0.2, 0.28)
  486. m.Parent = p
  487. local w = Instance.new("Weld")
  488. w.Part0 = p
  489. w.Part1 = pv
  490. w.C0 = CFrame.new(-0.36, 0, 0.14)
  491. w.C1 = CFrame.new()
  492. w.Parent = p
  493. local p = Instance.new("Part")
  494. p.Name = "Barrel3"
  495. p.formFactor = "Symmetric"
  496. p.Size = Vector3.new(1, 1, 1)
  497. p.BrickColor = MC
  498. p.Reflectance = MR
  499. p.CanCollide = false
  500. p.Locked = true
  501. p.TopSurface = 0
  502. p.BottomSurface = 0
  503. p.Parent = model
  504. local m = Instance.new("BlockMesh")
  505. m.Scale = Vector3.new(0.6, 0.26, 0.22)
  506. m.Parent = p
  507. local w = Instance.new("Weld")
  508. w.Part0 = p
  509. w.Part1 = pv
  510. w.C0 = CFrame.new(-0.36, 0, 0.14)
  511. w.C1 = CFrame.new()
  512. w.Parent = p
  513. local p = Instance.new("Part")
  514. p.Name = "Hole"
  515. p.formFactor = "Symmetric"
  516. p.Size = Vector3.new(1, 1, 1)
  517. p.BrickColor = BrickColor.new("New Yeller")
  518. p.Reflectance = 0
  519. p.CanCollide = false
  520. p.Locked = true
  521. p.TopSurface = 0
  522. p.BottomSurface = 0
  523. p.Parent = model
  524. local m = Instance.new("CylinderMesh")
  525. m.Scale = Vector3.new(0.1, 0.602, 0.1)
  526. m.Parent = p
  527. local w = Instance.new("Weld")
  528. w.Part0 = p
  529. w.Part1 = pv
  530. w.C0 = CFrame.new(0, -0.36, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  531. w.C1 = CFrame.new()
  532. w.Parent = p
  533. local p = Instance.new("Part")
  534. p.Name = "Top"
  535. p.formFactor = "Symmetric"
  536. p.Size = Vector3.new(1, 1, 1)
  537. p.BrickColor = MC
  538. p.Reflectance = MR
  539. p.CanCollide = false
  540. p.Locked = true
  541. p.TopSurface = 0
  542. p.BottomSurface = 0
  543. p.Parent = model
  544. local m = Instance.new("BlockMesh")
  545. m.Scale = Vector3.new(0.5, 0.26, 0.08)
  546. m.Parent = p
  547. local w = Instance.new("Weld")
  548. w.Part0 = p
  549. w.Part1 = pv
  550. w.C0 = CFrame.new(0.25, 0, 0.24)
  551. w.C1 = CFrame.new()
  552. w.Parent = p
  553. if Scoped == true then
  554. canZoom = true
  555. local p = Instance.new("Part")
  556. p.Name = "Scope"
  557. p.formFactor = "Symmetric"
  558. p.Size = Vector3.new(1, 1, 1)
  559. p.BrickColor = GC
  560. p.CanCollide = false
  561. p.Locked = true
  562. p.TopSurface = 0
  563. p.BottomSurface = 0
  564. p.Parent = model
  565. local m = Instance.new("CylinderMesh")
  566. m.Scale = Vector3.new(0.24, 0.5, 0.24)
  567. m.Parent = p
  568. local w = Instance.new("Weld")
  569. w.Part0 = p
  570. w.Part1 = pv
  571. w.C0 = CFrame.new(0, -0.2, 0.38) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  572. w.C1 = CFrame.new()
  573. w.Parent = p
  574. local p = Instance.new("Part")
  575. p.Name = "Scope"
  576. p.formFactor = "Symmetric"
  577. p.Size = Vector3.new(1, 1, 1)
  578. p.BrickColor = BrickColor.new("White")
  579. p.Reflectance = 0.5
  580. p.CanCollide = false
  581. p.Locked = true
  582. p.TopSurface = 0
  583. p.BottomSurface = 0
  584. p.Parent = model
  585. local m = Instance.new("CylinderMesh")
  586. m.Scale = Vector3.new(0.23, 0.503, 0.23)
  587. m.Parent = p
  588. local w = Instance.new("Weld")
  589. w.Part0 = p
  590. w.Part1 = pv
  591. w.C0 = CFrame.new(0, -0.2, 0.38) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  592. w.C1 = CFrame.new()
  593. w.Parent = p
  594. else end
  595. local p = Instance.new("Part")
  596. p.Name = "RearSight"
  597. p.formFactor = "Symmetric"
  598. p.Size = Vector3.new(1, 1, 1)
  599. p.BrickColor = MC
  600. p.Reflectance = MR
  601. p.CanCollide = false
  602. p.Locked = true
  603. p.TopSurface = 0
  604. p.BottomSurface = 0
  605. p.Parent = model
  606. local m = Instance.new("BlockMesh")
  607. m.Scale = Vector3.new(0.1, 0.08, 0.08)
  608. m.Parent = p
  609. local w = Instance.new("Weld")
  610. w.Part0 = p
  611. w.Part1 = pv
  612. w.C0 = CFrame.new(0.44, 0.08, 0.28)
  613. w.C1 = CFrame.new()
  614. w.Parent = p
  615. local p = Instance.new("Part")
  616. p.Name = "RearSight"
  617. p.formFactor = "Symmetric"
  618. p.Size = Vector3.new(1, 1, 1)
  619. p.BrickColor = MC
  620. p.Reflectance = MR
  621. p.CanCollide = false
  622. p.Locked = true
  623. p.TopSurface = 0
  624. p.BottomSurface = 0
  625. p.Parent = model
  626. local m = Instance.new("BlockMesh")
  627. m.Scale = Vector3.new(0.1, 0.08, 0.08)
  628. m.Parent = p
  629. local w = Instance.new("Weld")
  630. w.Part0 = p
  631. w.Part1 = pv
  632. w.C0 = CFrame.new(0.44, -0.08, 0.28)
  633. w.C1 = CFrame.new()
  634. w.Parent = p
  635. local p = Instance.new("Part")
  636. p.Name = "FrontSight"
  637. p.formFactor = "Symmetric"
  638. p.Size = Vector3.new(1, 1, 1)
  639. p.BrickColor = MC
  640. p.Reflectance = MR
  641. p.CanCollide = false
  642. p.Locked = true
  643. p.TopSurface = 0
  644. p.BottomSurface = 0
  645. p.Parent = model
  646. local m = Instance.new("BlockMesh")
  647. m.Scale = Vector3.new(0.1, 0.08, 0.08)
  648. m.Parent = p
  649. local w = Instance.new("Weld")
  650. w.Part0 = p
  651. w.Part1 = pv
  652. w.C0 = CFrame.new(-0.58, 0, 0.28)
  653. w.C1 = CFrame.new()
  654. w.Parent = p
  655. local p = Instance.new("Part")
  656. p.Name = "Cylinder"
  657. p.formFactor = "Symmetric"
  658. p.Size = Vector3.new(1, 1, 1)
  659. p.BrickColor = MC
  660. p.Reflectance = MR
  661. p.CanCollide = false
  662. p.Locked = true
  663. p.TopSurface = 0
  664. p.BottomSurface = 0
  665. p.Parent = model
  666. local m = Instance.new("CylinderMesh")
  667. m.Scale = Vector3.new(0.29, 0.32, 0.29)
  668. m.Parent = p
  669. local w = Instance.new("Weld")
  670. w.Part0 = p
  671. w.Part1 = pv
  672. w.C0 = CFrame.new(0, 0.23, 0.1) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  673. w.C1 = CFrame.new()
  674. w.Parent = p
  675. local p = Instance.new("Part")
  676. p.Name = "Pin"
  677. p.formFactor = "Symmetric"
  678. p.Size = Vector3.new(1, 1, 1)
  679. p.BrickColor = BrickColor.new("New Yeller")
  680. p.Reflectance = MR
  681. p.CanCollide = false
  682. p.Locked = true
  683. p.TopSurface = 0
  684. p.BottomSurface = 0
  685. p.Parent = model
  686. local m = Instance.new("CylinderMesh")
  687. m.Scale = Vector3.new(0.06, 0.46, 0.06)
  688. m.Parent = p
  689. local w = Instance.new("Weld")
  690. w.Part0 = p
  691. w.Part1 = pv
  692. w.C0 = CFrame.new(0, 0.23, 0.1) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90))
  693. w.C1 = CFrame.new()
  694. w.Parent = p
  695. local p = Instance.new("Part")
  696. if silenced == false then
  697. p.Name = "Muzzle"
  698. else
  699. p.Name = "Muzzle 2"
  700. end
  701. p.formFactor = "Symmetric"
  702. p.Size = Vector3.new(1, 1, 1)
  703. p.BrickColor = BrickColor.new("Lime green")
  704. p.Reflectance = 0.06
  705. p.CanCollide = false
  706. p.Transparency = 1
  707. p.Locked = true
  708. p.TopSurface = 0
  709. p.BottomSurface = 0
  710. p.Parent = model
  711. local m = Instance.new("CylinderMesh")
  712. m.Scale = Vector3.new(0.5, 0.1, 0.5)
  713. m.Offset = Vector3.new(0, 0, 0)
  714. m.Parent = p
  715. local w = Instance.new("Weld")
  716. w.Part0 = p
  717. w.Part1 = pv
  718. w.C0 = CFrame.new(0, 0.8, 0.18) * CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-90))
  719. w.C1 = CFrame.new()
  720. w.Parent = p
  721. local s = Instance.new("Smoke")
  722. s.Enabled = false
  723. s.Name = "Smoke"
  724. s.RiseVelocity = -5
  725. s.Opacity = 0.3
  726. s.Color = Color3.new(75 / 225, 75 / 225, 75 / 225)
  727. s.Size = 1
  728. s.Parent = p
  729. local f = Instance.new("Fire")
  730. f.Enabled = false
  731. f.Name = "Fire"
  732. f.Heat = -35
  733. f.Size = 1
  734. f.Parent = p
  735. return model
  736. end
  737.  
  738.  
  739. function removeParts(format)
  740. if format == "RightHand" then
  741. pcall(function() Player.Character[Name]:Remove() end)
  742. elseif format == "LeftHand" then
  743. pcall(function() Player.Character[Name.. " (Left)"]:Remove() end)
  744. elseif format == "RightHolster" then
  745. pcall(function() Player.Character[Name.. " (Holstered)"]:Remove() end)
  746. elseif format == "LeftHolster" then
  747. pcall(function() Player.Character[Name.. " (Holstered, Left)"]:Remove() end)
  748. end
  749. end
  750.  
  751.  
  752. function SetAngle(Joint, Angle, Character)
  753. if Character == nil then return false end
  754. local Joints = {
  755. Character.Torso:FindFirstChild("Right Shoulder 2"),
  756. Character.Torso:FindFirstChild("Left Shoulder 2"),
  757. Character.Torso:FindFirstChild("Right Hip 2"),
  758. Character.Torso:FindFirstChild("Left Hip 2")
  759. }
  760. if Joints[Joint] == nil then return false end
  761. if Joint == 1 or Joint == 3 then
  762. Joints[Joint].DesiredAngle = Angle
  763. end
  764. if Joint == 2 or Joint == 4 then
  765. Joints[Joint].DesiredAngle = -Angle
  766. end
  767. end
  768.  
  769.  
  770. function ForceAngle(Joint, Angle, Character)
  771. if Character == nil then return false end
  772. local Joints = {
  773. Character.Torso:FindFirstChild("Right Shoulder 2"),
  774. Character.Torso:FindFirstChild("Left Shoulder 2"),
  775. Character.Torso:FindFirstChild("Right Hip 2"),
  776. Character.Torso:FindFirstChild("Left Hip 2")
  777. }
  778. if Joints[Joint] == nil then return false end
  779. if Joint == 1 or Joint == 3 then
  780. Joints[Joint].DesiredAngle = Angle
  781. Joints[Joint].CurrentAngle = Angle
  782. end
  783. if Joint == 2 or Joint == 4 then
  784. Joints[Joint].DesiredAngle = -Angle
  785. Joints[Joint].CurrentAngle = -Angle
  786. end
  787. end
  788.  
  789.  
  790. function SetSpeed(Joint, Speed, Character)
  791. if Character == nil then return false end
  792. local Joints = {
  793. Character.Torso:FindFirstChild("Right Shoulder 2"),
  794. Character.Torso:FindFirstChild("Left Shoulder 2"),
  795. Character.Torso:FindFirstChild("Right Hip 2"),
  796. Character.Torso:FindFirstChild("Left Hip 2")
  797. }
  798. if Joints[Joint] == nil then return false end
  799. Joints[Joint].MaxVelocity = Speed
  800. end
  801.  
  802.  
  803. function DisableLimb(Limb, Character)
  804. if Character == nil then return false end
  805. if Character:FindFirstChild("Torso") == nil then return false end
  806. local Joints = {
  807. Character.Torso:FindFirstChild("Right Shoulder"),
  808. Character.Torso:FindFirstChild("Left Shoulder"),
  809. Character.Torso:FindFirstChild("Right Hip"),
  810. Character.Torso:FindFirstChild("Left Hip")
  811. }
  812. local Limbs = {
  813. Character:FindFirstChild("Right Arm"),
  814. Character:FindFirstChild("Left Arm"),
  815. Character:FindFirstChild("Right Leg"),
  816. Character:FindFirstChild("Left Leg")
  817. }
  818. if Joints[Limb] == nil then return false end
  819. if Limbs[Limb] == nil then return false end
  820. local Joint = Instance.new("Motor")
  821. Joint.Parent = Character.Torso
  822. Joint.Part0 = Character.Torso
  823. Joint.Part1 = Limbs[Limb]
  824. if Limb == 1 then
  825. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  826. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  827. Joint.Name = "Right Shoulder 2"
  828. elseif Limb == 2 then
  829. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  830. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  831. Joint.Name = "Left Shoulder 2"
  832. elseif Limb == 3 then
  833. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  834. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  835. Joint.Name = "Right Hip 2"
  836. elseif Limb == 4 then
  837. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  838. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  839. Joint.Name = "Left Hip 2"
  840. end
  841. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  842. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  843. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  844. Joints[Limb]:Remove()
  845. end
  846.  
  847.  
  848. function ResetLimbCFrame(Limb, Character)
  849. if Character == nil then return false end
  850. if Character.Parent == nil then return false end
  851. if Character:FindFirstChild("Torso") == nil then return false end
  852. local Joints = {
  853. Character.Torso:FindFirstChild("Right Shoulder 2"),
  854. Character.Torso:FindFirstChild("Left Shoulder 2"),
  855. Character.Torso:FindFirstChild("Right Hip 2"),
  856. Character.Torso:FindFirstChild("Left Hip 2")
  857. }
  858. local Limbs = {
  859. Character:FindFirstChild("Right Arm"),
  860. Character:FindFirstChild("Left Arm"),
  861. Character:FindFirstChild("Right Leg"),
  862. Character:FindFirstChild("Left Leg")
  863. }
  864. if Joints[Limb] == nil then return false end
  865. if Limbs[Limb] == nil then return false end
  866. if Limb == 1 then
  867. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  868. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  869. elseif Limb == 2 then
  870. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  871. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  872. elseif Limb == 3 then
  873. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  874. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  875. elseif Limb == 4 then
  876. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  877. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  878. end
  879. end
  880.  
  881.  
  882. function EnableLimb(Limb, Character)
  883. if Character == nil then return false end
  884. if Character:FindFirstChild("Torso") == nil then return false end
  885. local Joints = {
  886. Character.Torso:FindFirstChild("Right Shoulder 2"),
  887. Character.Torso:FindFirstChild("Left Shoulder 2"),
  888. Character.Torso:FindFirstChild("Right Hip 2"),
  889. Character.Torso:FindFirstChild("Left Hip 2")
  890. }
  891. local Limbs = {
  892. Character:FindFirstChild("Right Arm"),
  893. Character:FindFirstChild("Left Arm"),
  894. Character:FindFirstChild("Right Leg"),
  895. Character:FindFirstChild("Left Leg")
  896. }
  897. if Joints[Limb] == nil then return false end
  898. if Limbs[Limb] == nil then return false end
  899. if Limb == 1 then
  900. Joints[Limb].Name = "Right Shoulder"
  901. elseif Limb == 2 then
  902. Joints[Limb].Name = "Left Shoulder"
  903. elseif Limb == 3 then
  904. Joints[Limb].Name = "Right Hip"
  905. elseif Limb == 4 then
  906. Joints[Limb].Name = "Left Hip"
  907. end
  908. Animate = Character:FindFirstChild("Animate")
  909. if Animate == nil then return false end
  910. Animate = Animate:Clone()
  911. Character.Animate:Remove()
  912. Animate.Parent = Character
  913. end
  914.  
  915.  
  916. function playAnimation(format, mouse)
  917. if format == "equip" then
  918. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  919. local w = Instance.new("Weld")
  920. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  921. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  922. w.C0 = CFrame.new(0, 1.2, 0.7)
  923. w.C1 = CFrame.new()
  924. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  925. for i = 0.01, 1, 0.1 do
  926. if Player.Character:FindFirstChild("Torso") ~= nil then
  927. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  928. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  929. 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)
  930. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  931. 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)
  932. wait()
  933. else return false end
  934. else return false end
  935. end
  936. return playAnimation("hold")
  937. end
  938. if format == "rightEquip" then
  939. Player.Character[Name.. " (Holstered)"].Handle.Weld:Remove()
  940. local w = Instance.new("Weld")
  941. w.Part0 = Player.Character[Name.. " (Holstered)"].Handle
  942. w.Part1 = Player.Character:FindFirstChild("Right Arm")
  943. w.C0 = CFrame.new(0, 1.2, 0.7)
  944. w.C1 = CFrame.new()
  945. w.Parent = Player.Character[Name.. " (Holstered)"].Handle
  946. for i = 0.01, 1, 0.1 do
  947. if Player.Character:FindFirstChild("Torso") ~= nil then
  948. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  949. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  950. 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)
  951. wait()
  952. else return false end
  953. else return false end
  954. end
  955. return playAnimation("rightHold")
  956. end
  957. if format == "leftEquip" then
  958. Player.Character[Name.. " (Holstered, Left)"].Handle.Weld:Remove()
  959. local w = Instance.new("Weld")
  960. w.Part0 = Player.Character[Name.. " (Holstered, Left)"].Handle
  961. w.Part1 = Player.Character:FindFirstChild("Left Arm")
  962. w.C0 = CFrame.new(0, 1.2, 0.7)
  963. w.C1 = CFrame.new()
  964. w.Parent = Player.Character[Name.. " (Holstered, Left)"].Handle
  965. for i = 0.01, 1, 0.1 do
  966. if Player.Character:FindFirstChild("Torso") ~= nil then
  967. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  968. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  969. 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)
  970. wait()
  971. else return false end
  972. else return false end
  973. end
  974. return playAnimation("leftHold")
  975. end
  976. if format == "unequip" then
  977. for i = 1, 0.01, -0.1 do
  978. if Player.Character:FindFirstChild("Torso") ~= nil then
  979. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  980. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  981. 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)
  982. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  983. 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)
  984. wait()
  985. else return false end
  986. else return false end
  987. end
  988. return true
  989. end
  990. if format == "leftUnequip" then
  991. for i = 1, 0.01, -0.1 do
  992. if Player.Character:FindFirstChild("Torso") ~= nil then
  993. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  994. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  995. 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)
  996. wait()
  997. else return false end
  998. else return false end
  999. end
  1000. return true
  1001. end
  1002. if format == "rightUnequip" then
  1003. for i = 1, 0.01, -0.1 do
  1004. if Player.Character:FindFirstChild("Torso") ~= nil then
  1005. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1006. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1007. 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)
  1008. wait()
  1009. else return false end
  1010. else return false end
  1011. end
  1012. return true
  1013. end
  1014. if format == "hold" then
  1015. if Player.Character:FindFirstChild("Torso") ~= nil then
  1016. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1017. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1018. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  1019. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1020. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1021. else return false end
  1022. else return false end
  1023. end
  1024. if format == "rightHold" then
  1025. if Player.Character:FindFirstChild("Torso") ~= nil then
  1026. if Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1027. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1028. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(-10))
  1029. else return false end
  1030. else return false end
  1031. end
  1032. if format == "leftHold" then
  1033. if Player.Character:FindFirstChild("Torso") ~= nil then
  1034. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil then
  1035. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1036. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.7, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(10))
  1037. else return false end
  1038. else return false end
  1039. end
  1040. if format == "reload" then
  1041. Player.Character[Name].Handle.Empty:Play()
  1042. for i = 0, 25, 7.5 do
  1043. if Player.Character:FindFirstChild("Torso") ~= nil then
  1044. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1045. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1046. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1047. wait()
  1048. else return false end
  1049. else return false end
  1050. end
  1051. for i = 25, 0, -7.5 do
  1052. if Player.Character:FindFirstChild("Torso") ~= nil then
  1053. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1054. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1055. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  1056. wait()
  1057. else return false end
  1058. else return false end
  1059. end
  1060. coroutine.wrap(function()
  1061. for i = 0, 90, 15 do
  1062. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(i), 0) end)
  1063. wait()
  1064. end
  1065. pcall(function() Player.Character[Name].Pivot.Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0) end)
  1066. for i = 1, Loaded do
  1067. Player.Character[Name].Handle.Switch:Play()
  1068. makeShell(Player.Character[Name]:FindFirstChild("Cylinder"))
  1069. Loaded = Loaded - 1
  1070. if magazine.Value ~= 0 then
  1071. magazine.Value = magazine.Value - 1
  1072. updateGui()
  1073. end
  1074. wait(0.02)
  1075. end
  1076. end)()
  1077. CamShake(15, 50000)
  1078. Player.Character[Name].Handle.Release:Play()
  1079. --[[for i = 25, 0, -5 do
  1080. if Player.Character:FindFirstChild("Torso") ~= nil then
  1081. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1082. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1083. 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)))
  1084. wait()
  1085. else return false end
  1086. else return false end
  1087. end
  1088. for i = 25, 0, -5 do
  1089. if Player.Character:FindFirstChild("Torso") ~= nil then
  1090. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1091. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1092. 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)))
  1093. wait()
  1094. else return false end
  1095. else return false end
  1096. end
  1097. wait(0.18)--]]
  1098. for i = 0, 35, 5 do
  1099. if Player.Character:FindFirstChild("Torso") ~= nil then
  1100. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1101. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new()
  1102. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, -0.4, 0.3) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  1103. wait()
  1104. else return false end
  1105. else return false end
  1106. end
  1107. wait(0.2)
  1108. if ammo.Value >= 6 then
  1109. for i = 1, 6 do
  1110. for i = 5, 0, -1 do
  1111. if Player.Character:FindFirstChild("Torso") ~= nil then
  1112. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1113. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1114. 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))
  1115. wait()
  1116. else return false end
  1117. else return false end
  1118. end
  1119. Player.Character[Name].Handle.Reload:Play()
  1120. ammo.Value = ammo.Value - 1
  1121. magazine.Value = magazine.Value + 1
  1122. Loaded = Loaded + 1
  1123. updateGui()
  1124. wait(0.1)
  1125. end
  1126. elseif ammo.Value <= 6 then
  1127. for i = 1, ammo.Value do
  1128. for i = 5, 0, -1 do
  1129. if Player.Character:FindFirstChild("Torso") ~= nil then
  1130. if Player.Character.Torso:FindFirstChild("Left Shoulder 2") ~= nil and Player.Character.Torso:FindFirstChild("Right Shoulder 2") ~= nil then
  1131. Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new()
  1132. 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))
  1133. wait()
  1134. else return false end
  1135. else return false end
  1136. end
  1137. Player.Character[Name].Handle.Reload:Play()
  1138. ammo.Value = ammo.Value - 1
  1139. magazine.Value = magazine.Value + 1
  1140. Loaded = Loaded + 1
  1141. updateGui()
  1142. wait(0.1)
  1143. end
  1144. else end
  1145. wait(0.04)
  1146. coroutine.wrap(function()
  1147. for i = 1, 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