Advertisement
Elvisfofo_rblx

Slam Ground Script

Jun 22nd, 2025
1,249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local UserInputService = game:GetService("UserInputService")
  3. local RunService = game:GetService("RunService")
  4. local Debris = game:GetService("Debris")
  5.  
  6. local LocalPlayer = Players.LocalPlayer
  7. local function getCharacter() return LocalPlayer.Character end
  8.  
  9. -- Detect rig type
  10. local function getRigType()
  11. local hum = getCharacter():FindFirstChildOfClass("Humanoid")
  12. return hum and hum.RigType == Enum.HumanoidRigType.R15 and "R15" or "R6"
  13. end
  14.  
  15. -- Play slam animation
  16. local function playSlamAnimation()
  17. local humanoid = getCharacter():FindFirstChildOfClass("Humanoid")
  18. if not humanoid then return end
  19.  
  20. local anim = Instance.new("Animation")
  21. anim.AnimationId = getRigType() == "R15" and "rbxassetid://5432160495" or "rbxassetid://148840371" -- R15: Slam, R6: Punch
  22.  
  23. local track = humanoid:LoadAnimation(anim)
  24. track:Play()
  25. Debris:AddItem(anim, 3)
  26. end
  27.  
  28. -- Visual shockwave effect
  29. local function shockwaveEffect()
  30. local root = getCharacter():FindFirstChild("HumanoidRootPart")
  31. if not root then return end
  32.  
  33. local shock = Instance.new("Part")
  34. shock.Shape = Enum.PartType.Cylinder
  35. shock.Anchored = true
  36. shock.CanCollide = false
  37. shock.Size = Vector3.new(1, 0.2, 1)
  38. shock.CFrame = root.CFrame * CFrame.Angles(math.rad(90), 0, 0)
  39. shock.Material = Enum.Material.Neon
  40. shock.BrickColor = BrickColor.new("Bright orange")
  41. shock.Parent = workspace
  42.  
  43. local expand = shock:TweenSize(Vector3.new(50, 0.2, 50), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.5, false)
  44. game.Debris:AddItem(shock, 0.6)
  45. end
  46.  
  47. -- Damage nearby players
  48. local function slamDamage()
  49. local root = getCharacter():FindFirstChild("HumanoidRootPart")
  50. if not root then return end
  51.  
  52. for _, player in ipairs(Players:GetPlayers()) do
  53. if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Humanoid") and player.Character:FindFirstChild("HumanoidRootPart") then
  54. local distance = (root.Position - player.Character.HumanoidRootPart.Position).Magnitude
  55. if distance <= 25 then
  56. player.Character.Humanoid:TakeDamage(100)
  57. end
  58. end
  59. end
  60. end
  61.  
  62. -- Slam action
  63. local isSlamming = false
  64. local function slamGround()
  65. if isSlamming or not getCharacter() then return end
  66. isSlamming = true
  67.  
  68. playSlamAnimation()
  69. wait(0.2)
  70. shockwaveEffect()
  71. slamDamage()
  72.  
  73. wait(1)
  74. isSlamming = false
  75. end
  76.  
  77. -- Bind tap to slam
  78. local inputConn
  79. inputConn = UserInputService.TouchTap:Connect(function()
  80. slamGround()
  81. end)
  82.  
  83. -- Auto-disable on death/reset
  84. LocalPlayer.CharacterAdded:Connect(function()
  85. if inputConn then inputConn:Disconnect() end
  86. end)
  87.  
  88. -- Optional Notification
  89. pcall(function()
  90. game.StarterGui:SetCore("SendNotification", {
  91. Title = "🔥 Slam Ready",
  92. Text = "Tap anywhere to slam the ground!",
  93. Duration = 5
  94. })
  95. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement