Advertisement
TotallyScripts

MAGGER

Jul 10th, 2024
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local runService = game:GetService("RunService")
  4.  
  5. local function findBall()
  6. for _, object in ipairs(workspace:GetChildren()) do
  7. if object.Name == "Football" and object:IsA("Part") then
  8. return object
  9. end
  10. end
  11. return nil
  12. end
  13.  
  14. local function attractBall()
  15. local ball = findBall()
  16. if ball then
  17. local bodyPosition = Instance.new("BodyPosition")
  18. bodyPosition.MaxForce = Vector3.new(4000, 4000, 4000)
  19. bodyPosition.P = 10000
  20. bodyPosition.Position = character.HumanoidRootPart.Position
  21. bodyPosition.Parent = ball
  22.  
  23. runService.Stepped:Connect(function()
  24. if ball and character and character:FindFirstChild("HumanoidRootPart") then
  25. bodyPosition.Position = character.HumanoidRootPart.Position
  26. end
  27. end)
  28. end
  29. end
  30.  
  31. -- Automatically attract the ball continuously
  32. runService.Stepped:Connect(function()
  33. attractBall()
  34. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement