Adam_RBLX

Untitled

Dec 13th, 2022
6,938
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 1 0
  1. getgenv().Toggle = true
  2. getgenv().BallDirection = Vector3.new(999999, 999999, 999999)
  3.  
  4. local plr = game.Players.LocalPlayer
  5. local ball = false
  6.  
  7. local function getBall()
  8. while true do game:GetService("RunService").Stepped:Wait()
  9. if workspace:FindFirstChild("Ball") ~= nil then
  10. ball = workspace.Ball
  11. end
  12. end
  13. end
  14.  
  15. task.spawn(getBall)
  16.  
  17. while Toggle do game:GetService("RunService").Stepped:Wait()
  18. if (ball and ball:FindFirstChild("Main") and plr.Character ~= nil) then
  19. local distance = plr:DistanceFromCharacter(ball.Main.Position)
  20. plr.Character:WaitForChild("HumanoidRootPart").CFrame = CFrame.lookAt(plr.Character.HumanoidRootPart.Position, Vector3.new(ball.Main.Position.X, plr.Character.HumanoidRootPart.Position.Y, ball.Main.Position.Z))
  21. if (distance <= 17.8) then
  22. plr.Character:WaitForChild("Deflection").Remote:FireServer("Deflect", BallDirection)
  23. end
  24. end
  25. end
Add Comment
Please, Sign In to add comment