Glexteon

Untitled

Sep 24th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. punching = false
  2. mouse = game.Players.LocalPlayer:GetMouse()
  3. mouse.KeyDown:connect(function(key)
  4. if key == "f" then
  5. spawn(function()
  6. punching = true
  7. wait(0.936)
  8. punching = false
  9. end)
  10. AnimationId = "204062532"
  11. local Anim = Instance.new("Animation")
  12. Anim.AnimationId = "rbxassetid://"..AnimationId
  13. local k = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Anim)
  14. k:Play() --Play the animation
  15. k:AdjustSpeed(1) --Set '1' to any value you want to adjust the animation speed.
  16. end
  17. end)
  18.  
  19.  
  20.  
  21. game.Players.LocalPlayer.Character.Humanoid.Touched:connect(function(hit,limb)
  22. if punching then
  23. if hit.Parent:FindFirstChild("HumanoidRootPart") then
  24.  
  25. wait()
  26. pcall(function()
  27. game.ReplicatedStorage.Events.destryObj:FireServer(hit.Parent.Head)
  28. end)
  29. wait()
  30. end
  31. end
  32. end)
  33.  
  34.  
  35.  
  36. game.Players.LocalPlayer.CharacterAdded:connect(function()
  37. wait(0.1)
  38. game.Players.LocalPlayer.Character.Humanoid.Touched:connect(function(hit,limb)
  39. if punching then
  40. if hit.Parent:FindFirstChild("HumanoidRootPart") then
  41.  
  42. wait()
  43. pcall(function()
  44. game.ReplicatedStorage.Events.destryObj:FireServer(hit.Parent.Head)
  45. end)
  46. wait()
  47. end
  48. end
  49. end)
  50. end)
Add Comment
Please, Sign In to add comment