Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local UserInputService = game:GetService("UserInputService")
- local Debris = game:GetService("Debris")
- local LocalPlayer = Players.LocalPlayer
- local function getCharacter()
- return LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
- end
- -- Detect rig type
- local function getRigType()
- local humanoid = getCharacter():FindFirstChildOfClass("Humanoid")
- return humanoid and humanoid.RigType == Enum.HumanoidRigType.R15 and "R15" or "R6"
- end
- -- Play punch animation
- local function playPunchAnim()
- local character = getCharacter()
- local humanoid = character:FindFirstChildOfClass("Humanoid")
- if not humanoid then return end
- local anim = Instance.new("Animation")
- anim.AnimationId = getRigType() == "R15" and "rbxassetid://507777826" or "rbxassetid://148840371" -- R15 and R6 punch
- local track = humanoid:LoadAnimation(anim)
- track:Play()
- Debris:AddItem(anim, 3)
- end
- -- Explosion on punch
- local punching = false
- local function doExplodePunch()
- if punching then return end
- punching = true
- local character = getCharacter()
- local hand = character:FindFirstChild("RightHand") or character:FindFirstChild("Right Arm")
- if not hand then return end
- playPunchAnim()
- wait(0.2)
- -- Create explosion at hand
- local explosion = Instance.new("Explosion")
- explosion.Position = hand.Position
- explosion.BlastRadius = 10
- explosion.BlastPressure = 500000
- explosion.DestroyJointRadiusPercent = 0
- explosion.ExplosionType = Enum.ExplosionType.NoCraters
- explosion.Parent = workspace
- -- Damage players
- explosion.Hit:Connect(function(part, distance)
- local victim = part:FindFirstAncestorOfClass("Model")
- if victim and victim ~= character and victim:FindFirstChild("Humanoid") then
- victim.Humanoid:TakeDamage(100)
- end
- end)
- wait(0.8)
- punching = false
- end
- -- Tap anywhere to punch
- UserInputService.TouchTap:Connect(function()
- doExplodePunch()
- end)
- -- Optional notification
- pcall(function()
- game.StarterGui:SetCore("SendNotification", {
- Title = "💥 Explode Punch Ready",
- Text = "Tap anywhere to smash and explode!",
- Duration = 4
- })
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement