Advertisement
Guest User

PUNCH SCRIPT

a guest
Jun 17th, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. --By iCrewx
  2. mainRemotes = game.ReplicatedStorage
  3. meleeRemote = mainRemotes['meleeEvent']
  4. mouse = game.Players.LocalPlayer:GetMouse()
  5. punching = false
  6. cooldown = false
  7.  
  8. function punch()
  9. cooldown = true
  10. local part = Instance.new("Part", game.Players.LocalPlayer.Character)
  11. part.Transparency = 1
  12. part.Size = Vector3.new(5, 2, 3)
  13. part.CanCollide = false
  14. local w1 = Instance.new("Weld", part)
  15. w1.Part0 = game.Players.LocalPlayer.Character.Torso
  16. w1.Part1 = part
  17. w1.C1 = CFrame.new(0,0,2)
  18. part.Touched:connect(function(hit)
  19. if game.Players:FindFirstChild(hit.Parent.Name) then
  20. local plr = game.Players:FindFirstChild(hit.Parent.Name)
  21. if plr.Name ~= game.Players.LocalPlayer.Name then
  22. part:Destroy()
  23.  
  24. for i = 1,100 do
  25. meleeRemote:FireServer(plr)
  26. end
  27. end
  28. end
  29. end)
  30.  
  31. wait(1)
  32. cooldown = false
  33. part:Destroy()
  34. end
  35.  
  36.  
  37. mouse.KeyDown:connect(function(key)
  38. if cooldown == false then
  39. if key:lower() == "f" then
  40.  
  41. punch()
  42.  
  43. end
  44. end
  45. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement