Advertisement
ghassan2006ww

Untitled

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