Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --//Local Script for Heavy Punch
- local Player = game:GetService("Players").LocalPlayer
- local rp = game:GetService("ReplicatedStorage")
- local HeavyPunch = rp:WaitForChild("Stand1Remotes"):WaitForChild("HeavyPunch")
- local UIS = game:GetService("UserInputService")
- local debounce = false
- local cooldown = 2
- UIS.InputBegan:Connect(function(input,isTyping)
- if isTyping then
- return
- elseif input.KeyCode == Enum.KeyCode.Q then
- if workspace:FindFirstChild(Player.Name.." Stand") then
- if debounce == false then
- debounce = true
- HeavyPunch:FireServer()
- end
- end
- end
- end)
- HeavyPunch.OnClientEvent:Connect(function()
- wait(cooldown)
- debounce = false
- end)
- ---------------------------------------------
- --//Server script
- local rp = game:GetService("ReplicatedStorage")
- local HeavyPunch = rp:WaitForChild("Stand1Remotes"):WaitForChild("HeavyPunch")
- local Debris = game:GetService("Debris")
- local TweenService = game:GetService("TweenService")
- local damage = 25
- HeavyPunch.OnServerEvent:Connect(function(Player)
- local Character = Player.Character
- local Humanoid = Character:WaitForChild("Humanoid")
- local HumanoidRP = Character:WaitForChild("HumanoidRootPart")
- local Stand = workspace:FindFirstChild(Player.Name.." Stand"):FindFirstChild("Dummy")
- local Folder = Instance.new("Folder",workspace)
- Folder.Name = Player.Name.." Heavy Punch"
- Debris:AddItem(Folder,.5)
- if Stand then
- local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
- prevWeld:Destroy()
- Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(0,-.5,-2)
- local weld = Instance.new("ManualWeld")
- weld.Name = "Stand Weld"
- weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
- weld.Part1 = HumanoidRP
- weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
- weld.Parent = weld.Part0
- local AnimControl = Stand:WaitForChild("AnimControl")
- for i, track in pairs(AnimControl:GetPlayingAnimationTracks()) do
- track:Stop()
- end
- local Punch = AnimControl:LoadAnimation(script:WaitForChild("Punch"))
- Punch:Play()
- local Hitbox = script:WaitForChild("Hitbox"):Clone()
- Hitbox.Parent = Folder
- Hitbox.CFrame = Stand:WaitForChild("RightHand").CFrame
- local hweld = Instance.new("ManualWeld")
- hweld.Part0 = Hitbox
- hweld.Part1 = Stand:WaitForChild("RightHand")
- hweld.C0 = hweld.Part0.CFrame:inverse() * hweld.Part1.CFrame
- hweld.Parent = hweld.Part0
- Hitbox.Touched:Connect(function(Hit)
- if Hit:IsA("Part") or Hit:IsA("MeshPart") then
- if Hit.Parent ~= Character then
- local EHumanoid = Hit.Parent:FindFirstChild("Humanoid")
- local EHumRP = Hit.Parent:FindFirstChild("HumanoidRootPart")
- if EHumanoid and EHumRP then
- Hitbox:Destroy()
- EHumanoid:TakeDamage(damage)
- local Sound = Instance.new("Sound",Stand)
- Sound.Volume = .75
- Sound.SoundId = "rbxassetid://1089136667"
- Sound:Play()
- Debris:AddItem(Sound,.5)
- local vel = Instance.new("BodyVelocity",EHumRP)
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Velocity = HumanoidRP.CFrame.lookVector * 75
- Debris:AddItem(vel, .5)
- end
- end
- end
- end)
- wait(.5)
- local prevWeld = Stand:WaitForChild("HumanoidRootPart"):WaitForChild("Stand Weld")
- prevWeld:Destroy()
- Stand:WaitForChild("HumanoidRootPart").CFrame = HumanoidRP.CFrame * CFrame.new(2,0,2)
- local weld = Instance.new("ManualWeld")
- weld.Name = "Stand Weld"
- weld.Part0 = Stand:WaitForChild("HumanoidRootPart")
- weld.Part1 = HumanoidRP
- weld.C0 = Stand:WaitForChild("HumanoidRootPart").CFrame:inverse() * HumanoidRP.CFrame
- weld.Parent = weld.Part0
- local Idle = AnimControl:LoadAnimation(script:WaitForChild("Idle"))
- Idle:Play()
- HeavyPunch:FireClient(Player)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment