1. _G.IsToggle = true;
  2. _G.Distance = 17;
  3. -- Settings definition
  4. local player = game:GetService("Players").LocalPlayer;
  5. local isDeflected = false;
  6. game:GetService("RunService").Heartbeat:Connect(function()
  7. if (not _G.IsToggle) then return end;
  8. local ball = workspace:FindFirstChild("Ball");
  9. if (not ball) then return end;
  10. local character = player.Character;
  11. if (not character) then return end;
  12. local rootPart = character:FindFirstChild("HumanoidRootPart");
  13. if (not rootPart) then return end;
  14. local distance = (rootPart.Position - ball.Main.Position).Magnitude;
  15. if (distance > _G.Distance) then return end;
  16. if (not character:FindFirstChild("TargetHighlight")) then
  17. isDeflected = false;
  18. return;
  19. end
  20. if (isDeflected) then return end
  21. isDeflected = true;
  22. mouse1click();
  23. end);