REDPlays

JoJo Part 10 Scripts

Feb 22nd, 2020
6,063
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.90 KB | None | 0 0
  1. --//Local Script for Heavy Punch
  2. local Player = game:GetService("Players").LocalPlayer
  3.  
  4. local rp = game:GetService("ReplicatedStorage")
  5. local HeavyPunch = rp:WaitForChild("Stand1Remotes"):WaitForChild("HeavyPunch")
  6.  
  7. local UIS = game:GetService("UserInputService")
  8.  
  9. local debounce = false
  10. local cooldown = 2
  11.  
  12. UIS.InputBegan:Connect(function(input,isTyping)
  13.     if isTyping then
  14.         return
  15.     elseif input.KeyCode == Enum.KeyCode.Q then
  16.         if workspace:FindFirstChild(Player.Name.." Stand") then
  17.             if debounce == false then
  18.                 debounce = true
  19.                
  20.                 HeavyPunch:FireServer()
  21.             end
  22.         end
  23.     end
  24. end)
  25.  
  26. HeavyPunch.OnClientEvent:Connect(function()
  27.     wait(cooldown)
  28.     debounce = false
  29. end)
  30.  
  31. ---------------------------------------------
  32. --//Server script
  33. local rp = game:GetService("ReplicatedStorage")
  34. local HeavyPunch = rp:WaitForChild("Stand1Remotes"):WaitForChild("HeavyPunch")
  35. local Debris = game:GetService("Debris")
  36.  
  37. local TweenService = game:GetService("TweenService")
  38.  
  39. local damage = 25
  40.  
  41. HeavyPunch.OnServerEvent:Connect(function(Player)
  42.     local Character = Player.Character
  43.     local Humanoid = Character:WaitForChild("Humanoid")
  44.     local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
  45.    
  46.     local Stand = workspace:FindFirstChild(Player.Name.." Stand"):FindFirstChild("Dummy")
  47.    
  48.     local Folder = Instance.new("Folder",workspace)
  49.     Folder.Name = Player.Name.." Heavy Punch"
  50.     Debris:AddItem(Folder,.5)
  51.    
  52.     if Stand then
  53.         local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
  54.         prevWeld:Destroy()
  55.        
  56.         Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0,-.5,-2)
  57.        
  58.         local weld = Instance.new("ManualWeld")
  59.         weld.Name = "Stand Weld"
  60.         weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
  61.         weld.Part1 = HumanoidRP
  62.         weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
  63.         weld.Parent = weld.Part0
  64.        
  65.         local AnimControl = Stand:WaitForChild("AnimControl")
  66.         for i, track in pairs(AnimControl:GetPlayingAnimationTracks()) do
  67.             track:Stop()
  68.         end
  69.        
  70.         local Punch = AnimControl:LoadAnimation(script:WaitForChild("Punch"))
  71.         Punch:Play()
  72.        
  73.         local Hitbox = script:WaitForChild("Hitbox"):Clone()
  74.         Hitbox.Parent = Folder
  75.         Hitbox.CFrame = Stand:WaitForChild("RightHand").CFrame
  76.        
  77.         local hweld = Instance.new("ManualWeld")
  78.         hweld.Part0 = Hitbox
  79.         hweld.Part1 = Stand:WaitForChild("RightHand")
  80.         hweld.C0 = hweld.Part0.CFrame:inverse() * hweld.Part1.CFrame
  81.         hweld.Parent = hweld.Part0
  82.        
  83.         Hitbox.Touched:Connect(function(Hit)
  84.             if Hit:IsA("Part") or Hit:IsA("MeshPart") then
  85.                 if Hit.Parent ~= Character then
  86.                     local EHumanoid = Hit.Parent:FindFirstChild("Humanoid")
  87.                     local EHumRP = Hit.Parent:FindFirstChild("HumanoidRootPart")
  88.                    
  89.                     if EHumanoid and EHumRP then
  90.                         Hitbox:Destroy()
  91.                        
  92.                         EHumanoid:TakeDamage(damage)
  93.                        
  94.                         local Sound = Instance.new("Sound",Stand)
  95.                         Sound.Volume = .75
  96.                         Sound.SoundId = "rbxassetid://1089136667"
  97.                         Sound:Play()
  98.                         Debris:AddItem(Sound,.5)
  99.                        
  100.                         local vel = Instance.new("BodyVelocity",EHumRP)
  101.                         vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  102.                         vel.Velocity = HumanoidRP.CFrame.lookVector * 75
  103.                         Debris:AddItem(vel, .5)
  104.                        
  105.                     end
  106.                 end
  107.             end
  108.         end)
  109.         wait(.5)
  110.        
  111.         local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
  112.         prevWeld:Destroy()
  113.        
  114.         Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(2,0,2)
  115.        
  116.         local weld = Instance.new("ManualWeld")
  117.         weld.Name = "Stand Weld"
  118.         weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
  119.         weld.Part1 = HumanoidRP
  120.         weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
  121.         weld.Parent = weld.Part0
  122.        
  123.         local Idle = AnimControl:LoadAnimation(script:WaitForChild("Idle"))
  124.         Idle:Play()
  125.        
  126.         HeavyPunch:FireClient(Player)
  127.     end
  128.    
  129. end)
Advertisement
Add Comment
Please, Sign In to add comment