local Players = game:GetService("Players") local Virtual_Input_Manager = game:GetService("VirtualInputManager") local Player = Players.LocalPlayer or Players.PlayerAdded:Wait() local Balls = workspace:WaitForChild("Part") local function Verify_Ball(Ball) if typeof(Ball) == "Instance" and Ball:IsA("MeshPart") then return true end return false end local function Is_Target() if Player.Character then local Highlight = Player.Character:FindFirstChild("Highlight") if Highlight then return Highlight.FillTransparency ~= 1 end end return false end local function Parry() Virtual_Input_Manager:SendKeyEvent(true, Enum.KeyCode.F, false, game) Virtual_Input_Manager:SendKeyEvent(false, Enum.KeyCode.F, false, game) end local function Start(Ball) if Verify_Ball(Ball) then local Old_Position = Ball.Position local Old_Tick = tick() Ball:GetPropertyChangedSignal("Position"):Connect(function() if Is_Target() then local Distance = (Ball.Position - workspace.CurrentCamera.Focus.Position).Magnitude local Velocity = (Old_Position - Ball.Position).Magnitude if (Distance / Velocity) <= 10 then Parry() end end if (tick() - Old_Tick >= 1/60) then Old_Tick = tick() Old_Position = Ball.Position end end) end end Start(Balls) workspace.ChildAdded:Connect(function(Ball) if Ball.ClassName == "MeshPart" and Ball.Name == "Part" and Ball.Parent == workspace then Start(Ball) end end)