Guest User

Untitled

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