it cant handle balls that are going too fast and in a short period , send full updated script local CoreGui = game:GetService("StarterGui")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local VirtualInputManager = game:GetService("VirtualInputManager")
CoreGui:SetCore("SendNotification", {
Title = "Auto Parry (Improved)",
Text = "✅",
Duration = 8,
Button1 = "OK"
})
local player = Players.LocalPlayer
local character = player.Character
local humanoidRootPart = character and character:WaitForChild("HumanoidRootPart")
local function getBall()
local balls = workspace.Balls:GetChildren()
for i = 1, #balls do
local ball = balls[i]
if not ball.Anchored then
return ball
end
end
end
local function isTargeted()
return character and character:FindFirstChild("Highlight") and true or false
end
local function getDistanceAndBall()
local ball = getBall()
if humanoidRootPart and ball then
local distance = (humanoidRootPart.Position - ball.Position).Magnitude
return distance, ball
end
return math.huge, nil
end
local function getPing()
return player:GetNetworkPing() * 1000
end
local function getParryDist(ball)
local speed = ball.Velocity.Magnitude
local ping = getPing()
return math.clamp(speed / 1.5 + ping / 10, 20, 250)
end
local function predictFuturePosition(ball, timeAhead)
local direction = ball.Velocity.Unit
local speed = ball.Velocity.Magnitude
return ball.Position + direction * speed * timeAhead
end
local function waitUntilNotTargeted()
local startTime = tick()
repeat
RunService.Heartbeat:Wait()
until not isTargeted() or tick() - startTime > 0.5 or getgenv().disable
end
local circle = Instance.new("Part")
circle.Shape = Enum.PartType.Ball
circle.Material = Enum.Material.ForceField
circle.Parent = workspace
circle.CanCollide = false
circle.Anchored = true
circle.CastShadow = false
circle.Transparency = 0.8
local lastParryTime = 0
local parryDelay = 0.001
local function resetState()
character = player.Character
humanoidRootPart = character and character:WaitForChild("HumanoidRootPart")
end
player.CharacterAdded:Connect(resetState)
if character then
character:WaitForChild("Humanoid").Died:Connect(resetState)
end
local function updateCircle()
if humanoidRootPart and not getgenv().disableVisualizer then
circle.CFrame = humanoidRootPart.CFrame
local _, ball = getDistanceAndBall()
if ball then
circle.Size = Vector3.new(getParryDist(ball), getParryDist(ball), getParryDist(ball))
end
end
end
local function handleTargeting()
local distance, ball = getDistanceAndBall()
if not ball then
return
end
local predictTime = 0.05
local predictedPosition = predictFuturePosition(ball, predictTime)
local futureDistance = (humanoidRootPart.Position - predictedPosition).Magnitude
local parryDist = getParryDist(ball)
circle.Color = isTargeted() and Color3.new(1, 0, 0) or Color3.new(1, 1, 1)
if ball.Velocity.Magnitude > 0 and isTargeted() and futureDistance < parryDist then
local direction = (humanoidRootPart.Position - ball.Position).Unit
if ball.Velocity:Dot(direction) > 0 then
local currentTime = tick()
if currentTime - lastParryTime > parryDelay then
VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.F, false, nil)
wait(0.001)
VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.F, false, nil)
lastParryTime = currentTime
waitUntilNotTargeted()
end
end
end
end
local heartbeat = RunService.Heartbeat:Connect(function()
updateCircle()
handleTargeting()
end)
repeat
RunService.Heartbeat:Wait()
until getgenv().disable
heartbeat:Disconnect()
circle:Destroy()