Elvisfofo_rblx

Explode Punch

Jun 22nd, 2025 (edited)
3,239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. local UIS = game:GetService("UserInputService")
  2. local Players = game:GetService("Players")
  3. local player = Players.LocalPlayer
  4. local debounce = false
  5.  
  6. function doExplodePunch()
  7. if debounce or not player.Character then return end
  8. debounce = true
  9.  
  10. local char = player.Character
  11. local hum = char:FindFirstChildOfClass("Humanoid")
  12. local hrp = char:FindFirstChild("HumanoidRootPart")
  13. if not hum or not hrp then return end
  14.  
  15. -- Punch Animation (R6 + R15 compatible)
  16. local anim = Instance.new("Animation")
  17. anim.AnimationId = "rbxassetid://148840371" -- Replace with your preferred punch animation
  18. local track = hum:LoadAnimation(anim)
  19. track:Play()
  20.  
  21. -- Explosion Effect
  22. wait(0.2) -- delay slightly to sync with animation
  23. local boom = Instance.new("Explosion")
  24. boom.Position = hrp.Position + hrp.CFrame.LookVector * 3
  25. boom.BlastRadius = 10
  26. boom.BlastPressure = 50000
  27. boom.DestroyJointRadiusPercent = 0
  28. boom.Parent = workspace
  29.  
  30. -- Damage nearby humanoids
  31. for _, obj in ipairs(workspace:GetDescendants()) do
  32. if obj:IsA("Humanoid") and obj ~= hum then
  33. local root = obj.Parent:FindFirstChild("HumanoidRootPart")
  34. if root and (root.Position - boom.Position).Magnitude <= 10 then
  35. obj:TakeDamage(60)
  36. end
  37. end
  38. end
  39.  
  40. wait(1)
  41. debounce = false
  42. end
  43.  
  44. -- Detect tap/click
  45. UIS.InputBegan:Connect(function(input, gameProcessed)
  46. if gameProcessed then return end
  47. if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
  48. doExplodePunch()
  49. end
  50. end)
Advertisement
Add Comment
Please, Sign In to add comment