LeGoldenRobloxian

desert Eagle

Jun 2nd, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 61.61 KB | None | 0 0
  1. --[[
  2. Desert Eagle
  3. A humungous and powerful .44 (8-round capacity) weapon created by Magnum Research, inc.
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "Desert Eagle"
  11. AmmoType = ".44"
  12. MagazineCapacity = 8
  13. MagazineCapacityAdd = 1
  14. Player = Game:GetService("Players").LocalPlayer
  15. Char = Player.Character
  16. animate = Char:findFirstChild("Animate")
  17. if animate then
  18. animate:Destroy()
  19. end
  20. Selected = false
  21. Connected = false
  22. Button1Down = false
  23. CanUse = true
  24. Dual = script:FindFirstChild("Dual") ~= nil
  25.  
  26.  
  27. function CheckPlayer()
  28. if Player.Character == nil then return false end
  29. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Left Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  30. if Player.Character.Humanoid.Health <= 0 then return false end
  31. return true
  32. end
  33.  
  34.  
  35. function tagHumanoid(humanoid)
  36. local tag = Instance.new("ObjectValue")
  37. tag.Name = "creator"
  38. tag.Value = Player
  39. tag.Parent = humanoid
  40. end
  41.  
  42.  
  43. function untagHumanoid(humanoid)
  44. if humanoid ~= nil then
  45. local tag = humanoid:FindFirstChild("creator")
  46. if tag ~= nil then
  47. tag:Remove()
  48. end
  49. end
  50. end
  51.  
  52.  
  53. --[[
  54. CameraPunch v5
  55.  
  56. Functions:
  57. CameraPunch
  58. CameraSlide
  59. --]]
  60.  
  61.  
  62. function CameraPunch(X, Y)
  63. X, Y = X or math.rad(10), Y or math.rad(math.random(-10000, 10000) / 1000)
  64. Workspace.CurrentCamera.CoordinateFrame =
  65. CFrame.new(Workspace.CurrentCamera.Focus.p) *
  66. CFrame.fromEulerAnglesXYZ(CFrame.new(Workspace.CurrentCamera.CoordinateFrame.p, Workspace.CurrentCamera.Focus.p):toEulerAnglesXYZ()) *
  67. CFrame.fromEulerAnglesXYZ(X, Y, 0) *
  68. CFrame.new(0, 0, (Workspace.CurrentCamera.CoordinateFrame.p - Workspace.CurrentCamera.Focus.p).magnitude)
  69. end
  70.  
  71.  
  72. function CameraSlide(X, Y, Step)
  73. X, Y, Step = X or math.rad(10), Y or math.rad(math.random(-10000, 10000) / 1000), Step or 0.1
  74. for i = 0, 1, Step do
  75. CameraPunch(Step * X, Step * Y)
  76. wait()
  77. end
  78. end
  79.  
  80.  
  81. SoundToServer = function(Name, SoundId, Pitch, Volume, Looped, Parent)
  82. local Sound = Instance.new("Sound")
  83. Sound.Name = Name
  84. Sound.SoundId = SoundId
  85. Sound.Pitch = Pitch
  86. Sound.Volume = Volume
  87. Sound.Looped = Looped
  88. Sound.Parent = Parent
  89. Sound:Play()
  90. end
  91.  
  92.  
  93. function CreateParts(Parent, Format)
  94. if Parent == nil then return end
  95. local Parts = Instance.new("Model")
  96. Parts.Name = ModelName
  97. if Format == 1 then
  98. Parts.Name = Parts.Name.. " (Holstered)"
  99. elseif Format == 3 then
  100. Parts.Name = Parts.Name.. " (Holstered Dual)"
  101. elseif Format == 4 then
  102. Parts.Name = Parts.Name.. " (Dual)"
  103. end
  104. Parts.Parent = Parent
  105.  
  106. local MasterPart1 = Instance.new("Part")
  107. MasterPart1.Name = "Handle"
  108. MasterPart1.BrickColor = BrickColor.new("Dark stone grey")
  109. MasterPart1.TopSurface = 0
  110. MasterPart1.BottomSurface = 0
  111. MasterPart1.FormFactor = "Custom"
  112. MasterPart1.Size = Vector3.new(0.2, 1.3, 0.2)
  113. MasterPart1.Parent = Parts
  114. local Mesh = Instance.new("SpecialMesh", MasterPart1)
  115. Mesh.MeshType = "Brick"
  116. Mesh.Scale = Vector3.new(0.075 / 0.2, 1, 0.1 / 0.2)
  117. local Weld = Instance.new("Weld")
  118. Weld.Part0 = MasterPart1
  119. if Format == 1 then
  120. Weld.Part1 = Player.Character:FindFirstChild("Torso")
  121. Weld.C0 = CFrame.new(0.6, 0.4, -0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  122. Weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, math.rad(-20))
  123. elseif Format == 2 then
  124. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  125. Weld.C1 = CFrame.new(0, -1.5, -0.5)
  126. elseif Format == 3 then
  127. Weld.Part1 = Player.Character:FindFirstChild("Torso")
  128. Weld.C0 = CFrame.new(-0.6, 0.4, -0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  129. Weld.C1 = CFrame.fromEulerAnglesXYZ(0, 0, math.rad(20))
  130. elseif Format == 4 then
  131. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  132. Weld.C1 = CFrame.new(0, -1.5, -0.5)
  133. end
  134. Weld.Parent = Weld.Part0
  135.  
  136. local Part = Instance.new("Part")
  137. Part.Name = "Grip 1"
  138. Part.BrickColor = BrickColor.new("Dark stone grey")
  139. Part.TopSurface = 0
  140. Part.BottomSurface = 0
  141. Part.FormFactor = "Custom"
  142. Part.Size = Vector3.new(0.231, 0.3, 0.65)
  143. Part.Parent = Parts
  144. local Weld = Instance.new("Weld")
  145. Weld.Part0 = Part
  146. Weld.Part1 = MasterPart1
  147. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(8), 0, 0)
  148. Weld.C1 = CFrame.new(0, 0.425, 0.3)
  149. Weld.Parent = Weld.Part0
  150.  
  151. local Part = Instance.new("Part")
  152. Part.Name = "Magazine"
  153. Part.BrickColor = BrickColor.new("Really black")
  154. Part.TopSurface = 0
  155. Part.BottomSurface = 0
  156. Part.FormFactor = "Custom"
  157. Part.Size = Vector3.new(0.2, 0.24, 0.7)
  158. Part.Parent = Parts
  159. local Weld = Instance.new("Weld")
  160. Weld.Part0 = Part
  161. Weld.Part1 = MasterPart1
  162. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(8), 0, 0)
  163. Weld.C1 = CFrame.new(0, 0.41, 0.315)
  164. Weld.Parent = Weld.Part0
  165.  
  166. local Part = Instance.new("Part")
  167. Part.Name = "Grip 2"
  168. Part.BrickColor = BrickColor.new("Dark stone grey")
  169. Part.TopSurface = 0
  170. Part.BottomSurface = 0
  171. Part.FormFactor = "Custom"
  172. Part.Size = Vector3.new(0.23, 0.3, 0.2)
  173. Part.Parent = Parts
  174. local Mesh = Instance.new("SpecialMesh", Part)
  175. Mesh.MeshType = "Brick"
  176. Mesh.Scale = Vector3.new(1, 1, 0.1 / 0.2)
  177. local Weld = Instance.new("Weld")
  178. Weld.Part0 = Part
  179. Weld.Part1 = MasterPart1
  180. Weld.C0 = CFrame.new(0, -0.468, -0.65)
  181. Weld.Parent = Weld.Part0
  182.  
  183. local Part = Instance.new("WedgePart")
  184. Part.Name = "Grip 3"
  185. Part.BrickColor = BrickColor.new("Dark stone grey")
  186. Part.TopSurface = 0
  187. Part.BottomSurface = 0
  188. Part.FormFactor = "Custom"
  189. Part.Size = Vector3.new(0.23, 0.3, 0.2)
  190. Part.Parent = Parts
  191. local Weld = Instance.new("Weld")
  192. Weld.Part0 = Part
  193. Weld.Part1 = MasterPart1
  194. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0)
  195. Weld.C1 = CFrame.new(0, 0.53, 0.225)
  196. Weld.Parent = Weld.Part0
  197.  
  198. local Part = Instance.new("Part")
  199. Part.Name = "Grip 4"
  200. Part.BrickColor = BrickColor.new("Dark stone grey")
  201. Part.TopSurface = 0
  202. Part.BottomSurface = 0
  203. Part.FormFactor = "Custom"
  204. Part.Size = Vector3.new(0.23, 0.25, 0.2)
  205. Part.Parent = Parts
  206. local Mesh = Instance.new("SpecialMesh", Part)
  207. Mesh.MeshType = "Brick"
  208. Mesh.Scale = Vector3.new(1, 1, 0.05 / 0.2)
  209. local Weld = Instance.new("Weld")
  210. Weld.Part0 = Part
  211. Weld.Part1 = MasterPart1
  212. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-3), 0, 0)
  213. Weld.C1 = CFrame.new(0, 0.65, 0.075)
  214. Weld.Parent = Weld.Part0
  215.  
  216. local MasterPart2 = Instance.new("Part")
  217. MasterPart2.Name = "Slide"
  218. MasterPart2.BrickColor = BrickColor.new("Dark stone grey")
  219. MasterPart2.TopSurface = 0
  220. MasterPart2.BottomSurface = 0
  221. MasterPart2.FormFactor = "Custom"
  222. MasterPart2.Size = Vector3.new(0.25, 0.4, 0.3)
  223. MasterPart2.Parent = Parts
  224. local Weld = Instance.new("Weld")
  225. Weld.Part0 = MasterPart2
  226. Weld.Part1 = MasterPart1
  227. Weld.C0 = CFrame.new(0, -0.35, 0.1)
  228. Weld.C1 = CFrame.new(0, (function()
  229. if Format == 1 or Format == 2 then
  230. return script.Magazine.Value > 0 and 0 or 0.4
  231. elseif Format == 3 or Format == 4 then
  232. return script.Dual.Main.Magazine.Value > 0 and 0 or 0.4
  233. end
  234. end)(), 0)
  235. Weld.Parent = Weld.Part0
  236.  
  237. for i = -1, 1, 2 do
  238. local Part = Instance.new("WedgePart")
  239. Part.Name = "Slide Back"
  240. Part.BrickColor = BrickColor.new("Dark stone grey")
  241. Part.TopSurface = 0
  242. Part.BottomSurface = 0
  243. Part.FormFactor = "Custom"
  244. Part.Size = Vector3.new(0.2, 0.2, 0.3)
  245. Part.Parent = Parts
  246. local Mesh = Instance.new("SpecialMesh", Part)
  247. Mesh.MeshType = "Wedge"
  248. Mesh.Scale = Vector3.new(0.09 / 0.2, 0.1 / 0.2, 1)
  249. local Weld = Instance.new("Weld")
  250. Weld.Part0 = Part
  251. Weld.Part1 = MasterPart2
  252. Weld.C0 = CFrame.new(0.08 * i, -0.25, 0)
  253. Weld.Parent = Weld.Part0
  254. end
  255.  
  256. local Part = Instance.new("Part")
  257. Part.Name = "Slide Front"
  258. Part.BrickColor = BrickColor.new("Dark stone grey")
  259. Part.TopSurface = 0
  260. Part.BottomSurface = 0
  261. Part.FormFactor = "Custom"
  262. Part.Size = Vector3.new(0.25, 0.7, 0.2)
  263. Part.Parent = Parts
  264. local Mesh = Instance.new("SpecialMesh", Part)
  265. Mesh.MeshType = "Brick"
  266. Mesh.Scale = Vector3.new(1, 1, 0.125 / 0.2)
  267. local Weld = Instance.new("Weld")
  268. Weld.Part0 = Part
  269. Weld.Part1 = MasterPart2
  270. Weld.C0 = CFrame.new(0, 0.55, -0.09)
  271. Weld.Parent = Weld.Part0
  272.  
  273. local Part = Instance.new("Part")
  274. Part.Name = "Barrel 1"
  275. Part.BrickColor = BrickColor.new("Dark stone grey")
  276. Part.TopSurface = 0
  277. Part.BottomSurface = 0
  278. Part.FormFactor = "Custom"
  279. Part.Size = Vector3.new(0.25, 0.2, 0.25)
  280. Part.Parent = Parts
  281. Instance.new("CylinderMesh", Part)
  282. local Weld = Instance.new("Weld")
  283. Weld.Part0 = Part
  284. Weld.Part1 = MasterPart1
  285. Weld.C0 = CFrame.new(0, -0.05, 0.125)
  286. Weld.Parent = Weld.Part0
  287.  
  288. local Part = Instance.new("Part")
  289. Part.Name = "Barrel 2"
  290. Part.BrickColor = BrickColor.new("Dark stone grey")
  291. Part.TopSurface = 0
  292. Part.BottomSurface = 0
  293. Part.FormFactor = "Custom"
  294. Part.Size = Vector3.new(0.25, 0.2, 0.25)
  295. Part.Parent = Parts
  296. Instance.new("SpecialMesh", Part).MeshType = "Sphere"
  297. local Weld = Instance.new("Weld")
  298. Weld.Part0 = Part
  299. Weld.Part1 = MasterPart1
  300. Weld.C0 = CFrame.new(0, 0.05, 0.125)
  301. Weld.Parent = Weld.Part0
  302.  
  303. local Part = Instance.new("Part")
  304. Part.Name = "Barrel 3"
  305. Part.BrickColor = BrickColor.new("Dark stone grey")
  306. Part.TopSurface = 0
  307. Part.BottomSurface = 0
  308. Part.FormFactor = "Custom"
  309. Part.Size = Vector3.new(0.2, 0.7, 0.2)
  310. Part.Parent = Parts
  311. local Mesh = Instance.new("SpecialMesh", Part)
  312. Mesh.MeshType = "Brick"
  313. Mesh.Scale = Vector3.new(0.1 / 0.2, 1, 0.175 / 0.2)
  314. local Weld = Instance.new("Weld")
  315. Weld.Part0 = Part
  316. Weld.Part1 = MasterPart1
  317. Weld.C0 = CFrame.new(0, 0.4, 0.1375)
  318. Weld.Parent = Weld.Part0
  319.  
  320. for i = -1, 1, 2 do
  321. local Part = Instance.new("WedgePart")
  322. Part.Name = "Barrel 4 " ..i
  323. Part.BrickColor = BrickColor.new("Dark stone grey")
  324. Part.TopSurface = 0
  325. Part.BottomSurface = 0
  326. Part.FormFactor = "Custom"
  327. Part.Size = Vector3.new(0.7, 0.2, 0.2)
  328. Part.Parent = Parts
  329. local Mesh = Instance.new("SpecialMesh", Part)
  330. Mesh.MeshType = "Wedge"
  331. Mesh.Scale = Vector3.new(1, 0.075 / 0.2, 0.15 / 0.2)
  332. local Weld = Instance.new("Weld")
  333. Weld.Part0 = Part
  334. Weld.Part1 = MasterPart1
  335. Weld.C0 = CFrame.fromEulerAnglesXYZ(0, 0, math.rad(90 * i))
  336. Weld.C1 = CFrame.new(0.0875 * i, -0.4, -0.15)
  337. Weld.Parent = Weld.Part0
  338. end
  339.  
  340. local Part = Instance.new("Part")
  341. Part.Name = "Barrel 5"
  342. Part.BrickColor = BrickColor.new("Dark stone grey")
  343. Part.TopSurface = 0
  344. Part.BottomSurface = 0
  345. Part.FormFactor = "Custom"
  346. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  347. Part.Parent = Parts
  348. local Mesh = Instance.new("SpecialMesh", Part)
  349. Mesh.MeshType = "Brick"
  350. Mesh.Scale = Vector3.new(1, 1, 0.125 / 0.2)
  351. local Weld = Instance.new("Weld")
  352. Weld.Part0 = Part
  353. Weld.Part1 = MasterPart1
  354. Weld.C0 = CFrame.new(0, 0.65, 0.025)
  355. Weld.Parent = Weld.Part0
  356.  
  357. local Part = Instance.new("Part")
  358. Part.Name = "Trigger Guard 1"
  359. Part.BrickColor = BrickColor.new("Dark stone grey")
  360. Part.TopSurface = 0
  361. Part.BottomSurface = 0
  362. Part.FormFactor = "Custom"
  363. Part.Size = Vector3.new(0.2, 0.3, 0.2)
  364. Part.Parent = Parts
  365. local Mesh = Instance.new("SpecialMesh", Part)
  366. Mesh.MeshType = "Brick"
  367. Mesh.Scale = Vector3.new(0.5, 1, 0.05 / 0.2)
  368. local Weld = Instance.new("Weld")
  369. Weld.Part0 = Part
  370. Weld.Part1 = MasterPart1
  371. Weld.C0 = CFrame.new(0, -0.1, -0.075)
  372. Weld.Parent = Weld.Part0
  373.  
  374. local Part = Instance.new("Part")
  375. Part.Name = "Trigger Guard 2"
  376. Part.BrickColor = BrickColor.new("Dark stone grey")
  377. Part.TopSurface = 0
  378. Part.BottomSurface = 0
  379. Part.FormFactor = "Custom"
  380. Part.Size = Vector3.new(0.2, 0.25, 0.2)
  381. Part.Parent = Parts
  382. local Mesh = Instance.new("SpecialMesh", Part)
  383. Mesh.MeshType = "Brick"
  384. Mesh.Scale = Vector3.new(0.5, 1, 0.1)
  385. local Weld = Instance.new("Weld")
  386. Weld.Part0 = Part
  387. Weld.Part1 = MasterPart1
  388. Weld.C0 = CFrame.new(0, -0.15, -0.275)
  389. Weld.Parent = Weld.Part0
  390.  
  391. local Part = Instance.new("Part")
  392. Part.Name = "Trigger Guard 3"
  393. Part.BrickColor = BrickColor.new("Dark stone grey")
  394. Part.TopSurface = 0
  395. Part.BottomSurface = 0
  396. Part.FormFactor = "Custom"
  397. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  398. Part.Parent = Parts
  399. local Mesh = Instance.new("SpecialMesh", Part)
  400. Mesh.MeshType = "Brick"
  401. Mesh.Scale = Vector3.new(0.5, 0.1, 0.2 / 0.2)
  402. local Weld = Instance.new("Weld")
  403. Weld.Part0 = Part
  404. Weld.Part1 = MasterPart1
  405. Weld.C0 = CFrame.new(0, -0.015, -0.1825)
  406. Weld.Parent = Weld.Part0
  407.  
  408. local Part = Instance.new("Part")
  409. Part.Name = "Trigger"
  410. Part.BrickColor = BrickColor.new("Really black")
  411. Part.TopSurface = 0
  412. Part.BottomSurface = 0
  413. Part.FormFactor = "Custom"
  414. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  415. Part.Parent = Parts
  416. local Mesh = Instance.new("SpecialMesh", Part)
  417. Mesh.MeshType = "Brick"
  418. Mesh.Scale = Vector3.new(0.35, 0.1, 0.7)
  419. local Weld = Instance.new("Weld")
  420. Weld.Part0 = Part
  421. Weld.Part1 = MasterPart1
  422. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-15), 0, 0)
  423. Weld.C1 = CFrame.new(0, 0.14, 0.175)
  424. Weld.Parent = Weld.Part0
  425.  
  426. local Part = Instance.new("Part")
  427. Part.Name = "Source"
  428. Part.TopSurface = 0
  429. Part.BottomSurface = 0
  430. Part.FormFactor = "Custom"
  431. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  432. Part.CanCollide = false
  433. Part.Transparency = 1
  434. Part.Parent = Parts
  435. local Weld = Instance.new("Weld")
  436. Weld.Part0 = Part
  437. Weld.Part1 = MasterPart1
  438. Weld.C0 = CFrame.new(0, 0.9, 0.2)
  439. Weld.Parent = Weld.Part0
  440. local Fire = Instance.new("Fire", Part)
  441. Fire.Enabled = false
  442. Fire.Size = 2
  443. Fire.Heat = -10
  444. Fire.Color = Color3.new(0.9, 0.9, 0.4)
  445. Fire.SecondaryColor = Color3.new(0.3, 0.2, 0.2)
  446. local Smoke = Instance.new("Smoke", Part)
  447. Smoke.Enabled = false
  448. Smoke.Size = 3
  449. Smoke.RiseVelocity = -5
  450. Smoke.Color = Color3.new(0.85, 0.85, 0.85)
  451. Smoke.Opacity = 0.05
  452.  
  453. for _, Part in pairs(Parts:GetChildren()) do
  454. Part.Locked = true
  455. Part.CanCollide = false
  456. end
  457. end
  458.  
  459.  
  460. function RemoveParts(Parent, Format)
  461. if Format == 1 then
  462. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  463. elseif Format == 2 then
  464. pcall(function() Parent[ModelName]:Remove() end)
  465. elseif Format == 3 then
  466. pcall(function() Parent[ModelName.. " (Holstered Dual)"]:Remove() end)
  467. elseif Format == 4 then
  468. pcall(function() Parent[ModelName.. " (Dual)"]:Remove() end)
  469. end
  470. end
  471.  
  472.  
  473. function SetAngle(Joint, Angle, Character)
  474. if Character == nil then return false end
  475. local Joints = {
  476. Character.Torso:FindFirstChild("Right Shoulder 2"),
  477. Character.Torso:FindFirstChild("Left Shoulder 2"),
  478. Character.Torso:FindFirstChild("Right Hip 2"),
  479. Character.Torso:FindFirstChild("Left Hip 2")
  480. }
  481. if Joints[Joint] == nil then return false end
  482. if Joint == 1 or Joint == 3 then
  483. Joints[Joint].DesiredAngle = Angle
  484. end
  485. if Joint == 2 or Joint == 4 then
  486. Joints[Joint].DesiredAngle = -Angle
  487. end
  488. end
  489.  
  490.  
  491. function ForceAngle(Joint, Angle, Character)
  492. if Character == nil then return false end
  493. local Joints = {
  494. Character.Torso:FindFirstChild("Right Shoulder 2"),
  495. Character.Torso:FindFirstChild("Left Shoulder 2"),
  496. Character.Torso:FindFirstChild("Right Hip 2"),
  497. Character.Torso:FindFirstChild("Left Hip 2")
  498. }
  499. if Joints[Joint] == nil then return false end
  500. if Joint == 1 or Joint == 3 then
  501. Joints[Joint].DesiredAngle = Angle
  502. Joints[Joint].CurrentAngle = Angle
  503. end
  504. if Joint == 2 or Joint == 4 then
  505. Joints[Joint].DesiredAngle = -Angle
  506. Joints[Joint].CurrentAngle = -Angle
  507. end
  508. end
  509.  
  510.  
  511. function SetSpeed(Joint, Speed, Character)
  512. if Character == nil then return false end
  513. local Joints = {
  514. Character.Torso:FindFirstChild("Right Shoulder 2"),
  515. Character.Torso:FindFirstChild("Left Shoulder 2"),
  516. Character.Torso:FindFirstChild("Right Hip 2"),
  517. Character.Torso:FindFirstChild("Left Hip 2")
  518. }
  519. if Joints[Joint] == nil then return false end
  520. Joints[Joint].MaxVelocity = Speed
  521. end
  522.  
  523.  
  524. function DisableLimb(Limb, Character)
  525. if Character == nil then return false end
  526. if Character:FindFirstChild("Torso") == nil then return false end
  527. local Joints = {
  528. Character.Torso:FindFirstChild("Right Shoulder"),
  529. Character.Torso:FindFirstChild("Left Shoulder"),
  530. Character.Torso:FindFirstChild("Right Hip"),
  531. Character.Torso:FindFirstChild("Left Hip")
  532. }
  533. local Limbs = {
  534. Character:FindFirstChild("Right Arm"),
  535. Character:FindFirstChild("Left Arm"),
  536. Character:FindFirstChild("Right Leg"),
  537. Character:FindFirstChild("Left Leg")
  538. }
  539. if Joints[Limb] == nil then return false end
  540. if Limbs[Limb] == nil then return false end
  541. local Joint = Instance.new("Motor6D")
  542. Joint.Parent = Character.Torso
  543. Joint.Part0 = Character.Torso
  544. Joint.Part1 = Limbs[Limb]
  545. if Limb == 1 then
  546. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  547. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  548. Joint.Name = "Right Shoulder 2"
  549. elseif Limb == 2 then
  550. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  551. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  552. Joint.Name = "Left Shoulder 2"
  553. elseif Limb == 3 then
  554. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  555. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  556. Joint.Name = "Right Hip 2"
  557. elseif Limb == 4 then
  558. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  559. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  560. Joint.Name = "Left Hip 2"
  561. end
  562. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  563. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  564. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  565. Joints[Limb]:Remove()
  566. end
  567.  
  568.  
  569. function ResetLimbCFrame(Limb, Character)
  570. if Character == nil then return false end
  571. if Character.Parent == nil then return false end
  572. if Character:FindFirstChild("Torso") == nil then return false end
  573. local Joints = {
  574. Character.Torso:FindFirstChild("Right Shoulder 2"),
  575. Character.Torso:FindFirstChild("Left Shoulder 2"),
  576. Character.Torso:FindFirstChild("Right Hip 2"),
  577. Character.Torso:FindFirstChild("Left Hip 2")
  578. }
  579. local Limbs = {
  580. Character:FindFirstChild("Right Arm"),
  581. Character:FindFirstChild("Left Arm"),
  582. Character:FindFirstChild("Right Leg"),
  583. Character:FindFirstChild("Left Leg")
  584. }
  585. if Joints[Limb] == nil then return false end
  586. if Limbs[Limb] == nil then return false end
  587. if Limb == 1 then
  588. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  589. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  590. elseif Limb == 2 then
  591. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  592. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  593. elseif Limb == 3 then
  594. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  595. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  596. elseif Limb == 4 then
  597. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  598. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  599. end
  600. end
  601.  
  602.  
  603. function EnableLimb(Limb, Character)
  604. if Character == nil then return false end
  605. if Character:FindFirstChild("Torso") == nil then return false end
  606. local Joints = {
  607. Character.Torso:FindFirstChild("Right Shoulder 2"),
  608. Character.Torso:FindFirstChild("Left Shoulder 2"),
  609. Character.Torso:FindFirstChild("Right Hip 2"),
  610. Character.Torso:FindFirstChild("Left Hip 2")
  611. }
  612. local Limbs = {
  613. Character:FindFirstChild("Right Arm"),
  614. Character:FindFirstChild("Left Arm"),
  615. Character:FindFirstChild("Right Leg"),
  616. Character:FindFirstChild("Left Leg")
  617. }
  618. if Joints[Limb] == nil then return false end
  619. if Limbs[Limb] == nil then return false end
  620. if Limb == 1 then
  621. Joints[Limb].Name = "Right Shoulder"
  622. elseif Limb == 2 then
  623. Joints[Limb].Name = "Left Shoulder"
  624. elseif Limb == 3 then
  625. Joints[Limb].Name = "Right Hip"
  626. elseif Limb == 4 then
  627. Joints[Limb].Name = "Left Hip"
  628. end
  629. Animate = Character:FindFirstChild("Animate")
  630. if Animate == nil then return false end
  631. Animate = Animate:Clone()
  632. Character.Animate:Remove()
  633. Animate.Parent = Character
  634. end
  635.  
  636.  
  637. function onButton1Down(Mouse)
  638. if Button1Down == true then return end
  639. Button1Down = true
  640. if CheckPlayer() == false then return end
  641. if CanUse == true then
  642. SoundToServer("Click", "http://www.roblox.com/Asset/?id=2697295", 10, 0.8, false, Player.Character[ModelName].Handle)
  643. if script.Magazine.Value <= 0 then
  644. return
  645. end
  646. CanUse = false
  647. script.Magazine.Value = script.Magazine.Value - 1
  648. SoundToServer("Fire", "http://www.roblox.com/Asset/?id=2760979", 0.5, 1, false, Player.Character[ModelName].Handle)
  649. coroutine.wrap(function()
  650. pcall(function()
  651. Player.Character[ModelName].Source.Fire.Enabled = true
  652. Player.Character[ModelName].Source.Smoke.Enabled = true
  653. Player.Character[ModelName].Slide.Weld.C1 = CFrame.new(0, 0.4, 0)
  654. end)
  655. wait(0.075)
  656. pcall(function()
  657. Player.Character[ModelName].Source.Fire.Enabled = false
  658. Player.Character[ModelName].Source.Smoke.Enabled = false
  659. if script.Magazine.Value > 0 then
  660. Player.Character[ModelName].Slide.Weld.C1 = CFrame.new()
  661. end
  662. end)
  663. end)()
  664. pcall(function()
  665. local Shell = Instance.new("Part", Workspace)
  666. Shell.Name = "Shell"
  667. Shell.TopSurface = 0
  668. Shell.BottomSurface = 0
  669. Shell.FormFactor = "Custom"
  670. Shell.BrickColor = BrickColor.new("New Yeller")
  671. Shell.Size = Vector3.new(0.2, 0.3, 0.2)
  672. Shell.CFrame = Player.Character[ModelName].Handle.CFrame * CFrame.new(0.5, 0.5, -0.2) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
  673. Shell.Velocity = ((Player.Character[ModelName].Handle.Position - (Player.Character[ModelName].Handle.CFrame * CFrame.new(-1, 0, 0)).p).unit) * 40
  674. Shell:BreakJoints()
  675. local Mesh = Instance.new("CylinderMesh")
  676. Mesh.Scale = Vector3.new(0.5, 1, 0.5)
  677. Mesh.Parent = Shell
  678. game:GetService("Debris"):AddItem(Shell, 10)
  679. end)
  680. local Bullet = Instance.new("Part", Workspace)
  681. Bullet.Name = "Bullet"
  682. Bullet.TopSurface = 0
  683. Bullet.BottomSurface = 0
  684. Bullet.BrickColor = BrickColor.new("Really black")
  685. Bullet.Locked = true
  686. Bullet.FormFactor = "Custom"
  687. Bullet.Size = Vector3.new(0.2, 0.2, 0.2)
  688. Bullet.CFrame = Player.Character[ModelName].Source.CFrame * CFrame.new(0, -1.5, 0)
  689. Bullet.Elasticity = 0
  690. Bullet.Friction = 0
  691. local Mesh = Instance.new("SpecialMesh", Bullet)
  692. Mesh.MeshType = "Sphere"
  693. Mesh.Scale = Vector3.new(0.25, 0.25, 0.25)
  694. tagHumanoid(Bullet)
  695. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  696. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  697. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[ModelName].Source.Position).unit * 300) + Vector3.new(math.random(-2000, 2000) / 1000, math.random(-2000, 2000) / 1000, math.random(-2000, 2000) / 1000)
  698. game:GetService("Debris"):AddItem(Bullet, 2)
  699. debounce = false
  700. Bullet.Touched:connect(function(hit)
  701. if debounce == false then
  702. debounce = true
  703. isPlayer = hit.Parent:FindFirstChild("Humanoid")
  704. if isPlayer then
  705. isPlayer:TakeDamage(30)
  706. wait(0.5)
  707. end
  708. debounce = false
  709. end
  710. end)
  711. --TouchedToServer(BulletData, Bullet)
  712. CameraPunch(math.rad(math.random(5000, 6000) / 1000), math.rad(math.random(-7500, 7500) / 1000))
  713. SetSpeed(1, 0.1, Player.Character)
  714. SetAngle(1, math.rad(100), Player.Character)
  715. if Dual == false then
  716. SetSpeed(2, 0.1, Player.Character)
  717. SetAngle(2, math.rad(100), Player.Character)
  718. end
  719. wait(0.1)
  720. SetAngle(1, math.rad(90), Player.Character)
  721. if Dual == false then
  722. SetAngle(2, math.rad(90), Player.Character)
  723. end
  724. wait(0.1)
  725. CanUse = true
  726. end
  727. end
  728.  
  729.  
  730. function onButton1Up(Mouse)
  731. coroutine.wrap(function()
  732. wait(0.2)
  733. Button1Down = false
  734. end)()
  735. if Dual == true and Button1Down == true and CheckPlayer() == true then
  736. while CanUse == false do wait() end
  737. SoundToServer("Click", "http://www.roblox.com/Asset/?id=2697295", 10, 0.8, false, Player.Character[ModelName.. " (Dual)"].Handle)
  738. if script.Dual.Main.Magazine.Value <= 0 then
  739. return
  740. end
  741. CanUse = false
  742. script.Dual.Main.Magazine.Value = script.Dual.Main.Magazine.Value - 1
  743. SoundToServer("Fire", "http://www.roblox.com/Asset/?id=2760979", 0.5, 1, false, Player.Character[ModelName.. " (Dual)"].Handle)
  744. coroutine.wrap(function()
  745. pcall(function()
  746. Player.Character[ModelName.. " (Dual)"].Source.Fire.Enabled = true
  747. Player.Character[ModelName.. " (Dual)"].Source.Smoke.Enabled = true
  748. Player.Character[ModelName.. " (Dual)"].Slide.Weld.C1 = CFrame.new(0, 0.4, 0)
  749. end)
  750. wait(0.075)
  751. pcall(function()
  752. Player.Character[ModelName.. " (Dual)"].Source.Fire.Enabled = false
  753. Player.Character[ModelName.. " (Dual)"].Source.Smoke.Enabled = false
  754. if script.Dual.Main.Magazine.Value > 0 then
  755. Player.Character[ModelName.. " (Dual)"].Slide.Weld.C1 = CFrame.new()
  756. end
  757. end)
  758. end)()
  759. pcall(function()
  760. local Shell = Instance.new("Part", Workspace)
  761. Shell.Name = "Shell"
  762. Shell.TopSurface = 0
  763. Shell.BottomSurface = 0
  764. Shell.FormFactor = "Custom"
  765. Shell.BrickColor = BrickColor.new("New Yeller")
  766. Shell.Size = Vector3.new(0.2, 0.3, 0.2)
  767. Shell.CFrame = Player.Character[ModelName.. " (Dual)"].Handle.CFrame * CFrame.new(0.5, 0.5, -0.2) * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
  768. Shell.Velocity = ((Player.Character[ModelName.. " (Dual)"].Handle.Position - (Player.Character[ModelName.. " (Dual)"].Handle.CFrame * CFrame.new(-1, 0, 0)).p).unit) * 40
  769. Shell:BreakJoints()
  770. local Mesh = Instance.new("CylinderMesh")
  771. Mesh.Scale = Vector3.new(0.5, 1, 0.5)
  772. Mesh.Parent = Shell
  773. game:GetService("Debris"):AddItem(Shell, 10)
  774. end)
  775. local Bullet = Instance.new("Part", Workspace)
  776. Bullet.Name = "Bullet"
  777. Bullet.TopSurface = 0
  778. Bullet.BottomSurface = 0
  779. Bullet.BrickColor = BrickColor.new("Really black")
  780. Bullet.Locked = true
  781. Bullet.FormFactor = "Custom"
  782. Bullet.Size = Vector3.new(0.2, 0.2, 0.2)
  783. Bullet.CFrame = Player.Character[ModelName.. " (Dual)"].Source.CFrame * CFrame.new(0, -1.5, 0)
  784. Bullet.Elasticity = 0
  785. Bullet.Friction = 0
  786. local Mesh = Instance.new("SpecialMesh", Bullet)
  787. Mesh.MeshType = "Sphere"
  788. Mesh.Scale = Vector3.new(0.25, 0.25, 0.25)
  789. tagHumanoid(Bullet)
  790. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  791. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  792. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[ModelName.. " (Dual)"].Source.Position).unit * 240) + Vector3.new(math.random(-1500, 1500) / 1000, math.random(-1500, 1500) / 1000, math.random(-1500, 1500) / 1000)
  793. game:GetService("Debris"):AddItem(Bullet, 2)
  794. --TouchedToServer(BulletData, Bullet)
  795. CameraPunch(math.rad(math.random(1000, 3000) / 1000), math.rad(math.random(-1500, 1500) / 1000))
  796. SetSpeed(2, 0.1, Player.Character)
  797. SetAngle(2, math.rad(100), Player.Character)
  798. wait(0.1)
  799. SetAngle(2, math.rad(90), Player.Character)
  800. wait(0.1)
  801. CanUse = true
  802. end
  803. end
  804.  
  805.  
  806. function onKeyDown(Key, Mouse)
  807. if Selected == false then return end
  808. Key = Key:lower()
  809. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  810. if Key == "q" then
  811. if Mouse.Target == nil then return end
  812. if CheckPlayer() == false then return end
  813. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  814. if NewPlayer == nil then return end
  815. if NewPlayer.Character == nil then return end
  816. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  817. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 20 then return end
  818. onDeselected(Mouse)
  819. RemoveParts(Player.Character, 1)
  820. if Dual == true then RemoveParts(Player.Character, 3) end
  821. wait()
  822. script.Parent.Parent = NewPlayer.Backpack
  823. Player = NewPlayer
  824. elseif Key == "r" then
  825. if Player.Backpack.Ammo[AmmoType].Value <= 0 then return end
  826. if Dual == true then
  827. if script.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd and script.Dual.Main.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd then return end
  828. CanUse = false
  829. local Loaded = script.Magazine.Value > 0
  830. local LoadedDual = script.Dual.Main.Magazine.Value > 0
  831. local Add = math.min(script.Magazine.Value, MagazineCapacityAdd)
  832. local AddDual = math.min(script.Dual.Main.Magazine.Value, MagazineCapacityAdd)
  833. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value + script.Magazine.Value + script.Dual.Main.Magazine.Value - Add - AddDual
  834. script.Magazine.Value = Add
  835. script.Dual.Main.Magazine.Value = AddDual
  836. SoundToServer("Reload 1", "http://www.roblox.com/Asset/?id=10209834", 2, 1, false, Player.Character[ModelName].Handle)
  837. SoundToServer("Reload 1", "http://www.roblox.com/Asset/?id=10209834", 2, 1, false, Player.Character[ModelName.. " (Dual)"].Handle)
  838. pcall(function()
  839. local Clone = Player.Character[ModelName].Magazine:Clone()
  840. Clone.CanCollide = true
  841. Clone.Velocity = (Clone.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)).lookVector * 10
  842. Clone.Parent = Workspace
  843. game:GetService("Debris"):AddItem(Clone, 10)
  844. Player.Character[ModelName].Magazine.Transparency = 1
  845. end)
  846. pcall(function()
  847. local Clone = Player.Character[ModelName.. " (Dual)"].Magazine:Clone()
  848. Clone.CanCollide = true
  849. Clone.Velocity = (Clone.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)).lookVector * 10
  850. Clone.Parent = Workspace
  851. game:GetService("Debris"):AddItem(Clone, 10)
  852. Player.Character[ModelName.. " (Dual)"].Magazine.Transparency = 1
  853. end)
  854. SetSpeed(1, 0.04, Player.Character)
  855. SetAngle(1, math.rad(110), Player.Character)
  856. SetSpeed(2, 0.04, Player.Character)
  857. SetAngle(2, math.rad(110), Player.Character)
  858. wait(0.3)
  859. SetSpeed(1, 0.15, Player.Character)
  860. SetAngle(1, math.rad(0), Player.Character)
  861. SetSpeed(2, 0.15, Player.Character)
  862. SetAngle(2, math.rad(0), Player.Character)
  863. SoundToServer("Reload 2", "http://www.roblox.com/Asset/?id=10209845", 2.5, 1, false, Player.Character[ModelName].Handle)
  864. SoundToServer("Reload 2", "http://www.roblox.com/Asset/?id=10209845", 2.5, 1, false, Player.Character[ModelName.. " (Dual)"].Handle)
  865. wait(0.6)
  866. if Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity < 0 then
  867. script.Magazine.Value = Player.Backpack.Ammo[AmmoType].Value
  868. Player.Backpack.Ammo[AmmoType].Value = 0
  869. else
  870. script.Magazine.Value = script.Magazine.Value + MagazineCapacity
  871. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity
  872. end
  873. if Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity < 0 then
  874. script.Dual.Main.Magazine.Value = Player.Backpack.Ammo[AmmoType].Value
  875. Player.Backpack.Ammo[AmmoType].Value = 0
  876. else
  877. script.Dual.Main.Magazine.Value = script.Dual.Main.Magazine.Value + MagazineCapacity
  878. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity
  879. end
  880. pcall(function() Player.Character[ModelName].Magazine.Transparency = 0 end)
  881. pcall(function() Player.Character[ModelName.. " (Dual)"].Magazine.Transparency = 0 end)
  882. SetSpeed(1, 0.2, Player.Character)
  883. SetAngle(1, math.rad(90), Player.Character)
  884. SetSpeed(2, 0.2, Player.Character)
  885. SetAngle(2, math.rad(90), Player.Character)
  886. wait(0.4)
  887. if Loaded == false or LoadedDual == false then
  888. if Loaded == false then
  889. SoundToServer("Reload 3", "http://www.roblox.com/Asset/?id=10209894", 3, 1, false, Player.Character[ModelName].Handle)
  890. wait(0.2)
  891. for i = 1, 0, -0.35 do
  892. pcall(function() Player.Character[ModelName].Slide.Weld.C1 = CFrame.new(0, 0.4 * i, 0) end)
  893. wait()
  894. end
  895. pcall(function() Player.Character[ModelName].Slide.Weld.C1 = CFrame.new() end)
  896. end
  897. if LoadedDual == false then
  898. SoundToServer("Reload 3", "http://www.roblox.com/Asset/?id=10209894", 3, 1, false, Player.Character[ModelName.. " (Dual)"].Handle)
  899. wait(0.2)
  900. for i = 1, 0, -0.35 do
  901. pcall(function() Player.Character[ModelName.. " (Dual)"].Slide.Weld.C1 = CFrame.new(0, 0.4 * i, 0) end)
  902. wait()
  903. end
  904. pcall(function() Player.Character[ModelName.. " (Dual)"].Slide.Weld.C1 = CFrame.new() end)
  905. end
  906. end
  907. CanUse = true
  908. else
  909. if script.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd then return end
  910. CanUse = false
  911. local Loaded = script.Magazine.Value > 0
  912. local Add = math.min(script.Magazine.Value, MagazineCapacityAdd)
  913. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value + script.Magazine.Value - Add
  914. script.Magazine.Value = Add
  915. SetSpeed(1, 0.1, Player.Character)
  916. SetAngle(1, math.rad(110), Player.Character)
  917. SetSpeed(2, 0.1, Player.Character)
  918. SetAngle(2, 0, Player.Character)
  919. SoundToServer("Reload 1", "http://www.roblox.com/Asset/?id=10209834", 2, 1, false, Player.Character[ModelName].Handle)
  920. pcall(function()
  921. local Clone = Player.Character[ModelName].Magazine:Clone()
  922. Clone.CanCollide = true
  923. Clone.Velocity = (Clone.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)).lookVector * 5
  924. Clone.Parent = Workspace
  925. game:GetService("Debris"):AddItem(Clone, 10)
  926. Player.Character[ModelName].Magazine.Transparency = 1
  927. end)
  928. for i = 1, 0, -0.05 do
  929. pcall(function()
  930. Player.Character.Torso["Left Shoulder 2"].C0 =
  931. CFrame.new(-1.5 + (0.9 * i), 0.5 - (0.05 * i), -0.4 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) - math.rad(45 * i), 0)
  932. Player.Character.Torso["Left Shoulder 2"].C1 =
  933. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  934. end)
  935. wait()
  936. end
  937. pcall(function()
  938. local Magazine = Player.Character[ModelName].Magazine:Clone()
  939. Magazine.Name = "New Magazine"
  940. Magazine.Transparency = 0
  941. Magazine.Parent = Player.Character[ModelName]
  942. local Weld = Instance.new("Weld", Magazine)
  943. Weld.Part0 = Weld.Parent
  944. Weld.Part1 = Player.Character["Left Arm"]
  945. Weld.C0 = CFrame.fromEulerAnglesXYZ(0, math.rad(-10), math.rad(45))
  946. Weld.C1 = CFrame.new(0.2, -1, -0.4)
  947. end)
  948. SetSpeed(1, 0.025, Player.Character)
  949. SetAngle(1, math.rad(90), Player.Character)
  950. SetAngle(2, math.rad(85), Player.Character)
  951. SoundToServer("Reload 2", "http://www.roblox.com/Asset/?id=10209845", 2, 1, false, Player.Character[ModelName].Handle)
  952. for i = 0, 1, 0.1 do
  953. pcall(function()
  954. Player.Character.Torso["Left Shoulder 2"].C0 =
  955. CFrame.new(-1.5 + (0.9 * i), 0.5 - (0.05 * i), -0.4 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90 - (30 * i)), 0)
  956. Player.Character.Torso["Left Shoulder 2"].C1 =
  957. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  958. Player.Character.Torso["Right Shoulder 2"].C0 =
  959. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (10 * i)), 0)
  960. Player.Character.Torso["Right Shoulder 2"].C1 =
  961. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  962. end)
  963. wait()
  964. end
  965. pcall(function()
  966. Player.Character.Torso["Left Shoulder 2"].C0 =
  967. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-120), 0)
  968. Player.Character.Torso["Left Shoulder 2"].C1 =
  969. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  970. Player.Character.Torso["Right Shoulder 2"].C0 =
  971. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(100), 0)
  972. Player.Character.Torso["Right Shoulder 2"].C1 =
  973. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  974. end)
  975. wait(0.1)
  976. pcall(function()
  977. Player.Character[ModelName].Magazine.Transparency = 0
  978. Player.Character[ModelName]["New Magazine"]:Remove()
  979. end)
  980. if Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity < 0 then
  981. script.Magazine.Value = Player.Backpack.Ammo[AmmoType].Value
  982. Player.Backpack.Ammo[AmmoType].Value = 0
  983. else
  984. script.Magazine.Value = script.Magazine.Value + MagazineCapacity
  985. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity
  986. end
  987. if Loaded == true then
  988. SetAngle(2, math.rad(100), Player.Character)
  989. SetAngle(2, math.rad(90), Player.Character)
  990. wait(0.1)
  991. for i = 0, 1, 0.1 do
  992. pcall(function()
  993. Player.Character.Torso["Left Shoulder 2"].C0 =
  994. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-120 - (15 * i)), 0)
  995. Player.Character.Torso["Left Shoulder 2"].C1 =
  996. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  997. Player.Character.Torso["Right Shoulder 2"].C0 =
  998. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(100 - (10 * i)), 0)
  999. Player.Character.Torso["Right Shoulder 2"].C1 =
  1000. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1001. end)
  1002. wait()
  1003. end
  1004. else
  1005. wait(0.5)
  1006. SoundToServer("Reload 3", "http://www.roblox.com/Asset/?id=10209894", 3, 1, false, Player.Character[ModelName].Handle)
  1007. pcall(function()
  1008. Player.Character.Torso["Left Shoulder 2"].C0 =
  1009. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-120), 0)
  1010. Player.Character.Torso["Left Shoulder 2"].C1 =
  1011. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1012. end)
  1013. SetSpeed(2, 0.1, Player.Character)
  1014. SetAngle(2, math.rad(110), Player.Character)
  1015. for i = 0, 1, 0.2 do
  1016. pcall(function()
  1017. Player.Character.Torso["Right Shoulder 2"].C0 =
  1018. CFrame.new(0.6, 0.55, -0.1 + (0.2 * i)) * CFrame.fromEulerAnglesXYZ(0, math.rad(100), 0)
  1019. Player.Character.Torso["Right Shoulder 2"].C1 =
  1020. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1021. end)
  1022. wait()
  1023. end
  1024. wait(0.1)
  1025. coroutine.wrap(function()
  1026. for i = 1, 0, -0.3 do
  1027. pcall(function() Player.Character[ModelName].Slide.Weld.C1 = CFrame.new(0, 0.3 * i, 0) end)
  1028. wait()
  1029. end
  1030. pcall(function() Player.Character[ModelName].Slide.Weld.C1 = CFrame.new() end)
  1031. end)()
  1032. SetAngle(2, math.rad(90), Player.Character)
  1033. for i = 0, 1, 0.2 do
  1034. pcall(function()
  1035. Player.Character.Torso["Left Shoulder 2"].C0 =
  1036. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-120 - (15 * i)), 0)
  1037. Player.Character.Torso["Left Shoulder 2"].C1 =
  1038. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1039. Player.Character.Torso["Right Shoulder 2"].C0 =
  1040. CFrame.new(0.6, 0.55, 0.1 - (0.2 * i)) * CFrame.fromEulerAnglesXYZ(0, math.rad(100 - (10 * i)), 0)
  1041. Player.Character.Torso["Right Shoulder 2"].C1 =
  1042. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1043. end)
  1044. wait()
  1045. end
  1046. end
  1047. pcall(function()
  1048. Player.Character.Torso["Left Shoulder 2"].C0 =
  1049. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-135), 0)
  1050. Player.Character.Torso["Left Shoulder 2"].C1 =
  1051. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1052. Player.Character.Torso["Right Shoulder 2"].C0 =
  1053. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1054. Player.Character.Torso["Right Shoulder 2"].C1 =
  1055. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1056. end)
  1057. CanUse = true
  1058. end
  1059. elseif Key == "g" then
  1060. CanUse = false
  1061. SetSpeed(2, 0.1, Player.Character)
  1062. SetAngle(2, math.rad(10), Player.Character)
  1063. for i = 0, 1, 0.1 do
  1064. pcall(function()
  1065. Player.Character.Torso["Right Shoulder 2"].C0 =
  1066. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 + (60 * i)), 0)
  1067. end)
  1068. CameraPunch(0, math.rad(6))
  1069. wait()
  1070. end
  1071. SoundToServer("Slash", "rbxasset://sounds/swordslash.wav", 1.8, 1, false, Player.Character.Torso)
  1072. local HasHit = false
  1073. local _, HitConnection = pcall(function() return Player.Character[ModelName].Handle.Touched:connect(function(Hit)
  1074. if HasHit == true or Hit:IsDescendantOf(Player.Character) then return end
  1075. HasHit = true
  1076. SoundToServer("Bash", "http://www.roblox.com/Asset/?id=46153268", 1, 0.25, false, Player.Character.Torso)
  1077. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  1078. if Humanoid ~= nil then
  1079. tagHumanoid(Humanoid)
  1080. Humanoid:TakeDamage(50)
  1081. pcall(function()
  1082. Humanoid.Sit = true
  1083. Hit.Parent.Torso.Velocity = (Player.Character.Torso.Position - (Player.Character.Torso.CFrame * CFrame.new(-1, 0.6, 0.5)).p).unit * 150
  1084. end)
  1085. wait()
  1086. pcall(function() untagHumanoid(Humanoid) end)
  1087. end
  1088. end) end)
  1089. for i = 1, 0, -0.2 do
  1090. pcall(function()
  1091. Player.Character.Torso["Right Shoulder 2"].C0 =
  1092. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(150 * i), 0)
  1093. end)
  1094. CameraPunch(0, math.rad(-24))
  1095. wait()
  1096. end
  1097. pcall(function() HitConnection:disconnect() end)
  1098. SetSpeed(2, 0.2, Player.Character)
  1099. SetAngle(2, math.rad(90), Player.Character)
  1100. for i = 0, 1, 0.1 do
  1101. pcall(function()
  1102. Player.Character.Torso["Right Shoulder 2"].C0 =
  1103. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), 0)
  1104. end)
  1105. CameraPunch(0, math.rad(6))
  1106. wait()
  1107. end
  1108. pcall(function()
  1109. Player.Character.Torso["Right Shoulder 2"].C0 =
  1110. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1111. end)
  1112. CanUse = true
  1113. elseif Key == "y" then
  1114. if Dual == false then
  1115. local Weapon = nil
  1116. for _, Part in pairs(Player.Backpack:GetChildren()) do
  1117. if Part.Name == ModelName and Part ~= script.Parent then
  1118. if Part.Main:FindFirstChild("Dual") == nil then
  1119. Weapon = Part
  1120. break
  1121. end
  1122. end
  1123. end
  1124. if Weapon == nil then return end
  1125. CanUse = false
  1126. SetSpeed(2, 0.3, Player.Character)
  1127. SetAngle(2, math.rad(-40), Player.Character)
  1128. for i = 1, 0, -0.1 do
  1129. pcall(function()
  1130. Player.Character.Torso["Left Shoulder 2"].C0 =
  1131. CFrame.new(-1.5 + (0.9 * i), 0.5 - (0.05 * i), -0.4 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) - math.rad(45 * i), 0)
  1132. Player.Character.Torso["Left Shoulder 2"].C1 =
  1133. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1134. end)
  1135. wait()
  1136. end
  1137. for i = 0, 1, 0.2 do
  1138. pcall(function()
  1139. Player.Character.Torso["Left Shoulder 2"].C0 =
  1140. CFrame.new(-1.5 + (0.2 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) + math.rad(40 * i), 0)
  1141. Player.Character.Torso["Left Shoulder 2"].C1 =
  1142. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1143. end)
  1144. wait()
  1145. end
  1146. Weapon.Name = "Dual"
  1147. Weapon.Parent = script
  1148. Dual = true
  1149. RemoveParts(Player.Character, 1)
  1150. CreateParts(Player.Character, 4)
  1151. UpdateFirstPerson(true)
  1152. SetSpeed(2, 0.6, Player.Character)
  1153. SetAngle(2, math.rad(90), Player.Character)
  1154. for i = 0, 1, 0.15 do
  1155. pcall(function()
  1156. Player.Character.Torso["Left Shoulder 2"].C0 =
  1157. CFrame.new(-1.3 + (0.7 * i), 0.5 + (0.05 * i), -0.1 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-50) - math.rad(40 * i), 0)
  1158. Player.Character.Torso["Left Shoulder 2"].C1 =
  1159. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1160. end)
  1161. wait()
  1162. end
  1163. pcall(function()
  1164. Player.Character.Torso["Left Shoulder 2"].C0 =
  1165. CFrame.new(-0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1166. Player.Character.Torso["Left Shoulder 2"].C1 =
  1167. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1168. end)
  1169. else
  1170. CanUse = false
  1171. SetSpeed(2, 0.25, Player.Character)
  1172. SetAngle(2, math.rad(-40), Player.Character)
  1173. for i = 1, 0, -0.1 do
  1174. pcall(function()
  1175. Player.Character.Torso["Left Shoulder 2"].C0 =
  1176. CFrame.new(-1.3 + (0.7 * i), 0.5 + (0.05 * i), -0.1 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-50) - math.rad(40 * i), 0)
  1177. Player.Character.Torso["Left Shoulder 2"].C1 =
  1178. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1179. end)
  1180. wait()
  1181. end
  1182. RemoveParts(Player.Character, 4)
  1183. CreateParts(Player.Character, 1)
  1184. UpdateFirstPerson(true)
  1185. Dual = false
  1186. local Weapon = script.Dual
  1187. Weapon.Name = ModelName
  1188. Weapon.Parent = Player.Backpack
  1189. SetSpeed(2, 0.3, Player.Character)
  1190. SetAngle(2, 0, Player.Character)
  1191. for i = 1, 0, -0.2 do
  1192. pcall(function()
  1193. Player.Character.Torso["Left Shoulder 2"].C0 =
  1194. CFrame.new(-1.5 + (0.2 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) + math.rad(40 * i), 0)
  1195. Player.Character.Torso["Left Shoulder 2"].C1 =
  1196. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1197. end)
  1198. wait()
  1199. end
  1200. SetSpeed(2, 0.3, Player.Character)
  1201. SetAngle(2, math.rad(90), Player.Character)
  1202. for i = 0, 1, 0.1 do
  1203. pcall(function()
  1204. Player.Character.Torso["Left Shoulder 2"].C0 =
  1205. CFrame.new(-1.5 + (0.9 * i), 0.5 - (0.05 * i), -0.4 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) - math.rad(45 * i), 0)
  1206. Player.Character.Torso["Left Shoulder 2"].C1 =
  1207. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1208. end)
  1209. wait()
  1210. end
  1211. pcall(function()
  1212. Player.Character.Torso["Left Shoulder 2"].C0 =
  1213. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-135), 0)
  1214. Player.Character.Torso["Left Shoulder 2"].C1 =
  1215. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1216. end)
  1217. end
  1218. CanUse = true
  1219. end
  1220. end
  1221. end
  1222.  
  1223.  
  1224. function onSelected(Mouse)
  1225. if Selected == true or CanUse == false then return end
  1226. CanUse = false
  1227. while true do
  1228. if CheckPlayer() == true then
  1229. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil and Player.Character.Torso:FindFirstChild("Left Shoulder") ~= nil then
  1230. break
  1231. end
  1232. end
  1233. wait(0.1)
  1234. end
  1235. Selected = true
  1236. DisableLimb(1, Player.Character)
  1237. SetSpeed(1, 0.3, Player.Character)
  1238. SetAngle(1, math.rad(-40), Player.Character)
  1239. if Dual == true then
  1240. DisableLimb(2, Player.Character)
  1241. SetSpeed(2, 0.3, Player.Character)
  1242. SetAngle(2, math.rad(-40), Player.Character)
  1243. end
  1244. for i = 0, 1, 0.2 do
  1245. pcall(function()
  1246. Player.Character.Torso["Right Shoulder 2"].C0 =
  1247. CFrame.new(1.5 - (0.2 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) - math.rad(40 * i), 0)
  1248. Player.Character.Torso["Right Shoulder 2"].C1 =
  1249. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1250. end)
  1251. if Dual == true then
  1252. pcall(function()
  1253. Player.Character.Torso["Left Shoulder 2"].C0 =
  1254. CFrame.new(-1.5 + (0.2 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) + math.rad(40 * i), 0)
  1255. Player.Character.Torso["Left Shoulder 2"].C1 =
  1256. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1257. end)
  1258. end
  1259. wait()
  1260. end
  1261. RemoveParts(Player.Character, 1)
  1262. CreateParts(Player.Character, 2)
  1263. SetSpeed(1, 0.6, Player.Character)
  1264. SetAngle(1, math.rad(90), Player.Character)
  1265. if Dual == true then
  1266. RemoveParts(Player.Character, 3)
  1267. CreateParts(Player.Character, 4)
  1268. SetSpeed(2, 0.6, Player.Character)
  1269. SetAngle(2, math.rad(90), Player.Character)
  1270. else
  1271. DisableLimb(2, Player.Character)
  1272. SetSpeed(2, 0.3, Player.Character)
  1273. SetAngle(2, math.rad(90), Player.Character)
  1274. end
  1275. for i = 0, 1, 0.15 do
  1276. pcall(function()
  1277. Player.Character.Torso["Right Shoulder 2"].C0 =
  1278. CFrame.new(1.3 - (0.7 * i), 0.5 + (0.05 * i), -0.1 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(50) + math.rad(40 * i), 0)
  1279. Player.Character.Torso["Right Shoulder 2"].C1 =
  1280. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1281. end)
  1282. if Dual == true then
  1283. pcall(function()
  1284. Player.Character.Torso["Left Shoulder 2"].C0 =
  1285. CFrame.new(-1.3 + (0.7 * i), 0.5 + (0.05 * i), -0.1 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-50) - math.rad(40 * i), 0)
  1286. Player.Character.Torso["Left Shoulder 2"].C1 =
  1287. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1288. end)
  1289. else
  1290. pcall(function()
  1291. Player.Character.Torso["Left Shoulder 2"].C0 =
  1292. CFrame.new(-1.5 + (0.9 * i), 0.5 - (0.05 * i), -0.4 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) - math.rad(45 * i), 0)
  1293. Player.Character.Torso["Left Shoulder 2"].C1 =
  1294. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1295. end)
  1296. end
  1297. wait()
  1298. end
  1299. pcall(function()
  1300. Player.Character.Torso["Right Shoulder 2"].C0 =
  1301. CFrame.new(0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1302. Player.Character.Torso["Right Shoulder 2"].C1 =
  1303. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1304. end)
  1305. if Dual == true then
  1306. pcall(function()
  1307. Player.Character.Torso["Left Shoulder 2"].C0 =
  1308. CFrame.new(-0.6, 0.55, -0.1) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1309. Player.Character.Torso["Left Shoulder 2"].C1 =
  1310. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1311. end)
  1312. else
  1313. pcall(function()
  1314. Player.Character.Torso["Left Shoulder 2"].C0 =
  1315. CFrame.new(-0.6, 0.45, -0.4) * CFrame.fromEulerAnglesXYZ(0, math.rad(-135), 0)
  1316. Player.Character.Torso["Left Shoulder 2"].C1 =
  1317. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1318. end)
  1319. end
  1320. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1321. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  1322. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  1323. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  1324. CanUse = true
  1325. end
  1326.  
  1327.  
  1328. function onDeselected(Mouse)
  1329. if Selected == false then return end
  1330. Selected = false
  1331. while CanUse == false do wait() end
  1332. if CheckPlayer() == false or pcall(function() local _ = Player.Character.Torso["Right Shoulder 2"] end) == false then
  1333. RemoveParts(Player.Character, 2)
  1334. CreateParts(Player.Character, 1)
  1335. if Dual == true then
  1336. RemoveParts(Player.Character, 4)
  1337. CreateParts(Player.Character, 3)
  1338. end
  1339. SetAngle(1, 0, Player.Character)
  1340. ResetLimbCFrame(1, Player.Character)
  1341. EnableLimb(1, Player.Character)
  1342. SetAngle(2, 0, Player.Character)
  1343. ResetLimbCFrame(2, Player.Character)
  1344. EnableLimb(2, Player.Character)
  1345. return
  1346. end
  1347. if Selected == true then return end
  1348. CanUse = false
  1349. SetSpeed(1, 0.25, Player.Character)
  1350. SetAngle(1, math.rad(-40), Player.Character)
  1351. if Dual == true then
  1352. SetSpeed(2, 0.25, Player.Character)
  1353. SetAngle(2, math.rad(-40), Player.Character)
  1354. else
  1355. SetSpeed(2, 0.3, Player.Character)
  1356. SetAngle(2, 0, Player.Character)
  1357. end
  1358. for i = 1, 0, -0.1 do
  1359. pcall(function()
  1360. Player.Character.Torso["Right Shoulder 2"].C0 =
  1361. CFrame.new(1.3 - (0.7 * i), 0.5 + (0.05 * i), -0.1 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(50) + math.rad(40 * i), 0)
  1362. Player.Character.Torso["Right Shoulder 2"].C1 =
  1363. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1364. end)
  1365. if Dual == true then
  1366. pcall(function()
  1367. Player.Character.Torso["Left Shoulder 2"].C0 =
  1368. CFrame.new(-1.3 + (0.7 * i), 0.5 + (0.05 * i), -0.1 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-50) - math.rad(40 * i), 0)
  1369. Player.Character.Torso["Left Shoulder 2"].C1 =
  1370. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1371. end)
  1372. else
  1373. pcall(function()
  1374. Player.Character.Torso["Left Shoulder 2"].C0 =
  1375. CFrame.new(-1.5 + (0.9 * i), 0.5 - (0.05 * i), -0.4 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) - math.rad(45 * i), 0)
  1376. Player.Character.Torso["Left Shoulder 2"].C1 =
  1377. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1378. end)
  1379. end
  1380. wait()
  1381. end
  1382. RemoveParts(Player.Character, 2)
  1383. CreateParts(Player.Character, 1)
  1384. SetSpeed(1, 0.3, Player.Character)
  1385. SetAngle(1, 0, Player.Character)
  1386. if Dual == true then
  1387. RemoveParts(Player.Character, 4)
  1388. CreateParts(Player.Character, 3)
  1389. SetSpeed(2, 0.3, Player.Character)
  1390. SetAngle(2, 0, Player.Character)
  1391. else
  1392. ResetLimbCFrame(2, Player.Character)
  1393. EnableLimb(2, Player.Character)
  1394. end
  1395. for i = 1, 0, -0.2 do
  1396. pcall(function()
  1397. Player.Character.Torso["Right Shoulder 2"].C0 =
  1398. CFrame.new(1.5 - (0.2 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90) - math.rad(40 * i), 0)
  1399. Player.Character.Torso["Right Shoulder 2"].C1 =
  1400. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  1401. end)
  1402. if Dual == true then
  1403. pcall(function()
  1404. Player.Character.Torso["Left Shoulder 2"].C0 =
  1405. CFrame.new(-1.5 + (0.2 * i), 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90) + math.rad(40 * i), 0)
  1406. Player.Character.Torso["Left Shoulder 2"].C1 =
  1407. CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  1408. end)
  1409. end
  1410. wait()
  1411. end
  1412. ResetLimbCFrame(1, Player.Character)
  1413. EnableLimb(1, Player.Character)
  1414. if Dual == true then
  1415. ResetLimbCFrame(2, Player.Character)
  1416. EnableLimb(2, Player.Character)
  1417. end
  1418. CanUse = true
  1419. end
  1420.  
  1421.  
  1422. if script.Parent.ClassName ~= "HopperBin" then
  1423. if Player == nil then print("Error: Player not found!") return end
  1424. Tool = Instance.new("HopperBin")
  1425. Tool.Name = ModelName
  1426. Tool.Parent = Player.Backpack
  1427. Instance.new("IntValue", script).Name = "Magazine"
  1428. script.Name = "Main"
  1429. script.Parent = Tool
  1430. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  1431. Connected = true
  1432. Player = script.Parent.Parent.Parent
  1433. end wait() if script.Parent.ClassName == "HopperBin" then
  1434. while script.Parent.Parent.ClassName ~= "Backpack" do
  1435. wait()
  1436. end
  1437. Instance.new("Configuration", Player.Backpack).Name = "Ammo"
  1438. Instance.new("IntValue", Player.Backpack.Ammo).Name = AmmoType
  1439. Player.Backpack.Ammo[AmmoType].Value = MagazineCapacity * 3
  1440. script.Parent.Selected:connect(onSelected)
  1441. script.Parent.Deselected:connect(onDeselected)
  1442. CreateParts(Player.Character, 1)
  1443. if Dual == true then CreateParts(Player.Character, 3) end
  1444. --[[
  1445. MouseAim v11
  1446. --]]
  1447.  
  1448.  
  1449. script.Parent.Selected:connect(function(Mouse)
  1450. while Selected == false do wait() end
  1451. while Selected == true do
  1452. if script.Parent == nil then break end
  1453. if Player.Character:FindFirstChild("Humanoid") == nil or Player.Character:FindFirstChild("Torso") == nil then break end
  1454. if Player.Character.Humanoid.Health > 0 and Player.Character.Humanoid.Sit == false and Player.Character.Humanoid.PlatformStand == false and Player.Character.Torso:FindFirstChild("BodyGyro") == nil and Player.Character.Torso:FindFirstChild("BodyAngularVelocity") == nil and Player.Character:FindFirstChild("Ragdoll") == nil then
  1455. local AimGyro = Instance.new("BodyGyro")
  1456. game:GetService("Debris"):AddItem(AimGyro, 0)
  1457. AimGyro.Parent = Player.Character.Torso
  1458. AimGyro.Name = "AimGyro"
  1459. AimGyro.P = 40000
  1460. AimGyro.D = 300
  1461. AimGyro.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  1462. AimGyro.cframe = CFrame.new(Player.Character.Torso.Position, Vector3.new(Mouse.Hit.p.x, Player.Character.Torso.Position.y, Mouse.Hit.p.z)) * (Player.Character:FindFirstChild("AimGyroAdd") and Player.Character.AimGyroAdd.Value or CFrame.new())
  1463. end
  1464. wait()
  1465. end
  1466. end)
  1467. --[[
  1468. AmmoCounter v5
  1469. --]]
  1470.  
  1471.  
  1472. local Gui = nil
  1473.  
  1474.  
  1475. local function Remove()
  1476. if Gui ~= nil then
  1477. local Gui2 = Gui
  1478. Gui = nil
  1479. if Gui2.Parent ~= nil then
  1480. Gui2.AmmoCounter:TweenPosition(UDim2.new(0.35, 0, 1, 0), "In", "Quart", 0.5, true)
  1481. wait(0.5)
  1482. end
  1483. Gui2:Remove()
  1484. end
  1485. end
  1486.  
  1487.  
  1488. script.Parent.Selected:connect(function(Mouse)
  1489. while Selected == false do wait() end
  1490. local DualConnection1, DualConnection2
  1491. Gui = Instance.new("ScreenGui", Player.PlayerGui)
  1492. Gui.Name = "AmmoCounter"
  1493. local AmmoCounter = Instance.new("Frame", Gui)
  1494. AmmoCounter.Name = "AmmoCounter"
  1495. AmmoCounter.BorderColor3 = Color3.new(0, 0, 0)
  1496. AmmoCounter.BackgroundTransparency = 0.8
  1497. AmmoCounter.BackgroundColor3 = Color3.new(0.7, 0.7, 0.7)
  1498. AmmoCounter.Size = UDim2.new(0.3, 0, 0, 100)
  1499. AmmoCounter.Position = UDim2.new(0.35, 0, 1, 0)
  1500. AmmoCounter:TweenPosition(UDim2.new(0.35, 0, 1, -200), "Out", "Quart", 0.5, true)
  1501. local Notification = Instance.new("TextLabel", AmmoCounter)
  1502. Notification.Name = "Notification"
  1503. Notification.Text = ""
  1504. Notification.TextTransparency = 1
  1505. Notification.Font = "ArialBold"
  1506. Notification.FontSize = "Size18"
  1507. Notification.BorderColor3 = Color3.new(0, 0, 0)
  1508. Notification.BackgroundTransparency = 0.3
  1509. Notification.BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
  1510. Notification.Size = UDim2.new(1, -10, 0, 20)
  1511. Notification.Position = UDim2.new(0, 5, 0, 5)
  1512. coroutine.wrap(function()
  1513. local Reloading = false
  1514. local OldMagazine = script.Magazine.Value
  1515. local OldMagazineDual = nil
  1516. pcall(function() OldMagazineDual = script.Dual.Main.Magazine.Value end)
  1517. while Notification.Parent ~= nil do
  1518. if OldMagazineDual == nil then
  1519. pcall(function() OldMagazineDual = script.Dual.Main.Magazine.Value end)
  1520. end
  1521. if Reloading == false then
  1522. if ((script.Magazine.Value > OldMagazine or OldMagazine - script.Magazine.Value > 1) or (Dual == true and (script.Dual.Main.Magazine.Value > OldMagazineDual or OldMagazineDual - script.Dual.Main.Magazine.Value > 1))) and CanUse == false then
  1523. Reloading = true
  1524. end
  1525. else
  1526. if CanUse == true then
  1527. Reloading = false
  1528. end
  1529. end
  1530. OldMagazine = script.Magazine.Value
  1531. pcall(function() OldMagazineDual = script.Dual.Main.Magazine.Value end)
  1532. if Reloading == true then
  1533. Notification.TextTransparency = 0
  1534. Notification.TextColor3 = Color3.new(0.1, 0.8, 0.1)
  1535. Notification.Text = "Reloading..."
  1536. wait()
  1537. else
  1538. if (script.Magazine.Value / MagazineCapacity < 0.2) or (Dual == true and (script.Dual.Main.Magazine.Value / MagazineCapacity < 0.2)) then
  1539. Notification.TextColor3 = Color3.new(1, 0.1, 0.05)
  1540. Notification.TextTransparency = 0
  1541. else
  1542. Notification.TextColor3 = CanUse == false and Color3.new(0.8, 0.8, 0.8) or Color3.new(0, 0, 0)
  1543. Notification.TextTransparency = 0
  1544. end
  1545. Notification.Text = "Magazine: " ..script.Magazine.Value .. (Dual == true and ("/" ..script.Dual.Main.Magazine.Value) or "")
  1546. wait()
  1547. end
  1548. end
  1549. end)()
  1550. for x = 1, Dual ~= nil and 2 or 1 do
  1551. for i = 1, MagazineCapacity + MagazineCapacityAdd do
  1552. local Bullet = Instance.new("Frame", AmmoCounter)
  1553. Bullet.Name = i.. ", " ..x
  1554. Bullet.BorderColor3 = Color3.new(0, 0, 0)
  1555. if i > script.Magazine.Value then
  1556. Bullet.BackgroundTransparency = 0.8
  1557. Bullet.BackgroundColor3 = Color3.new(0.7, 0.7, 0.7)
  1558. else
  1559. Bullet.BackgroundTransparency = 0.3
  1560. Bullet.BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
  1561. end
  1562. Bullet.Size = UDim2.new(1 / (MagazineCapacity + MagazineCapacityAdd), -10, 0, Dual ~= nil and 20 or 40)
  1563. Bullet.Position = UDim2.new((i - 1) / (MagazineCapacity + MagazineCapacityAdd), 5, 0, 30 + (20 * (x - 1)))
  1564. end
  1565. end
  1566. local function Check(Value, y)
  1567. return Value.Changed:connect(function()
  1568. for i = 1, MagazineCapacity + MagazineCapacityAdd do
  1569. AmmoCounter[i.. ", " ..y].BackgroundTransparency = 0.8
  1570. AmmoCounter[i.. ", " ..y].BackgroundColor3 = Color3.new(0.7, 0.7, 0.7)
  1571. end
  1572. for i = 1, Value.Value do
  1573. AmmoCounter[i.. ", " ..y].BackgroundTransparency = 0.3
  1574. AmmoCounter[i.. ", " ..y].BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
  1575. end
  1576. end)
  1577. end
  1578. Check(script.Magazine, 1)
  1579. if Dual == true then
  1580. DualConnection1 = Check(script.Dual.Main.Magazine, 2)
  1581. coroutine.wrap(function()
  1582. while Dual == true do
  1583. wait()
  1584. end
  1585. pcall(function() DualConnection1:disconnect() end)
  1586. end)()
  1587. else
  1588. DualConnection1 = script.ChildAdded:connect(function(Child)
  1589. if Child.Name == "Dual" then
  1590. DualConnection2 = Check(Child.Main.Magazine, 2)
  1591. coroutine.wrap(function()
  1592. wait()
  1593. for i = 1, MagazineCapacity + MagazineCapacityAdd do
  1594. AmmoCounter[i.. ", 2"].BackgroundTransparency = 0.8
  1595. AmmoCounter[i.. ", 2"].BackgroundColor3 = Color3.new(0.7, 0.7, 0.7)
  1596. end
  1597. for i = 1, Child.Main.Magazine.Value do
  1598. AmmoCounter[i.. ", 2"].BackgroundTransparency = 0.3
  1599. AmmoCounter[i.. ", 2"].BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
  1600. end
  1601. while Dual == true do
  1602. wait()
  1603. end
  1604. pcall(function() DualConnection2:disconnect() end)
  1605. for i = 1, MagazineCapacity + MagazineCapacityAdd do
  1606. AmmoCounter[i.. ", 2"].BackgroundTransparency = 0.8
  1607. AmmoCounter[i.. ", 2"].BackgroundColor3 = Color3.new(0.7, 0.7, 0.7)
  1608. end
  1609. end)()
  1610. end
  1611. end)
  1612. end
  1613. local ModelNameLabel = Instance.new("TextLabel", AmmoCounter)
  1614. ModelNameLabel.Name = "ModelNameLabel"
  1615. ModelNameLabel.Text = " " ..ModelName
  1616. ModelNameLabel.TextColor3 = Color3.new(0, 0, 0)
  1617. ModelNameLabel.Font = "ArialBold"
  1618. ModelNameLabel.FontSize = "Size14"
  1619. ModelNameLabel.TextXAlignment = "Left"
  1620. ModelNameLabel.BorderColor3 = Color3.new(0, 0, 0)
  1621. ModelNameLabel.BackgroundTransparency = 0.3
  1622. ModelNameLabel.BackgroundColor3 = Color3.new(0.4, 0.4, 0.4)
  1623. ModelNameLabel.Size = UDim2.new(1, -10, 0, 20)
  1624. ModelNameLabel.Position = UDim2.new(0, 5, 0, 75)
  1625. local TotalAmmo = ModelNameLabel:Clone()
  1626. TotalAmmo.Parent = AmmoCounter
  1627. TotalAmmo.Name = "TotalAmmo"
  1628. TotalAmmo.Text = Player.Backpack.Ammo[AmmoType].Value.. " " ..AmmoType.. " "
  1629. TotalAmmo.TextXAlignment = "Right"
  1630. TotalAmmo.BorderSizePixel = 0
  1631. TotalAmmo.BackgroundTransparency = 1
  1632. TotalAmmo.Size = UDim2.new(1, - 10, 0, 20)
  1633. TotalAmmo.Position = UDim2.new(0, 5, 1, -25)
  1634. Player.Backpack.Ammo[AmmoType].Changed:connect(function()
  1635. TotalAmmo.Text = Player.Backpack.Ammo[AmmoType].Value.. " " ..AmmoType.. " "
  1636. end)
  1637. coroutine.wrap(function()
  1638. while Selected == true do
  1639. wait()
  1640. end
  1641. Remove()
  1642. pcall(function() DualConnection1:disconnect() end)
  1643. pcall(function() DualConnection2:disconnect() end)
  1644. end)()
  1645. end)
  1646. end
Add Comment
Please, Sign In to add comment