Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local UIS = game:GetService("UserInputService")
- local Players = game:GetService("Players")
- local player = Players.LocalPlayer
- local debounce = false
- function doSlam()
- if debounce or not player.Character then return end
- debounce = true
- local char = player.Character
- local root = char:FindFirstChild("HumanoidRootPart")
- -- Slam visual
- local slam = Instance.new("Part", workspace)
- slam.Shape = Enum.PartType.Ball
- slam.Size = Vector3.new(10, 1, 10)
- slam.Anchored = true
- slam.Position = root.Position - Vector3.new(0, 3, 0)
- slam.BrickColor = BrickColor.new("Really red")
- slam.Material = Enum.Material.Neon
- game.Debris:AddItem(slam, 0.3)
- -- Slam damage
- for _, v in pairs(workspace:GetDescendants()) do
- if v:IsA("Humanoid") and v ~= char:FindFirstChildOfClass("Humanoid") then
- local r = v.Parent:FindFirstChild("HumanoidRootPart")
- if r and (r.Position - root.Position).Magnitude < 10 then
- v:TakeDamage(40)
- end
- end
- end
- wait(0.5)
- debounce = false
- end
- UIS.InputBegan:Connect(function(input, g)
- if g then return end
- if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
- doSlam()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment