viroisfake

egoist auto goal

Jan 26th, 2023
1,067
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local root = player.Character:FindFirstChild("HumanoidRootPart")
  3.  
  4. function getBall()
  5. local dist = 10000
  6. local closest
  7. for i,v in pairs(game:GetService("Workspace").ClientBalls:GetChildren()) do
  8. if (root.Position - v.Position).Magnitude < dist then
  9. closest = v
  10. dist = (root.Position - v.Position).Magnitude
  11. end
  12. end
  13. return closest
  14. end
  15.  
  16. function shoot(power)
  17. root = player.Character:WaitForChild("HumanoidRootPart")
  18. local rootpos = root.Position
  19.  
  20. local ohCFrame3
  21. if player.UniformShirtId.Value == 11967283138 then
  22. ohCFrame3 = CFrame.lookAt(rootpos, game:GetService("Workspace").BigArena.Goal1.CFrame.Position + Vector3.new(0,0,math.random(-10,10)))
  23. elseif player.UniformShirtId.Value == 11988090225 then
  24. ohCFrame3 = CFrame.lookAt(rootpos, game:GetService("Workspace").BigArena.Goal2.CFrame.Position + Vector3.new(0,0,math.random(-10,10)))
  25. end
  26. game:GetService("ReplicatedStorage").UpdateHumanoidRootPart:FireServer(ohCFrame3)
  27.  
  28. local ohNumber1 = power
  29. local ohCFrame2 = game:GetService("Workspace").Camera.CFrame
  30. local ohString3 = "Back"
  31.  
  32. game:GetService("ReplicatedStorage").Kick:FireServer(ohNumber1, ohCFrame2, ohString3)
  33. end
  34.  
  35. while task.wait() do
  36. root.CFrame = CFrame.new(getBall().CFrame.Position)
  37. shoot(-3)
  38. end
Add Comment
Please, Sign In to add comment