GalaxyEggBRG

fN-five

Jun 17th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.47 KB | None | 0 0
  1. --[[
  2. Fabrique National Five seveN
  3. Manufactured by Fabrique Nationale (FN), based in Belgium. Fires 10 9mm rounds.
  4. --]]
  5.  
  6.  
  7. if script == nil then return end
  8.  
  9.  
  10. ModelName = "Five seveN"
  11. AmmoType = "9mm"
  12. MagazineCapacity = 10
  13. MagazineCapacityAdd = 1
  14. Player = script:FindFirstChild("Player") ~= nil and script.Player.Value or game:GetService("Players"):FindFirstChild("DarkShadow6Alt")
  15. Selected = false
  16. Connected = false
  17. Button1Down = false
  18. CanUse = true
  19. Silenced = false
  20. Dual = script:FindFirstChild("Dual") ~= nil
  21. BulletData = [[Velocity_Transfer = 0.4
  22.  
  23. Damage_Head = 35
  24. Damage_Torso = 15
  25. Damage_Limb = 10
  26. Damage_Other = 8
  27.  
  28. Dust_Size_Min = 2
  29. Dust_Size_Max = 4
  30. Dust_Add = 0.3
  31.  
  32. Spark_Min = 3
  33. Spark_Max = 5
  34. Spark_Size_Min = 3
  35. Spark_Size_Max = 6
  36. Spark_Add = 0.5
  37.  
  38. Chunk_Min = 2
  39. Chunk_Max = 5
  40. ]] ..game:GetService("InsertService"):LoadAsset(60263276)["BulletData"].Value
  41. FirstPerson = [[FirstPersonOffset = CFrame.new(0, -0.5, 0)]] ..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 MasterPart = Instance.new("Part")
  77. MasterPart.Name = "Handle"
  78. MasterPart.FormFactor = "Custom"
  79. MasterPart.Size = Vector3.new(1, 1, 1)
  80. MasterPart.BrickColor = BrickColor.new("Really black")
  81. MasterPart.TopSurface = 0
  82. MasterPart.BottomSurface = 0
  83. MasterPart.Parent = Parts
  84. local Mesh = Instance.new("BlockMesh", MasterPart)
  85. Mesh.Scale = Vector3.new(0.3, 0.9, 0.2)
  86. Mesh.Offset = Vector3.new(0, 0, 0.1)
  87. local Weld = Instance.new("Weld")
  88. Weld.Part0 = MasterPart
  89. if Format == 1 then
  90. Weld.Part1 = Player.Character:FindFirstChild("Right Leg")
  91. Weld.C0 = CFrame.new(-0.65, -0.3, 0) * CFrame.fromEulerAnglesXYZ(math.rad(30), 0, 0)
  92. elseif Format == 2 then
  93. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  94. Weld.C0 = CFrame.new(0, 1.2, 0.7)
  95. elseif Format == 3 then
  96. Weld.Part1 = Player.Character:FindFirstChild("Right Leg")
  97. Weld.C0 = CFrame.new(-0.95, -0.3, 0) * CFrame.fromEulerAnglesXYZ(math.rad(45), 0, 0)
  98. elseif Format == 4 then
  99. Weld.Part1 = Player.Character:FindFirstChild("Left Arm")
  100. Weld.C0 = CFrame.new(0, 1.2, 0.7)
  101. end
  102. Weld.Parent = Weld.Part0
  103.  
  104. local Part = Instance.new("Part")
  105. Part.Name = "Underbarrel"
  106. Part.FormFactor = "Custom"
  107. Part.Size = Vector3.new(0.2, 0.5, 0.2)
  108. Part.BrickColor = BrickColor.new("Really black")
  109. Part.TopSurface = 0
  110. Part.BottomSurface = 0
  111. Part.Parent = Parts
  112. Instance.new("BlockMesh", Part).Scale = Vector3.new(1, 1, 0.15 / 0.2)
  113. local Weld = Instance.new("Weld")
  114. Weld.Part0 = Part
  115. Weld.Part1 = MasterPart
  116. Weld.C0 = CFrame.new(0, 0.7, -0.075)
  117. Weld.Parent = Part
  118.  
  119. local Part = Instance.new("Part")
  120. Part.Name = "ShellOut"
  121. Part.FormFactor = "Custom"
  122. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  123. Part.Transparency = 1
  124. Part.TopSurface = 0
  125. Part.BottomSurface = 0
  126. Part.Parent = Parts
  127. local Weld = Instance.new("Weld")
  128. Weld.Part0 = Part
  129. Weld.Part1 = MasterPart
  130. Weld.C0 = CFrame.new(0.5, 0, 0.5) * CFrame.fromEulerAnglesXYZ(0, math.rad(45), 0)
  131. Weld.Parent = Part
  132.  
  133. local Part = Instance.new("Part")
  134. Part.Name = "Grip"
  135. Part.FormFactor = "Custom"
  136. Part.Size = Vector3.new(0.29, 0.5, 0.9)
  137. Part.BrickColor = BrickColor.new("Really black")
  138. Part.TopSurface = 0
  139. Part.BottomSurface = 0
  140. Part.Parent = Parts
  141. Instance.new("BlockMesh", Part)
  142. local Weld = Instance.new("Weld")
  143. Weld.Part0 = Part
  144. Weld.Part1 = MasterPart
  145. Weld.C0 = CFrame.new(0, -0.05, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  146. Weld.Parent = Part
  147.  
  148. local Part = Instance.new("Part")
  149. Part.Name = "Magazine"
  150. Part.FormFactor = "Custom"
  151. Part.Size = Vector3.new(0.275, 0.475, 0.95 )
  152. Part.BrickColor = BrickColor.new("Really black")
  153. Part.TopSurface = 0
  154. Part.BottomSurface = 0
  155. Part.Parent = Parts
  156. local Weld = Instance.new("Weld")
  157. Weld.Part0 = Part
  158. Weld.Part1 = MasterPart
  159. Weld.C0 = CFrame.new(0, -0.05, -0.6) * CFrame.fromEulerAnglesXYZ(math.rad(15), 0, 0)
  160. Weld.Parent = Part
  161.  
  162. local Part = Instance.new("Part")
  163. Part.Name = "Trigger Housing 1"
  164. Part.FormFactor = "Custom"
  165. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  166. Part.BrickColor = BrickColor.new("Really black")
  167. Part.TopSurface = 0
  168. Part.BottomSurface = 0
  169. Part.Parent = Parts
  170. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.1 / 0.2, 1, 0.025 / 0.2)
  171. local Weld = Instance.new("Weld")
  172. Weld.Part0 = Part
  173. Weld.Part1 = MasterPart
  174. Weld.C0 = CFrame.new(0, 0.2, -0.4)
  175. Weld.Parent = Part
  176.  
  177. local Part = Instance.new("Part")
  178. Part.Name = "Trigger Housing 2"
  179. Part.FormFactor = "Custom"
  180. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  181. Part.BrickColor = BrickColor.new("Really black")
  182. Part.TopSurface = 0
  183. Part.BottomSurface = 0
  184. Part.Parent = Parts
  185. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.1 / 0.2, 1, 0.025 / 0.2)
  186. local Weld = Instance.new("Weld")
  187. Weld.Part0 = Part
  188. Weld.Part1 = MasterPart
  189. Weld.C0 = CFrame.new(0, 0.02, -0.49) * CFrame.fromEulerAnglesXYZ(math.rad(-45), 0, 0)
  190. Weld.Parent = Part
  191.  
  192. local Part = Instance.new("Part")
  193. Part.Name = "Trigger Housing 3"
  194. Part.FormFactor = "Custom"
  195. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  196. Part.BrickColor = BrickColor.new("Really black")
  197. Part.TopSurface = 0
  198. Part.BottomSurface = 0
  199. Part.Parent = Parts
  200. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.1, 0.025, 0.1) / 0.2
  201. local Weld = Instance.new("Weld")
  202. Weld.Part0 = Part
  203. Weld.Part1 = MasterPart
  204. Weld.C0 = CFrame.new(0, 0.426, -0.22)
  205. Weld.Parent = Part
  206.  
  207. local Part = Instance.new("Part")
  208. Part.Name = "Trigger"
  209. Part.FormFactor = "Custom"
  210. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  211. Part.BrickColor = BrickColor.new("Really black")
  212. Part.TopSurface = 0
  213. Part.BottomSurface = 0
  214. Part.Parent = Parts
  215. Instance.new("BlockMesh", Part).Scale = Vector3.new(0.1, 0.025, 0.15) / 0.2
  216. local Weld = Instance.new("Weld")
  217. Weld.Part0 = Part
  218. Weld.Part1 = MasterPart
  219. Weld.C0 = CFrame.new(0, 0.175, -0.3) * CFrame.fromEulerAnglesXYZ(math.rad(-10), 0, 0)
  220. Weld.Parent = Part
  221.  
  222. local Part = Instance.new("Part")
  223. Part.Name = "Barrel"
  224. Part.FormFactor = "Custom"
  225. Part.Size = Vector3.new(0.2, 0.6, 0.2)
  226. Part.BrickColor = BrickColor.new("Silver")
  227. Part.TopSurface = 0
  228. Part.BottomSurface = 0
  229. Part.Parent = Parts
  230. local Mesh = Instance.new("SpecialMesh")
  231. Mesh.MeshType = "Head"
  232. Mesh.Scale = Vector3.new(0.5, 1, 0.5)
  233. Mesh.Parent = Part
  234. local Weld = Instance.new("Weld")
  235. Weld.Part0 = Part
  236. Weld.Part1 = MasterPart
  237. Weld.C0 = CFrame.new(0, 0.67, 0.075)
  238. Weld.Parent = Part
  239.  
  240. local Part = Instance.new("Part")
  241. Part.Name = "Muzzle"
  242. Part.FormFactor = "Custom"
  243. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  244. Part.BrickColor = BrickColor.new("Really black")
  245. Part.TopSurface = 0
  246. Part.BottomSurface = 0
  247. Part.Parent = Parts
  248. Instance.new("CylinderMesh", Part).Scale = Vector3.new(0.4, 0.2, 0.4)
  249. local Weld = Instance.new("Weld")
  250. Weld.Part0 = Part
  251. Weld.Part1 = MasterPart
  252. Weld.C0 = CFrame.new(0, 0.97, 0.075)
  253. Weld.Parent = Part
  254.  
  255. local Part = Instance.new("Part")
  256. Part.Name = "Slide 1"
  257. Part.FormFactor = "Custom"
  258. Part.Size = Vector3.new(0.3, 0.9, 0.2)
  259. Part.BrickColor = BrickColor.new("Really black")
  260. Part.TopSurface = 0
  261. Part.BottomSurface = 0
  262. Part.Parent = Parts
  263. Instance.new("BlockMesh", Part)
  264. local Weld = Instance.new("Weld")
  265. Weld.Part0 = Part
  266. Weld.Part1 = MasterPart
  267. Weld.C0 = CFrame.new(0, 0, 0.1)
  268. Weld.C1 = CFrame.new(0, (function()
  269. if Format == 1 or Format == 2 then
  270. return script.Magazine.Value > 0 and 0 or 0.5
  271. elseif Format == 3 or Format == 4 then
  272. return script.Dual.Main.Magazine.Value > 0 and 0 or 0.5
  273. end
  274. end)(), 0)
  275. Weld.Parent = Part
  276.  
  277. local Part = Instance.new("Part")
  278. Part.Name = "Slide 2"
  279. Part.FormFactor = "Custom"
  280. Part.Size = Vector3.new(0.2, 0.5, 0.2)
  281. Part.BrickColor = BrickColor.new("Really black")
  282. Part.TopSurface = 0
  283. Part.BottomSurface = 0
  284. Part.Parent = Parts
  285. Instance.new("BlockMesh", Part)
  286. local Weld = Instance.new("Weld")
  287. Weld.Part0 = Part
  288. Weld.Part1 = MasterPart
  289. Weld.C0 = CFrame.new(0, 0.7, 0.1)
  290. if Format == 1 or Format == 2 then
  291. Weld.C1 = CFrame.new(0, script.Magazine.Value > 0 and 0 or 0.5, 0)
  292. elseif Format == 3 or Format == 4 then
  293. Weld.C1 = CFrame.new(0, script.Dual.Main.Magazine.Value > 0 and 0 or 0.5, 0)
  294. end
  295. Weld.Parent = Part
  296.  
  297. local Part = Instance.new("Part")
  298. Part.Name = "Silencer"
  299. Part.FormFactor = "Custom"
  300. Part.Size = Vector3.new(0.4, 1, 0.4)
  301. Part.BrickColor = BrickColor.new("Really black")
  302. Part.Transparency = Silenced and 0 or 1
  303. Part.TopSurface = 0
  304. Part.BottomSurface = 0
  305. Part.Parent = Parts
  306. Instance.new("CylinderMesh", Part)
  307. local Weld = Instance.new("Weld")
  308. Weld.Part0 = Part
  309. Weld.Part1 = MasterPart
  310. Weld.C0 = CFrame.new(0, 1.475, 0.075)
  311. Weld.Parent = Part
  312.  
  313. local Part = Instance.new("Part")
  314. Part.Name = "Source"
  315. Part.FormFactor = "Custom"
  316. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  317. Part.Transparency = 1
  318. Part.TopSurface = 0
  319. Part.BottomSurface = 0
  320. Part.Parent = Parts
  321. local Weld = Instance.new("Weld")
  322. Weld.Part0 = Part
  323. Weld.Part1 = MasterPart
  324. Weld.C0 = CFrame.new(0, 1.7, 0.075)
  325. Weld.Parent = Part
  326. local Fire = Instance.new("Fire", Part)
  327. Fire.Enabled = false
  328. Fire.Size = 2
  329. Fire.Heat = -7.5
  330. Fire.Color = Color3.new(1, 0.6, 0.2)
  331. Fire.SecondaryColor = Color3.new(0.6, 0.1, 0.05)
  332. local Smoke = Instance.new("Smoke", Part)
  333. Smoke.Enabled = false
  334. Smoke.Size = 15
  335. Smoke.RiseVelocity = -10
  336. Smoke.Color = Color3.new(0.7, 0.7, 0.7)
  337. Smoke.Opacity = 0.1
  338.  
  339. for _, Part in pairs(Parts:GetChildren()) do
  340. Part.Locked = true
  341. Part.CanCollide = false
  342. end
  343. end
  344.  
  345.  
  346. function RemoveParts(Parent, Format)
  347. if Format == 1 then
  348. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  349. elseif Format == 2 then
  350. pcall(function() Parent[ModelName]:Remove() end)
  351. elseif Format == 3 then
  352. pcall(function() Parent[ModelName.. " (Holstered Dual)"]:Remove() end)
  353. elseif Format == 4 then
  354. pcall(function() Parent[ModelName.. " (Dual)"]:Remove() end)
  355. end
  356. end
  357.  
  358.  
  359. function SetAngle(Joint, Angle, Character)
  360. if Character == nil then return false end
  361. local Joints = {
  362. Character.Torso:FindFirstChild("Right Shoulder 2"),
  363. Character.Torso:FindFirstChild("Left Shoulder 2"),
  364. Character.Torso:FindFirstChild("Right Hip 2"),
  365. Character.Torso:FindFirstChild("Left Hip 2")
  366. }
  367. if Joints[Joint] == nil then return false end
  368. if Joint == 1 or Joint == 3 then
  369. Joints[Joint].DesiredAngle = Angle
  370. end
  371. if Joint == 2 or Joint == 4 then
  372. Joints[Joint].DesiredAngle = -Angle
  373. end
  374. end
  375.  
  376.  
  377. function ForceAngle(Joint, Angle, Character)
  378. if Character == nil then return false end
  379. local Joints = {
  380. Character.Torso:FindFirstChild("Right Shoulder 2"),
  381. Character.Torso:FindFirstChild("Left Shoulder 2"),
  382. Character.Torso:FindFirstChild("Right Hip 2"),
  383. Character.Torso:FindFirstChild("Left Hip 2")
  384. }
  385. if Joints[Joint] == nil then return false end
  386. if Joint == 1 or Joint == 3 then
  387. Joints[Joint].DesiredAngle = Angle
  388. Joints[Joint].CurrentAngle = Angle
  389. end
  390. if Joint == 2 or Joint == 4 then
  391. Joints[Joint].DesiredAngle = -Angle
  392. Joints[Joint].CurrentAngle = -Angle
  393. end
  394. end
  395.  
  396.  
  397. function SetSpeed(Joint, Speed, Character)
  398. if Character == nil then return false end
  399. local Joints = {
  400. Character.Torso:FindFirstChild("Right Shoulder 2"),
  401. Character.Torso:FindFirstChild("Left Shoulder 2"),
  402. Character.Torso:FindFirstChild("Right Hip 2"),
  403. Character.Torso:FindFirstChild("Left Hip 2")
  404. }
  405. if Joints[Joint] == nil then return false end
  406. Joints[Joint].MaxVelocity = Speed
  407. end
  408.  
  409.  
  410. function DisableLimb(Limb, Character)
  411. if Character == nil then return false end
  412. if Character:FindFirstChild("Torso") == nil then return false end
  413. local Joints = {
  414. Character.Torso:FindFirstChild("Right Shoulder"),
  415. Character.Torso:FindFirstChild("Left Shoulder"),
  416. Character.Torso:FindFirstChild("Right Hip"),
  417. Character.Torso:FindFirstChild("Left Hip")
  418. }
  419. local Limbs = {
  420. Character:FindFirstChild("Right Arm"),
  421. Character:FindFirstChild("Left Arm"),
  422. Character:FindFirstChild("Right Leg"),
  423. Character:FindFirstChild("Left Leg")
  424. }
  425. if Joints[Limb] == nil then return false end
  426. if Limbs[Limb] == nil then return false end
  427. local Joint = Instance.new("Motor6D")
  428. Joint.Parent = Character.Torso
  429. Joint.Part0 = Character.Torso
  430. Joint.Part1 = Limbs[Limb]
  431. if Limb == 1 then
  432. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  433. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  434. Joint.Name = "Right Shoulder 2"
  435. elseif Limb == 2 then
  436. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  437. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  438. Joint.Name = "Left Shoulder 2"
  439. elseif Limb == 3 then
  440. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  441. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  442. Joint.Name = "Right Hip 2"
  443. elseif Limb == 4 then
  444. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  445. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  446. Joint.Name = "Left Hip 2"
  447. end
  448. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  449. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  450. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  451. Joints[Limb]:Remove()
  452. end
  453.  
  454.  
  455. function ResetLimbCFrame(Limb, Character)
  456. if Character == nil then return false end
  457. if Character.Parent == nil then return false end
  458. if Character:FindFirstChild("Torso") == nil then return false end
  459. local Joints = {
  460. Character.Torso:FindFirstChild("Right Shoulder 2"),
  461. Character.Torso:FindFirstChild("Left Shoulder 2"),
  462. Character.Torso:FindFirstChild("Right Hip 2"),
  463. Character.Torso:FindFirstChild("Left Hip 2")
  464. }
  465. local Limbs = {
  466. Character:FindFirstChild("Right Arm"),
  467. Character:FindFirstChild("Left Arm"),
  468. Character:FindFirstChild("Right Leg"),
  469. Character:FindFirstChild("Left Leg")
  470. }
  471. if Joints[Limb] == nil then return false end
  472. if Limbs[Limb] == nil then return false end
  473. if Limb == 1 then
  474. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  475. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  476. elseif Limb == 2 then
  477. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  478. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  479. elseif Limb == 3 then
  480. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  481. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  482. elseif Limb == 4 then
  483. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  484. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  485. end
  486. end
  487.  
  488.  
  489. function EnableLimb(Limb, Character)
  490. if Character == nil then return false end
  491. if Character:FindFirstChild("Torso") == nil then return false end
  492. local Joints = {
  493. Character.Torso:FindFirstChild("Right Shoulder 2"),
  494. Character.Torso:FindFirstChild("Left Shoulder 2"),
  495. Character.Torso:FindFirstChild("Right Hip 2"),
  496. Character.Torso:FindFirstChild("Left Hip 2")
  497. }
  498. local Limbs = {
  499. Character:FindFirstChild("Right Arm"),
  500. Character:FindFirstChild("Left Arm"),
  501. Character:FindFirstChild("Right Leg"),
  502. Character:FindFirstChild("Left Leg")
  503. }
  504. if Joints[Limb] == nil then return false end
  505. if Limbs[Limb] == nil then return false end
  506. if Limb == 1 then
  507. Joints[Limb].Name = "Right Shoulder"
  508. elseif Limb == 2 then
  509. Joints[Limb].Name = "Left Shoulder"
  510. elseif Limb == 3 then
  511. Joints[Limb].Name = "Right Hip"
  512. elseif Limb == 4 then
  513. Joints[Limb].Name = "Left Hip"
  514. end
  515. Animate = Character:FindFirstChild("Animate")
  516. if Animate == nil then return false end
  517. Animate = Animate:Clone()
  518. Character.Animate:Remove()
  519. Animate.Parent = Character
  520. end
  521.  
  522.  
  523. function onButton1Down(Mouse)
  524. if Button1Down == true then return end
  525. Button1Down = true
  526. if CheckPlayer() == false then return end
  527. if CanUse == true then
  528. SoundToServer("Click", "http://www.roblox.com/Asset/?id=2697295", 15, 0.25, false, Player.Character[ModelName].Handle)
  529. if script.Magazine.Value <= 0 then
  530. return
  531. end
  532. CanUse = false
  533. SoundToServer("Fire", "http://www.roblox.com/Asset/?id=2920959", Silenced and 8 or math.random(900, 1100) / 1000, Silenced and 0.5 or 1, false, Player.Character[ModelName].Handle)
  534. script.Magazine.Value = script.Magazine.Value - 1
  535. coroutine.wrap(function()
  536. pcall(function()
  537. Player.Character[ModelName].Source.Fire.Enabled = not Silenced
  538. Player.Character[ModelName].Source.Smoke.Enabled = not Silenced
  539. end)
  540. wait(0.1)
  541. pcall(function()
  542. Player.Character[ModelName].Source.Fire.Enabled = false
  543. Player.Character[ModelName].Source.Smoke.Enabled = false
  544. end)
  545. end)()
  546. pcall(function()
  547. local Shell = Instance.new("Part", Workspace)
  548. Shell.Name = "Shell"
  549. Shell.TopSurface = 0
  550. Shell.BottomSurface = 0
  551. Shell.FormFactor = "Custom"
  552. Shell.BrickColor = BrickColor.new("New Yeller")
  553. Shell.Size = Vector3.new(0.2, 0.3, 0.2)
  554. Shell.CFrame = Player.Character[ModelName].ShellOut.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
  555. Shell.Velocity = (Player.Character[ModelName].ShellOut.CFrame.lookVector * 50) + Vector3.new(0, 10, 0)
  556. Shell:BreakJoints()
  557. local Mesh = Instance.new("CylinderMesh")
  558. Mesh.Scale = Vector3.new(0.5, 1, 0.5)
  559. Mesh.Parent = Shell
  560. game:GetService("Debris"):AddItem(Shell, 10)
  561. end)
  562. local Bullet = Instance.new("Part", Workspace)
  563. Bullet.Name = "Bullet"
  564. Bullet.TopSurface = 0
  565. Bullet.BottomSurface = 0
  566. Bullet.BrickColor = BrickColor.new("Really black")
  567. Bullet.Locked = true
  568. Bullet.FormFactor = "Custom"
  569. Bullet.Size = Vector3.new(0.5, 0.5, 0.5)
  570. Bullet.CFrame = Player.Character[ModelName].Source.CFrame * CFrame.new(0, -1.5, 0)
  571. Bullet.Elasticity = 0
  572. Bullet.Friction = 0
  573. local Mesh = Instance.new("SpecialMesh", Bullet)
  574. Mesh.MeshType = "Sphere"
  575. Mesh.Scale = Vector3.new(0.25, 0.25, 0.25)
  576. tagHumanoid(Bullet)
  577. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  578. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  579. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[ModelName].Source.Position).unit * 250) + (Vector3.new(math.random(-4000, 4000) / 1000, math.random(-4000, 4000) / 1000, math.random(-4000, 4000) / 1000) * (Silenced and 3 or 1))
  580. game:GetService("Debris"):AddItem(Bullet, 5)
  581. TouchedToServer(BulletData, Bullet)
  582. CameraPunch(math.rad(math.random(0, 2000) / 1000), math.rad(math.random(-2000, 2000) / 1000))
  583. coroutine.wrap(function()
  584. for i = 0, 10, 5 do
  585. pcall(function()
  586. if Dual == false then Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90)) end
  587. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  588. Player.Character[ModelName]["Slide 1"].Weld.C1 = CFrame.new(0, i / 20, 0)
  589. Player.Character[ModelName]["Slide 2"].Weld.C1 = CFrame.new(0, i / 20, 0)
  590. end)
  591. wait()
  592. end
  593. for i = 10, 0, -5 do
  594. pcall(function()
  595. if Dual == false then Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90)) end
  596. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  597. if script.Magazine.Value > 0 then
  598. Player.Character[ModelName]["Slide 1"].Weld.C1 = CFrame.new(0, i / 20, 0)
  599. Player.Character[ModelName]["Slide 2"].Weld.C1 = CFrame.new(0, i / 20, 0)
  600. end
  601. end)
  602. wait()
  603. end
  604. pcall(function()
  605. if Dual == false then Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90)) end
  606. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  607. if script.Magazine.Value > 0 then
  608. Player.Character[ModelName]["Slide 1"].Weld.C1 = CFrame.new()
  609. Player.Character[ModelName]["Slide 2"].Weld.C1 = CFrame.new()
  610. end
  611. end)
  612. end)()
  613. wait(0.075)
  614. CanUse = true
  615. end
  616. end
  617.  
  618.  
  619. function onButton1Up(Mouse)
  620. coroutine.wrap(function()
  621. wait(0.075)
  622. Button1Down = false
  623. end)()
  624. if Dual == true and Button1Down == true and CheckPlayer() == true then
  625. while CanUse == false do wait() end
  626. SoundToServer("Click", "http://www.roblox.com/Asset/?id=2697295", 15, 0.25, false, Player.Character[ModelName.. " (Dual)"].Handle)
  627. if script.Dual.Main.Magazine.Value <= 0 then
  628. return
  629. end
  630. CanUse = false
  631. SoundToServer("Fire", "http://www.roblox.com/Asset/?id=2920959", Silenced and 8 or math.random(900, 1100) / 1000, Silenced and 0.5 or 1, false, Player.Character[ModelName.. " (Dual)"].Handle)
  632. script.Dual.Main.Magazine.Value = script.Dual.Main.Magazine.Value - 1
  633. coroutine.wrap(function()
  634. pcall(function()
  635. Player.Character[ModelName.. " (Dual)"].Source.Fire.Enabled = not Silenced
  636. Player.Character[ModelName.. " (Dual)"].Source.Smoke.Enabled = not Silenced
  637. end)
  638. wait(0.1)
  639. pcall(function()
  640. Player.Character[ModelName.. " (Dual)"].Source.Fire.Enabled = false
  641. Player.Character[ModelName.. " (Dual)"].Source.Smoke.Enabled = false
  642. end)
  643. end)()
  644. pcall(function()
  645. local Shell = Instance.new("Part", Workspace)
  646. Shell.Name = "Shell"
  647. Shell.TopSurface = 0
  648. Shell.BottomSurface = 0
  649. Shell.FormFactor = "Custom"
  650. Shell.BrickColor = BrickColor.new("New Yeller")
  651. Shell.Size = Vector3.new(0.2, 0.3, 0.2)
  652. Shell.CFrame = Player.Character[ModelName.. " (Dual)"].ShellOut.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(math.random(0, 360)), math.rad(math.random(0, 360)), math.rad(math.random(0, 360)))
  653. Shell.Velocity = (Player.Character[ModelName.. " (Dual)"].ShellOut.CFrame.lookVector * 50) + Vector3.new(0, 10, 0)
  654. Shell:BreakJoints()
  655. local Mesh = Instance.new("CylinderMesh")
  656. Mesh.Scale = Vector3.new(0.5, 1, 0.5)
  657. Mesh.Parent = Shell
  658. game:GetService("Debris"):AddItem(Shell, 10)
  659. end)
  660. local Bullet = Instance.new("Part", Workspace)
  661. Bullet.Name = "Bullet"
  662. Bullet.TopSurface = 0
  663. Bullet.BottomSurface = 0
  664. Bullet.BrickColor = BrickColor.new("Really black")
  665. Bullet.Locked = true
  666. Bullet.FormFactor = "Custom"
  667. Bullet.Size = Vector3.new(0.5, 0.5, 0.5)
  668. Bullet.CFrame = Player.Character[ModelName.. " (Dual)"].Source.CFrame * CFrame.new(0, -1.5, 0)
  669. Bullet.Elasticity = 0
  670. Bullet.Friction = 0
  671. local Mesh = Instance.new("SpecialMesh", Bullet)
  672. Mesh.MeshType = "Sphere"
  673. Mesh.Scale = Vector3.new(0.25, 0.25, 0.25)
  674. tagHumanoid(Bullet)
  675. local BodyVelocity = Instance.new("BodyVelocity", Bullet)
  676. BodyVelocity.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  677. BodyVelocity.velocity = ((Mouse.Hit.p - Player.Character[ModelName.. " (Dual)"].Source.Position).unit * 250) + (Vector3.new(math.random(-4000, 4000) / 1000, math.random(-4000, 4000) / 1000, math.random(-4000, 4000) / 1000) * (Silenced and 3 or 1))
  678. game:GetService("Debris"):AddItem(Bullet, 5)
  679. TouchedToServer(BulletData, Bullet)
  680. CameraPunch(math.rad(math.random(0, 2000) / 1000), math.rad(math.random(-2000, 2000) / 1000))
  681. coroutine.wrap(function()
  682. for i = 0, 10, 5 do
  683. pcall(function()
  684. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  685. Player.Character[ModelName.. " (Dual)"]["Slide 1"].Weld.C1 = CFrame.new(0, i / 20, 0)
  686. Player.Character[ModelName.. " (Dual)"]["Slide 2"].Weld.C1 = CFrame.new(0, i / 20, 0)
  687. end)
  688. wait()
  689. end
  690. for i = 10, 0, -5 do
  691. pcall(function()
  692. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  693. if script.Dual.Main.Magazine.Value > 0 then
  694. Player.Character[ModelName.. " (Dual)"]["Slide 1"].Weld.C1 = CFrame.new(0, i / 20, 0)
  695. Player.Character[ModelName.. " (Dual)"]["Slide 2"].Weld.C1 = CFrame.new(0, i / 20, 0)
  696. end
  697. end)
  698. wait()
  699. end
  700. pcall(function()
  701. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), 0)
  702. if script.Dual.Main.Magazine.Value > 0 then
  703. Player.Character[ModelName.. " (Dual)"]["Slide 1"].Weld.C1 = CFrame.new()
  704. Player.Character[ModelName.. " (Dual)"]["Slide 2"].Weld.C1 = CFrame.new()
  705. end
  706. end)
  707. end)()
  708. wait(0.075)
  709. CanUse = true
  710. end
  711. end
  712.  
  713.  
  714. function onKeyDown(Key, Mouse)
  715. if Selected == false then return end
  716. Key = Key:lower()
  717. if Button1Down == false and CanUse == true and CheckPlayer() == true then
  718. if Key == "q" then
  719. if Mouse.Target == nil then return end
  720. if CheckPlayer() == false then return end
  721. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  722. if NewPlayer == nil then return end
  723. if NewPlayer.Character == nil then return end
  724. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  725. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  726. onDeselected(Mouse)
  727. wait()
  728. RemoveParts(Player.Character, 1)
  729. if Dual == true then RemoveParts(Player.Character, 3) end
  730. script.Parent.Parent = NewPlayer.Backpack
  731. Player = NewPlayer
  732. elseif Key == "r" then
  733. if Player.Backpack.Ammo[AmmoType].Value <= 0 then return end
  734. if Dual == true then
  735. if script.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd and script.Dual.Main.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd then return end
  736. else
  737. if script.Magazine.Value >= MagazineCapacity + MagazineCapacityAdd then return end
  738. end
  739. CanUse = false
  740. local Loaded = script.Magazine.Value > 0
  741. local LoadedDual = true
  742. pcall(function() LoadedDual = script.Dual.Main.Magazine.Value > 0 end)
  743. local Add = math.min(script.Magazine.Value, MagazineCapacityAdd)
  744. local AddDual = nil
  745. pcall(function() AddDual = math.min(script.Dual.Main.Magazine.Value, MagazineCapacityAdd) end)
  746. SoundToServer("Reload", "http://www.roblox.com/Asset/?id=2691591", 2.6, 1, false, Player.Character[ModelName].Handle)
  747. if Dual == true then
  748. for i = 0, 25, 7.5 do
  749. pcall(function()
  750. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  751. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  752. end)
  753. CameraPunch(math.rad(3), 0)
  754. wait()
  755. end
  756. else
  757. for i = 0, 25, 5 do
  758. pcall(function()
  759. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (i / 50), 0.75 - (i / 50), 0.35 + (i / 22.5)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (i * 2)), math.rad(-i * 3.5), math.rad(-90))
  760. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), 0)
  761. end)
  762. CameraPunch(math.rad(-2), 0)
  763. wait()
  764. end
  765. end
  766. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value + script.Magazine.Value - Add
  767. script.Magazine.Value = Add
  768. pcall(function()
  769. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value + script.Dual.Main.Magazine.Value - AddDual
  770. script.Dual.Main.Magazine.Value = AddDual
  771. end)
  772. pcall(function()
  773. local Clone = Player.Character[ModelName].Magazine:Clone()
  774. Clone.CanCollide = true
  775. Clone.Velocity = (Clone.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)).lookVector * 25
  776. Clone.Parent = Workspace
  777. game:GetService("Debris"):AddItem(Clone, 15)
  778. Player.Character[ModelName].Magazine.Transparency = 1
  779. if Dual == true then
  780. local Clone = Player.Character[ModelName.. " (Dual)"].Magazine:Clone()
  781. Clone.CanCollide = true
  782. Clone.Velocity = (Clone.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(180), 0, 0)).lookVector * 25
  783. Clone.Parent = Workspace
  784. game:GetService("Debris"):AddItem(Clone, 15)
  785. Player.Character[ModelName.. " (Dual)"].Magazine.Transparency = 1
  786. end
  787. end)
  788. if Dual == true then
  789. for i = 125, 0, -15 do
  790. pcall(function()
  791. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
  792. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
  793. end)
  794. CameraPunch(math.rad(-2), 0)
  795. wait()
  796. end
  797. pcall(function()
  798. Player.Character[ModelName].Magazine.Transparency = 0
  799. Player.Character[ModelName.. " (Dual)"].Magazine.Transparency = 0
  800. end)
  801. else
  802. wait(0.15)
  803. pcall(function()
  804. local Magazine = Player.Character[ModelName].Magazine:Clone()
  805. Magazine.Name = "New Magazine"
  806. Magazine.Transparency = 0
  807. Magazine.Parent = Player.Character[ModelName]
  808. local Weld = Instance.new("Weld", Magazine)
  809. Weld.Part0 = Weld.Parent
  810. Weld.Part1 = Player.Character["Left Arm"]
  811. Weld.C0 = CFrame.new(0, 1.1, 0)
  812. Weld.C1 = CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  813. end)
  814. for i = 25, 0, -5 do
  815. pcall(function()
  816. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (i / 50), 0.75 - (i / 50), 0.35 + (i / 22.5)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (i * 2)), math.rad(-i * 3.5), math.rad(-90))
  817. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + ((25 - i) / 30), 0.5, 0.6 + ((25 - i) / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 + i), math.rad(-5), math.rad((25 * 2) - (i * 2)))
  818. end)
  819. CameraPunch(math.rad(1), 0)
  820. wait()
  821. end
  822. pcall(function()
  823. Player.Character[ModelName].Magazine.Transparency = 0
  824. Player.Character[ModelName]["New Magazine"]:Remove()
  825. end)
  826. end
  827. if Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity < 0 then
  828. script.Magazine.Value = Player.Backpack.Ammo[AmmoType].Value
  829. Player.Backpack.Ammo[AmmoType].Value = 0
  830. else
  831. script.Magazine.Value = script.Magazine.Value + MagazineCapacity
  832. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity
  833. end
  834. if Dual == true then
  835. if Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity < 0 then
  836. script.Dual.Main.Magazine.Value = Player.Backpack.Ammo[AmmoType].Value
  837. Player.Backpack.Ammo[AmmoType].Value = 0
  838. else
  839. script.Dual.Main.Magazine.Value = script.Dual.Main.Magazine.Value + MagazineCapacity
  840. Player.Backpack.Ammo[AmmoType].Value = Player.Backpack.Ammo[AmmoType].Value - MagazineCapacity
  841. end
  842. end
  843. if Dual == true then
  844. for i = 0, 125, 15 do
  845. pcall(function()
  846. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(5), 0)
  847. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad((-90 - i) + 100), math.rad(-5), 0)
  848. end)
  849. CameraPunch(math.rad(2), 0)
  850. wait()
  851. end
  852. for i = 25, 0, -7.5 do
  853. pcall(function()
  854. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  855. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  856. end)
  857. CameraPunch(math.rad(-3), 0)
  858. wait()
  859. end
  860. pcall(function()
  861. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), 0)
  862. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  863. end)
  864. else
  865. for i = 25, 0, -5 do
  866. pcall(function()
  867. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1 + (i / 30), 0.5, 0.6 + (i / 25)) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), math.rad((25 * 2) - ((25 - i) * 2)))
  868. end)
  869. CameraPunch(math.rad(0.9), 0)
  870. wait()
  871. end
  872. pcall(function()
  873. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  874. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  875. end)
  876. end
  877. if Dual == true then
  878. if Loaded == false or LoadedDual == false then
  879. for i = 0, 1, 0.15 do
  880. pcall(function()
  881. if LoadedDual == false then Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (10 * i)), math.rad(5), 0) end
  882. if Loaded == false then Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (10 * i)), math.rad(-5), 0) end
  883. end)
  884. CameraPunch(math.rad(0.5), 0)
  885. wait()
  886. end
  887. pcall(function()
  888. Player.Character[ModelName]["Slide 1"].Weld.C1 = CFrame.new()
  889. Player.Character[ModelName]["Slide 2"].Weld.C1 = CFrame.new()
  890. Player.Character[ModelName.. " (Dual)"]["Slide 1"].Weld.C1 = CFrame.new()
  891. Player.Character[ModelName.. " (Dual)"]["Slide 2"].Weld.C1 = CFrame.new()
  892. end)
  893. for i = 1, 0, -0.15 do
  894. pcall(function()
  895. if LoadedDual == false then Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (10 * i)), math.rad(5), 0) end
  896. if Loaded == false then Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - (10 * i)), math.rad(-5), 0) end
  897. end)
  898. CameraPunch(math.rad(-0.5), 0)
  899. wait()
  900. end
  901. pcall(function()
  902. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), 0)
  903. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  904. end)
  905. end
  906. else
  907. if Loaded == false then
  908. wait(0.12)
  909. for i = 0, 5, 1 do
  910. pcall(function()
  911. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315 + (i * 1.5)), math.rad(i * 4), math.rad(-90))
  912. end)
  913. CameraPunch(math.rad(0.5), math.rad(-0.5))
  914. wait()
  915. end
  916. pcall(function()
  917. Player.Character[ModelName]["Slide 1"].Weld.C1 = CFrame.new()
  918. Player.Character[ModelName]["Slide 2"].Weld.C1 = CFrame.new()
  919. end)
  920. for i = 5, 0, -1 do
  921. pcall(function()
  922. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315 + (i * 1.5)), math.rad(i * 4), math.rad(-90))
  923. end)
  924. CameraPunch(math.rad(-0.5), math.rad(0.5))
  925. wait()
  926. end
  927. pcall(function()
  928. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  929. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  930. end)
  931. end
  932. end
  933. if Loaded == true and LoadedDual == true then
  934. SendToServer([[for _, Part in pairs(Source:GetChildren()) do
  935. if Part.ClassName == "Sound" and Part.Name == "Reload" then
  936. coroutine.wrap(function()
  937. Part:Stop()
  938. Part.Volume = 0
  939. wait(1)
  940. Part:Remove()
  941. end)()
  942. end
  943. end]], "Sound Stop", {"Source", Player.Character[ModelName].Handle})
  944. end
  945. wait()
  946. CanUse = true
  947. elseif Key == "g" then
  948. CanUse = false
  949. SoundToServer("Slash", "rbxasset://sounds/swordslash.wav", 2, 1, false, Player.Character.Torso)
  950. for i = 0, 50, 25 do
  951. pcall(function()
  952. if Dual == true then
  953. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  954. else
  955. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
  956. end
  957. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  958. end)
  959. wait()
  960. end
  961. local HasHit = Dual == true and 2 or 1
  962. local Hit = function(Hit)
  963. if HasHit <= 0 or Hit:IsDescendantOf(Player.Character) then return end
  964. HasHit = HasHit - 1
  965. SoundToServer("Bash", "http://www.roblox.com/Asset/?id=46153268", 1, 0.25, false, Player.Character.Torso)
  966. local Humanoid = Hit.Parent:FindFirstChild("Humanoid") or Hit.Parent.Parent:FindFirstChild("Humanoid")
  967. if Humanoid ~= nil then
  968. tagHumanoid(Humanoid)
  969. Humanoid:TakeDamage(10)
  970. wait()
  971. pcall(function() untagHumanoid(Humanoid) end)
  972. end
  973. end
  974. local _, HitConnection1 = pcall(function() return Player.Character[ModelName].Barrel.Touched:connect(Hit) end)
  975. local _, HitConnection2 = pcall(function() return Player.Character[ModelName.. " (Dual)"].Barrel.Touched:connect(Hit) end)
  976. for i = 50, -80, -30 do
  977. pcall(function()
  978. if Dual == true then
  979. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  980. else
  981. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
  982. end
  983. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  984. end)
  985. wait()
  986. end
  987. pcall(function() HitConnection1:disconnect() end)
  988. pcall(function() HitConnection2:disconnect() end)
  989. for i = -80, 0, 15 do
  990. pcall(function()
  991. if Dual == true then
  992. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(5), 0)
  993. else
  994. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(i), math.rad(-90))
  995. end
  996. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90 - i), math.rad(-5), 0)
  997. end)
  998. wait()
  999. end
  1000. pcall(function()
  1001. if Dual == true then
  1002. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), 0)
  1003. else
  1004. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  1005. end
  1006. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1007. end)
  1008. CanUse = true
  1009. elseif Key == "e" then
  1010. CanUse = false
  1011. Silenced = not Silenced
  1012. pcall(function() Player.Character[ModelName].Silencer.Transparency = Silenced and 0 or 1 end)
  1013. pcall(function() Player.Character[ModelName.. " (Dual)"].Silencer.Transparency = Silenced and 0 or 1 end)
  1014. CanUse = true
  1015. elseif Key == "y" then
  1016. if Dual == false then
  1017. local Weapon = nil
  1018. for _, Part in pairs(Player.Backpack:GetChildren()) do
  1019. if Part.Name == ModelName and Part ~= script.Parent then
  1020. if Part.Main:FindFirstChild("Dual") == nil then
  1021. Weapon = Part
  1022. break
  1023. end
  1024. end
  1025. end
  1026. if Weapon == nil then return end
  1027. CanUse = false
  1028. for i = 0, 1, 0.05 do
  1029. pcall(function()
  1030. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-90 * i), math.rad(-90))
  1031. end)
  1032. wait()
  1033. end
  1034. Weapon.Name = "Dual"
  1035. Weapon.Parent = script
  1036. Dual = true
  1037. RemoveParts(Player.Character, 1)
  1038. CreateParts(Player.Character, 4)
  1039. UpdateFirstPerson(true)
  1040. for i = 0, 1, 0.05 do
  1041. pcall(function()
  1042. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (1.55 * i), 0.75 - (0.25 * i), 0.35 + (0.25 * i)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (45 * i)), math.rad(-90 + (95 * i)), math.rad(-90 * (1 - i)))
  1043. end)
  1044. wait()
  1045. end
  1046. pcall(function()
  1047. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), 0)
  1048. end)
  1049. else
  1050. for i = 1, 0, -0.05 do
  1051. pcall(function()
  1052. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55 + (1.55 * i), 0.75 - (0.25 * i), 0.35 + (0.25 * i)) * CFrame.fromEulerAnglesXYZ(math.rad(315 - (45 * i)), math.rad(-90 + (95 * i)), math.rad(-90 * (1 - i)))
  1053. end)
  1054. wait()
  1055. end
  1056. RemoveParts(Player.Character, 4)
  1057. CreateParts(Player.Character, 1)
  1058. UpdateFirstPerson(true)
  1059. Dual = false
  1060. local Weapon = script.Dual
  1061. Weapon.Name = ModelName
  1062. Weapon.Parent = Player.Backpack
  1063. for i = 1, 0, -0.05 do
  1064. pcall(function()
  1065. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), math.rad(-90 * i), math.rad(-90))
  1066. end)
  1067. wait()
  1068. end
  1069. pcall(function()
  1070. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  1071. end)
  1072. end
  1073. CanUse = true
  1074. end
  1075. end
  1076. end
  1077.  
  1078.  
  1079. function onSelected(Mouse)
  1080. if Selected == true or CanUse == false then return end
  1081. CanUse = false
  1082. while true do
  1083. if CheckPlayer() == true then
  1084. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil and Player.Character.Torso:FindFirstChild("Left Shoulder") ~= nil then
  1085. break
  1086. end
  1087. end
  1088. wait(0.1)
  1089. end
  1090. Selected = true
  1091. DisableLimb(1, Player.Character)
  1092. SetSpeed(1, 0.5, Player.Character)
  1093. SetAngle(1, 0, Player.Character)
  1094. DisableLimb(2, Player.Character)
  1095. SetSpeed(2, 0.5, Player.Character)
  1096. SetAngle(2, 0, Player.Character)
  1097. wait(0.05)
  1098. pcall(function() Player.Character.Torso["Left Shoulder 2"].C0 = CFrame.new() end)
  1099. if Dual == true then
  1100. for i = 0, 1, 0.05 do
  1101. pcall(function()
  1102. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1.5 - (1.2 * i), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), math.rad(-35 * i))
  1103. end)
  1104. wait()
  1105. end
  1106. end
  1107. pcall(function() Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new() end)
  1108. RemoveParts(Player.Character, 1)
  1109. CreateParts(Player.Character, 2)
  1110. if Dual == true then
  1111. RemoveParts(Player.Character, 3)
  1112. CreateParts(Player.Character, 4)
  1113. end
  1114. for i = 0, 1, 0.075 do
  1115. pcall(function()
  1116. if Dual == true then
  1117. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.3 + (0.7 * i), 0.5, 0.35 + (0.25 * i)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(90 - (85 * i)), math.rad(-35 * (1 - i)))
  1118. else
  1119. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
  1120. end
  1121. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  1122. end)
  1123. wait()
  1124. end
  1125. pcall(function()
  1126. if Dual == true then
  1127. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(5), 0)
  1128. else
  1129. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(-0.55, 0.75, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(315), 0, math.rad(-90))
  1130. end
  1131. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new(-1, 0.5, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-5), 0)
  1132. end)
  1133. coroutine.wrap(function()
  1134. while Selected == true do
  1135. script.Parent.Name = script.Magazine.Value.. ":" ..Player.Backpack.Ammo[AmmoType].Value .. (Dual == true and "\n" ..script.Dual.Main.Magazine.Value.. ":" ..string.rep(" ", tostring(Player.Backpack.Ammo[AmmoType].Value):len()) or "")
  1136. wait()
  1137. end
  1138. script.Parent.Name = ModelName
  1139. end)()
  1140. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1141. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  1142. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  1143. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  1144. CanUse = true
  1145. end
  1146.  
  1147.  
  1148. function onDeselected(Mouse)
  1149. if Selected == false then return end
  1150. Selected = false
  1151. while CanUse == false do wait() end
  1152. if CheckPlayer() == false or pcall(function() local _ = Player.Character.Torso["Right Shoulder 2"] end) == false then
  1153. RemoveParts(Player.Character, 2)
  1154. CreateParts(Player.Character, 1)
  1155. if Dual == true then
  1156. RemoveParts(Player.Character, 4)
  1157. CreateParts(Player.Character, 3)
  1158. end
  1159. SetAngle(1, 0, Player.Character)
  1160. ResetLimbCFrame(1, Player.Character)
  1161. EnableLimb(1, Player.Character)
  1162. SetAngle(2, 0, Player.Character)
  1163. ResetLimbCFrame(2, Player.Character)
  1164. EnableLimb(2, Player.Character)
  1165. return
  1166. end
  1167. if Selected == true then return end
  1168. CanUse = false
  1169. for i = 1, 0, -0.1 do
  1170. pcall(function()
  1171. if Dual == true then
  1172. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(0.3 + (0.7 * i), 0.5, 0.35 + (0.25 * i)) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(90 - (85 * i)), math.rad(-35 * (1 - i)))
  1173. else
  1174. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new((-0.55 * i) + (1.5 * (1 - i)), 0.75 * i, 0.35 * i) * CFrame.fromEulerAnglesXYZ(math.rad(315 + ((1 - i) * 50)), 0, math.rad(-90) * i)
  1175. end
  1176. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.new((-1 * i) + (-1.5 * (1 - i)), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(math.rad(-90 * i), math.rad(-5 * i), 0)
  1177. end)
  1178. wait()
  1179. end
  1180. ResetLimbCFrame(1, Player.Character)
  1181. RemoveParts(Player.Character, 2)
  1182. CreateParts(Player.Character, 1)
  1183. if Dual == true then
  1184. RemoveParts(Player.Character, 4)
  1185. CreateParts(Player.Character, 3)
  1186. for i = 1, 0, -0.05 do
  1187. pcall(function()
  1188. Player.Character.Torso["Left Shoulder 2"].C1 = CFrame.new(1.5 - (1.2 * i), 0.5 * i, 0.6 * i) * CFrame.fromEulerAnglesXYZ(0, math.rad(90 * i), math.rad(-35 * i))
  1189. end)
  1190. wait()
  1191. end
  1192. end
  1193. ResetLimbCFrame(2, Player.Character)
  1194. EnableLimb(1, Player.Character)
  1195. EnableLimb(2, Player.Character)
  1196. CanUse = true
  1197. end
  1198.  
  1199.  
  1200. if script.Parent.ClassName ~= "HopperBin" then
  1201. if Player == nil then print("Error: Player not found!") return end
  1202. Tool = Instance.new("HopperBin")
  1203. Tool.Name = ModelName
  1204. Tool.Parent = Player.Backpack
  1205. Instance.new("IntValue", script).Name = "Magazine"
  1206. script.Name = "Main"
  1207. script.Parent = Tool
  1208. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  1209. Connected = true
  1210. Player = script.Parent.Parent.Parent
  1211. if Player.Backpack:FindFirstChild("Ammo") == nil then
  1212. Instance.new("Configuration", Player.Backpack).Name = "Ammo"
  1213. end
  1214. if Player.Backpack.Ammo:FindFirstChild(AmmoType) == nil then
  1215. Instance.new("IntValue", Player.Backpack.Ammo).Name = AmmoType
  1216. Player.Backpack.Ammo[AmmoType].Value = MagazineCapacity * 8
  1217. end
  1218. script.Parent.Selected:connect(onSelected)
  1219. script.Parent.Deselected:connect(onDeselected)
  1220. CreateParts(Player.Character, 1)
  1221. if Dual == true then CreateParts(Player.Character, 3) end
  1222. coroutine.wrap(loadstring(FirstPerson))()
  1223. coroutine.wrap(loadstring(MouseAim))()
  1224. coroutine.wrap(loadstring(AmmoCounter))()
  1225. end
Add Comment
Please, Sign In to add comment