Advertisement
Dfgjfj

push system tool script (hitbox)

Jan 25th, 2025 (edited)
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. --// This script was writed by allvideo.
  2. local Debris = game:GetService("Debris")
  3.  
  4. local Cooldown = 5
  5. local Debounce = false
  6. local PushPower = 30
  7.  
  8. script.Parent.Activated:connect(function()
  9. local char = script.Parent.Parent
  10. if not Debounce and char and char:FindFirstChild("Humanoid") and char:FindFirstChild("HumanoidRootPart") then
  11. Debounce = true
  12. local Hum = char.Humanoid
  13. local rootpart = char.HumanoidRootPart
  14. local PushAnim = Instance.new("Animation")
  15. PushAnim.AnimationId = "rbxassetid://119810554"
  16. local loadanim = Hum:LoadAnimation(PushAnim)
  17. loadanim:Play()
  18. loadanim:AdjustSpeed(2.5)
  19. task.wait(0.3)
  20. local hitbox = Instance.new("Part",workspace)
  21. hitbox.Name = "Hitbox"
  22. hitbox.Anchored = true
  23. hitbox.CanCollide = false
  24. hitbox.CFrame = rootpart.CFrame + (rootpart.CFrame.LookVector * 3.5)
  25. hitbox.Color = Color3.fromRGB(255,0,0)
  26. hitbox.Transparency = 0.5
  27. hitbox.Size = Vector3.new(5,5,5)
  28.  
  29. local params = OverlapParams.new()
  30. params.FilterType = Enum.RaycastFilterType.Exclude
  31. params.FilterDescendantsInstances = {hitbox,char}
  32. local HitboxTarget = workspace:GetPartBoundsInBox(hitbox.CFrame,hitbox.Size,params)
  33.  
  34. for i,v in next, HitboxTarget do
  35. if v.Parent and v.Parent:FindFirstChild("Humanoid") and v.Parent:FindFirstChild("HumanoidRootPart") then
  36. v.Parent.Humanoid.Sit = true
  37. local bodyVelocity = Instance.new("BodyVelocity")
  38. bodyVelocity.Velocity = (v.Parent.HumanoidRootPart.Position - rootpart.Position).unit * PushPower
  39. bodyVelocity.P = math.huge
  40. bodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
  41. bodyVelocity.Parent = v.Parent.HumanoidRootPart
  42.  
  43. Debris:AddItem(bodyVelocity,0.1)
  44. end
  45. end
  46. task.wait(0.3)
  47. hitbox:Destroy()
  48. task.wait(Cooldown)
  49. Debounce = false
  50. end
  51. end)
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement