Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:wait()
- local UIS = game:GetService('UserInputService')
- local candmg = false
- local debounce = true
- --repeat wait() until char
- --repeat wait() until char.Humanoid
- local part = Instance.new('Part', char)
- part.Transparency = 1
- part.Size = Vector3.new(1,1,1)
- part.Name = 'Part'
- part.Anchored = false
- part.CanCollide = false
- part.CFrame = CFrame.new(char.UpperTorso.Position + Vector3.new(-1,0,-1))
- local weld = Instance.new('Weld', part)
- weld.C0 = char.UpperTorso.CFrame:inverse() * part.CFrame
- weld.Part0 = char.UpperTorso
- weld.Part1 = part
- part.Orientation = Vector3.new(0,0,0)
- UIS.InputBegan:connect(function(input)
- if debounce == true then
- if char:WaitForChild('Humanoid').Health ~= 0 then
- if input.KeyCode == Enum.KeyCode.E then
- local punch = char.Humanoid:LoadAnimation(script.Punch)
- punch:Play()
- debounce = false
- candmg = true
- wait(.01)
- wait(.4)
- debounce = true
- wait(.1)
- candmg = false
- end
- end
- end
- end)
- UIS.InputBegan:connect(function(input)
- if debounce == true then
- if char:WaitForChild('Humanoid').Health ~= 0 then
- if input.KeyCode == Enum.KeyCode.Q then
- local punch1 = char.Humanoid:LoadAnimation(script.Punch1)
- punch1:Play()
- debounce = false
- candmg = true
- wait(.01)
- wait(.4)
- debounce = true
- wait(.1)
- candmg = false
- end
- end
- end
- end)
- part.Touched:connect(function(hit)
- if hit.Parent:FindFirstChild('Humanoid') then
- if candmg == true then
- hit.Parent:WaitForChild('Humanoid'):TakeDamage(8)
- candmg = false
- end
- end
- end)
Add Comment
Please, Sign In to add comment