Advertisement
A_GUES

DEFLECT Script

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