local starterGUI = game:GetService("StarterGui")
local player = game.Players.LocalPlayer
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local autoParryEnabled = false
local Cooldown = tick()
local IsParried = false
local Connection = nil
local function SendNotification(title, text, duration)
starterGUI:SetCore("SendNotification", {
Title = title,
Text = text,
Duration = duration or 3
})
end
local function GetBall()
for _, Ball in ipairs(workspace.Balls:GetChildren()) do
if Ball:GetAttribute("realBall") then
return Ball
end
end
end
local function ResetConnection()
if Connection then
Connection:Disconnect()
Connection = nil
end
end
local function ToggleAutoParry()
autoParryEnabled = not autoParryEnabled
local status = autoParryEnabled and "ON" or "OFF"
SendNotification("Auto Parry", "Auto Parry is now " .. status, 2)
end
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
if gameProcessed then return end
if input.KeyCode == Enum.KeyCode.K then
ToggleAutoParry()
end
end)
workspace.Balls.ChildAdded:Connect(function()
local Ball = GetBall()
if not Ball then return end
ResetConnection()
Connection = Ball:GetAttributeChangedSignal("target"):Connect(function()
IsParried = false
end)
end)
RunService.PreSimulation:Connect(function()
if not autoParryEnabled then return end
local Ball = GetBall()
local HRP = Player.Character and Player.Character:FindFirstChild("HumanoidRootPart")
if not Ball or not HRP then
return
end
local Speed = Ball.zoomies.VectorVelocity.Magnitude
local Distance = (HRP.Position - Ball.Position).Magnitude
if Ball:GetAttribute("target") == Player.Name and not IsParried and Distance / Speed <= 0.55 then
local blockButton = Player.PlayerGui.Hotbar.Block
for _, connection in pairs(getconnections(blockButton.Activated)) do
connection:Fire()
end
for _, connection in pairs(getconnections(blockButton.MouseButton1Click)) do
connection:Fire()
end
for _, connection in pairs(getconnections(blockButton.MouseButton1Down)) do
connection:Fire()
end
IsParried = true
Cooldown = tick()
if (tick() - Cooldown) >= 1 then
IsParried = false
end
end
end)
Comments
No comments yet
Be the first to share your thoughts!