Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// ======================================================================
- --// PAYLOAD0 • AUTO-AIM + ALIGN-ASSIST [STATIC RIMSIZE + AUTO POWER]
- --// • Static RimSize detection (no "Lol" parts)
- --// • Dynamic power learning: remote arg#5 + tool attributes/values
- --// • A/D single-key push with soft pull even slightly outside clamp radius
- --// • Bright green visuals when ball equipped & near target band
- --// • Calibration UI (until shoot key is captured)
- --// • Toggles: [O]=Visuals, [V]=System, LMB=Shoot
- --// ======================================================================
- -- === SERVICES ===
- local Players = game:GetService('Players')
- local UserInputService = game:GetService('UserInputService')
- local RunService = game:GetService('RunService')
- local ReplicatedStorage = game:GetService('ReplicatedStorage')
- local CoreGui = game:GetService('CoreGui')
- local TweenService = game:GetService('TweenService')
- local Workspace = game:GetService('Workspace')
- local Camera = workspace.CurrentCamera
- local plr = Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:Wait()
- -- === STATE ===
- getgenv().PAYLOAD0_SYSTEM_ACTIVE = true
- local VisualsEnabled = true
- local shootKey : string? = nil
- local selectedRim : BasePart? = nil
- local activeNotifyGui
- local ballTool : Tool? = nil
- -- === CONFIGURATION ===
- local PERFECT_DISTANCES = { 54.97, 61.53, 68.10 }
- local CLAMP_RADIUS = 1 -- hard target band
- local SOFT_RADIUS = CLAMP_RADIUS * 2 -- gentle pull band (outside clamp)
- local ACTIVE_RANGE_MAIN = 90
- local MAX_PUSH = 0.06
- local DAMPING = 0.9
- local COLOR_GREEN = Color3.fromRGB(0, 255, 100)
- local COLOR_GREEN_SOFT = Color3.fromRGB(0, 200, 80)
- -- === NOTIFY SYSTEM ===
- local function notify(msg, color)
- if activeNotifyGui and activeNotifyGui.Parent then
- activeNotifyGui:Destroy()
- end
- local gui = Instance.new('ScreenGui')
- gui.ResetOnSpawn = false
- gui.Parent = CoreGui
- activeNotifyGui = gui
- local label = Instance.new('TextLabel')
- label.AnchorPoint = Vector2.new(0.5, 0.5)
- label.BackgroundTransparency = 1
- label.TextColor3 = color or Color3.fromRGB(255, 255, 255)
- label.Font = Enum.Font.Code
- label.TextSize = 26
- label.Text = msg
- label.Position = UDim2.new(0.5, 0, 0.9, 0)
- label.Parent = gui
- task.spawn(function()
- task.wait(1.2)
- if gui == activeNotifyGui then
- gui:Destroy()
- activeNotifyGui = nil
- end
- end)
- end
- -- === HELPER: BALL CHECK ===
- local function hasBall()
- local c = plr.Character
- if not c then return false end
- for _, tool in ipairs(c:GetChildren()) do
- if tool:IsA('Tool') and tool.Name:lower():find('ball') then
- ballTool = tool
- return true
- end
- end
- ballTool = nil
- return false
- end
- -- === CALIBRATE UI ===
- local calibrateGui
- local function showCalibrateUI()
- if calibrateGui or shootKey or not hasBall() then return end
- calibrateGui = Instance.new('ScreenGui')
- calibrateGui.Name = 'CalibrateReminder'
- calibrateGui.ResetOnSpawn = false
- calibrateGui.IgnoreGuiInset = true
- calibrateGui.Parent = CoreGui
- local frame = Instance.new('Frame')
- frame.AnchorPoint = Vector2.new(0.5, 0.5)
- frame.Position = UDim2.new(0.5, 0, 0.85, 0)
- frame.Size = UDim2.new(0, 420, 0, 45)
- frame.BackgroundTransparency = 0.3
- frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
- frame.BorderSizePixel = 0
- frame.Parent = calibrateGui
- local stroke = Instance.new('UIStroke')
- stroke.Color = Color3.fromRGB(80, 255, 120)
- stroke.Thickness = 1.6
- stroke.Parent = frame
- local corner = Instance.new('UICorner')
- corner.CornerRadius = UDim.new(0, 10)
- corner.Parent = frame
- local label = Instance.new('TextLabel')
- label.BackgroundTransparency = 1
- label.Size = UDim2.new(1, 0, 1, 0)
- label.Font = Enum.Font.GothamMedium
- label.TextSize = 22
- label.TextColor3 = Color3.fromRGB(120, 255, 150)
- label.Text = '🏀 Click once to calibrate your shot.'
- label.Parent = frame
- task.spawn(function()
- while calibrateGui and not shootKey and hasBall() do
- local t1 = TweenService:Create(label, TweenInfo.new(0.8, Enum.EasingStyle.Sine), {TextTransparency = 0.3})
- local t2 = TweenService:Create(label, TweenInfo.new(0.8, Enum.EasingStyle.Sine), {TextTransparency = 0})
- t1:Play(); t1.Completed:Wait()
- t2:Play(); t2.Completed:Wait()
- end
- end)
- end
- local function removeCalibrateUI()
- if calibrateGui then calibrateGui:Destroy(); calibrateGui = nil end
- end
- task.spawn(function()
- while task.wait(0.5) do
- if not hasBall() or shootKey then removeCalibrateUI() else showCalibrateUI() end
- end
- end)
- -- === AUTO POWER SYSTEM ===
- local CURRENT_POWER = 75
- local POWER_NAMES = { "Power", "ShootPower", "ShotPower", "Shot_Strength", "ShotPowerValue" }
- local function setPower(p)
- if typeof(p) == "number" and p > 0 and p < 1000 then
- CURRENT_POWER = p
- end
- end
- local function attachPowerWatchersToTool(tool)
- if not tool then return end
- for _, name in ipairs(POWER_NAMES) do
- if tool:GetAttribute(name) ~= nil then
- setPower(tool:GetAttribute(name))
- end
- tool:GetAttributeChangedSignal(name):Connect(function()
- setPower(tool:GetAttribute(name))
- end)
- end
- for _, obj in ipairs(tool:GetDescendants()) do
- if obj:IsA("NumberValue") and table.find(POWER_NAMES, obj.Name) then
- setPower(obj.Value)
- obj:GetPropertyChangedSignal("Value"):Connect(function()
- setPower(obj.Value)
- end)
- end
- end
- tool.DescendantAdded:Connect(function(obj)
- if obj:IsA("NumberValue") and table.find(POWER_NAMES, obj.Name) then
- setPower(obj.Value)
- obj:GetPropertyChangedSignal("Value"):Connect(function()
- setPower(obj.Value)
- end)
- end
- end)
- end
- local _orig_hasBall = hasBall
- hasBall = function()
- local ok = _orig_hasBall()
- if ok and ballTool then
- attachPowerWatchersToTool(ballTool)
- end
- return ok
- end
- -- === REMOTE HOOK ===
- local shootRemote : RemoteEvent? = nil
- local hookedMeta = nil
- local SEARCH_PATTERN = 'shoot'
- local function getRoots()
- local roots = {}
- local userFolder = Workspace:FindFirstChild(plr.Name)
- if userFolder and userFolder:FindFirstChild('Basketball') then
- table.insert(roots, userFolder.Basketball)
- end
- local iso = Workspace:FindFirstChild('isokcocs')
- if iso and iso:FindFirstChild('Basketball') then
- table.insert(roots, iso.Basketball)
- end
- local remotes = ReplicatedStorage:FindFirstChild('Remotes')
- if remotes then table.insert(roots, remotes) end
- return roots
- end
- local function findShootRemote()
- for _, root in ipairs(getRoots()) do
- for _, obj in ipairs(root:GetDescendants()) do
- if obj:IsA('RemoteEvent') and obj.Name:lower():find(SEARCH_PATTERN) then
- return obj
- end
- end
- local direct = root:FindFirstChild('Shoot')
- if direct and direct:IsA('RemoteEvent') then
- return direct
- end
- end
- return nil
- end
- local function hookRemote(remote)
- if hookedMeta then return end
- local old
- old = hookmetamethod(game, '__namecall', function(self, ...)
- local m = getnamecallmethod()
- if m == 'FireServer' and self == remote then
- local args = {...}
- if type(args[3]) == 'string' and not shootKey then
- shootKey = args[3]
- removeCalibrateUI()
- pcall(function() notify('Shoot key captured: '..shootKey, COLOR_GREEN) end)
- end
- if type(args[5]) == "number" then
- setPower(args[5])
- end
- end
- return old(self, ...)
- end)
- hookedMeta = old
- shootRemote = remote
- pcall(function() notify('Remote locked: '..remote:GetFullName(), COLOR_GREEN) end)
- end
- local function unhookRemote()
- hookedMeta = nil
- shootRemote = nil
- end
- RunService.Heartbeat:Connect(function()
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
- local current = findShootRemote()
- if current then
- if current ~= shootRemote then
- unhookRemote()
- hookRemote(current)
- end
- elseif shootRemote then
- unhookRemote()
- end
- end)
- -- === STATIC RIM DETECTION ===
- local RimSize = Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
- local Rims = {}
- for _, v in ipairs(Workspace:GetDescendants()) do
- if v:IsA('BasePart') and v.Name == 'Rim' and v.Size == RimSize then
- table.insert(Rims, v)
- end
- end
- Workspace.DescendantAdded:Connect(function(o)
- if o:IsA('BasePart') and o.Name == 'Rim' and o.Size == RimSize then
- table.insert(Rims, o)
- end
- end)
- Workspace.DescendantRemoving:Connect(function(o)
- for i, rim in ipairs(Rims) do
- if rim == o then table.remove(Rims, i); break end
- end
- if selectedRim == o then selectedRim = nil end
- end)
- local function nearestRim(rootPos)
- local nearest, nearestDist
- for _, rim in ipairs(Rims) do
- if rim:IsDescendantOf(Workspace) then
- local rimXZ = Vector3.new(rim.Position.X, 0, rim.Position.Z)
- local dist = (rimXZ - Vector3.new(rootPos.X, 0, rootPos.Z)).Magnitude
- if not nearestDist or dist < nearestDist then
- nearest, nearestDist = rim, dist
- end
- end
- end
- return nearest, nearestDist
- end
- local function getNearestPerfectDistance(current)
- local nearest, smallestDiff
- for _, pd in ipairs(PERFECT_DISTANCES) do
- local diff = math.abs(pd - current)
- if not smallestDiff or diff < smallestDiff then
- nearest, smallestDiff = pd, diff
- end
- end
- return nearest
- end
- -- === SHOOT LOGIC ===
- local lastTick, moveOffset = 0, Vector3.zero
- local function computeOffset()
- if tick() - lastTick > 0.1 then
- local hum = plr.Character and plr.Character:FindFirstChildOfClass('Humanoid')
- local moveDir = (hum and hum.MoveDirection) or Vector3.zero
- moveOffset = Vector3.new(moveDir.X * 1.5, 0, moveDir.Z * 1.5)
- lastTick = tick()
- end
- return moveOffset
- end
- local function computeArc(dist) return Vector3.new(0, 43 + (dist / 15), 0) end
- local function smartAim(rim)
- local offset = computeOffset()
- local root = plr.Character and plr.Character:FindFirstChild('HumanoidRootPart')
- if not root then return rim.Position end
- local dist = (root.Position - rim.Position).Magnitude
- return rim.Position + computeArc(dist) - offset
- end
- local function fireShootRemote(aimPos, shootFrom)
- if not shootRemote then return end
- if shootRemote.Name:lower():find('shoot') and shootRemote.Parent and shootRemote.Parent:IsDescendantOf(Workspace) then
- local char = plr.Character
- local root = char and char.PrimaryPart
- local head = char and char:FindFirstChild('Head')
- if not (char and root and head) then return end
- local dir = (aimPos - head.Position).Unit
- local stateTable = {
- CFrame = root.CFrame,
- FieldOfView = Camera.FieldOfView,
- ViewportSize = Camera.ViewportSize,
- }
- local tool = ballTool or (char and char:FindFirstChildOfClass('Tool'))
- shootRemote:FireServer(
- aimPos,
- shootFrom or (root.Position + dir * 4),
- shootKey,
- tool,
- CURRENT_POWER, -- dynamic power
- stateTable,
- true
- )
- else
- shootRemote:FireServer(aimPos, shootFrom, shootKey)
- end
- end
- local function shootAtTarget()
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
- if not (selectedRim and selectedRim:IsDescendantOf(Workspace)) then return end
- if not shootKey then return end
- if not shootRemote then return end
- local char = plr.Character
- if not char then return end
- local head, root = char:FindFirstChild('Head'), char.PrimaryPart
- if not (head and root) then return end
- local aimPos = smartAim(selectedRim)
- local dir = (aimPos - head.Position).Unit
- local shootFrom = root.Position + dir * 3.8
- if shootFrom.Y - root.Position.Y < 4 then
- shootFrom = root.Position + dir * 4
- end
- fireShootRemote(aimPos, shootFrom)
- end
- UserInputService.InputBegan:Connect(function(i, gp)
- if gp or not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
- if i.UserInputType == Enum.UserInputType.MouseButton1 and hasBall() then
- shootAtTarget()
- end
- end)
- -- === VISUALS & PUSH ===
- local hl = CoreGui:FindFirstChild('PerfectRangeGlow') or Instance.new('Highlight')
- hl.Name = 'PerfectRangeGlow'
- hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- hl.FillTransparency = 0.25
- hl.OutlineTransparency = 0
- hl.Adornee = plr.Character
- hl.Parent = CoreGui
- hl.Enabled = false
- local moveKeys = { W=false, A=false, S=false, D=false }
- UserInputService.InputBegan:Connect(function(i,gp) if gp then return end local k=i.KeyCode.Name if moveKeys[k]~=nil then moveKeys[k]=true end end)
- UserInputService.InputEnded:Connect(function(i,gp) if gp then return end local k=i.KeyCode.Name if moveKeys[k]~=nil then moveKeys[k]=false end end)
- local function shouldPush()
- local c=0 for _,v in pairs(moveKeys) do if v then c+=1 end end
- return c==1 and (moveKeys.A or moveKeys.D)
- end
- local smoothBias = Vector3.zero
- RunService.RenderStepped:Connect(function()
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then hl.Enabled=false return end
- local char=plr.Character
- local hum=char and char:FindFirstChildOfClass('Humanoid')
- local root=char and char:FindFirstChild('HumanoidRootPart')
- if not (hum and root) then return end
- if not hasBall() then hl.Enabled=false return end
- -- choose rim by static size set
- local rim,dist=nearestRim(root.Position)
- if not rim or dist>ACTIVE_RANGE_MAIN then hl.Enabled=false smoothBias=Vector3.zero return end
- selectedRim=rim
- local target=getNearestPerfectDistance(dist)
- local diff=dist-target
- local absDiff=math.abs(diff)
- -- Strength profile:
- -- - Inside CLAMP_RADIUS: strong push (linear up to 1.0)
- -- - Between CLAMP_RADIUS and SOFT_RADIUS: gentle pull-in (falls off to 0)
- -- - Outside SOFT_RADIUS: no push
- local strength
- if absDiff <= CLAMP_RADIUS then
- strength = (CLAMP_RADIUS - absDiff) / CLAMP_RADIUS -- 0..1
- elseif absDiff <= SOFT_RADIUS then
- strength = (SOFT_RADIUS - absDiff) / SOFT_RADIUS * 0.35 -- gentle, max ~0.35
- else
- strength = 0
- end
- strength = math.clamp(strength, 0, 1)
- local desired = Vector3.zero
- if shouldPush() and strength > 0 then
- local toRim=Vector3.new(rim.Position.X,0,rim.Position.Z)-Vector3.new(root.Position.X,0,root.Position.Z)
- local distSign=math.sign(diff)
- if distSign>0 then
- local pushDir=-toRim.Unit
- desired=pushDir*math.min(strength*MAX_PUSH,MAX_PUSH)
- end
- end
- smoothBias=smoothBias*DAMPING+desired*(1-DAMPING)
- root.CFrame+=Vector3.new(smoothBias.X,0,smoothBias.Z)
- if VisualsEnabled then
- hl.Enabled=true
- if absDiff<=0.10 then
- hl.FillColor,hl.OutlineColor=COLOR_GREEN,COLOR_GREEN
- elseif absDiff<SOFT_RADIUS then
- hl.FillColor,hl.OutlineColor=COLOR_GREEN_SOFT,COLOR_GREEN_SOFT
- else
- hl.Enabled=false
- end
- else
- hl.Enabled=false
- end
- end)
- plr.CharacterAdded:Connect(function(c)
- task.wait(0.5)
- hl.Adornee=c
- end)
- print('[🏀 PAYLOAD0 LOADED — STATIC RimSize + AUTO POWER + SOFT PUSH]')
- print('[V] Toggle system | [O] Toggle visuals | [LMB] Shoot')
Advertisement
Add Comment
Please, Sign In to add comment