Advertisement
Navarone19_CH

F to punch 2020

May 31st, 2020
6,516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. CanDoDmg = true
  2. keybind = "f"
  3. dmg = 10
  4.  
  5. local plr = game.Players.LocalPlayer
  6. local mouse = plr:GetMouse()
  7.  
  8. mouse.KeyDown:Connect(function(key)
  9. if key == keybind then
  10. local anim = script.Parent.Humanoid:LoadAnimation(script.Animation)
  11. anim:Play()
  12. script.Parent.RightHand.Touched:connect(function(hit)
  13. if hit.Parent.Humanoid and CanDoDmg == true then
  14. hit.Parent.Humanoid:TakeDamage(dmg)
  15. CanDoDmg = false
  16. wait(1)
  17. CanDoDmg = true
  18. end
  19. end)
  20. end
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement