Advertisement
suat00

desert

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