Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- // ==============================================
- -- // PAYLOAD0 – CLICK TO CALIBRATE + HOLD F TO AUTO-SHOOT
- -- // Perfect Distance | Auto-Jump | One Shot Per Jump
- -- // MULTI-POWER SUPPORT (54.68 → 75, 40.54 → 20, …)
- -- // ==============================================
- 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 SystemOn = true
- local shootKey = nil
- local selectedRim = nil
- local activeNotifyGui = nil
- local ballTool = nil
- -- === NEW STATE (F-HOLD SYSTEM) ===
- local fKeyDown = false
- local SystemActive = false -- true while F is held
- -- === CONFIGURATION ===
- local ACTIVE_RANGE_MAIN = 90
- -- === POWER MAP ===
- -- distance → power (add as many as you want)
- local DISTANCE_TO_POWER = {
- [61.25] = 80, -- Far shot
- --[30.00] = 15, -- example
- }
- -- Perfect distance system
- local PERFECT_DISTANCES = { 61.25 } -- list every distance you use
- local PERFECT_TOL = 0.12
- local PREDICTIVE_BIAS = 2.0
- local SINGLE_SHOT_PER_JUMP = true
- -- Auto-jump
- local AUTOJUMP_PREWINDOW = 4.0
- local AUTOJUMP_COOLDOWN = 0.20
- local MIN_JUMP_VELOCITY = 2.2
- -- Remote replay
- local INCLUDE_TEMPLATE_ARGS = true
- local lastArgTemplate = nil
- -- Rim size
- local RimSize =
- Vector3.new(3.632131576538086, 0.35878971219062805, 3.632131576538086)
- -- === NOTIFY SYSTEM ===
- local function notify(msg)
- 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.Position = UDim2.new(0.5, 0, 0.9, 0)
- label.Size = UDim2.new(0, 560, 0, 38)
- label.BackgroundTransparency = 1
- label.Font = Enum.Font.Code
- label.TextSize = 26
- label.TextColor3 = Color3.fromRGB(255, 255, 255)
- label.Text = msg
- label.Parent = gui
- task.delay(1.2, function()
- if gui == activeNotifyGui then
- gui:Destroy()
- activeNotifyGui = nil
- end
- end)
- end
- -- === 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 (ORIGINAL) ===
- 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
- Instance.new('UICorner', frame).CornerRadius = UDim.new(0, 10)
- 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(255, 255, 255)
- 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)
- -- === REMOTE HOOKING (ORIGINAL + TEMPLATE CAPTURE + NEAR-PAIR LISTENER) ===
- local shootRemote = 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 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
- -- === NEAR-PAIR SIGNATURE HELPERS ===
- local function isVector3(v)
- return typeof(v) == "Vector3"
- end
- local function looksLikeShootPacket(args)
- -- Matches your captured remote:
- -- FireServer(Vector3, Vector3, "🔥🔥", tool, number, table, bool)
- if #args < 6 then
- return false
- end
- return isVector3(args[1])
- and isVector3(args[2])
- and type(args[3]) == "string" and #args[3] <= 6
- and typeof(args[4]) == "Instance"
- and type(args[5]) == "number"
- and type(args[6]) == "table"
- end
- local function hookRemote(remote)
- if hookedMeta then
- return
- end
- local old
- old = hookmetamethod(game, '__namecall', function(self, ...)
- local m = getnamecallmethod()
- if m == 'FireServer' then
- local args = { ... }
- -- ORIGINAL BEHAVIOR: only when self == remote
- if self == remote then
- -- Capture shootKey on first legit shot
- if type(args[3]) == 'string' and not shootKey then
- shootKey = args[3]
- removeCalibrateUI()
- notify('Shoot key captured: ' .. shootKey)
- end
- -- Save full argument template
- if INCLUDE_TEMPLATE_ARGS then
- lastArgTemplate = args
- end
- -- NEW: NEAR-PAIR LISTENER (same packet shape, different remote)
- elseif looksLikeShootPacket(args) then
- if type(args[3]) == 'string' and not shootKey then
- shootKey = args[3]
- removeCalibrateUI()
- notify('Shoot key (near-pair) captured: ' .. shootKey)
- end
- if INCLUDE_TEMPLATE_ARGS then
- lastArgTemplate = args
- end
- end
- end
- return old(self, ...)
- end)
- hookedMeta = old
- shootRemote = remote
- end
- local function unhookRemote()
- hookedMeta = nil
- shootRemote = nil
- end
- RunService.Heartbeat:Connect(function()
- if not SystemOn then
- return
- end
- local current = findShootRemote()
- if current then
- if current ~= shootRemote then
- unhookRemote()
- hookRemote(current)
- end
- elseif shootRemote then
- unhookRemote()
- end
- end)
- -- === RIM DETECTION ===
- 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)
- -- Rim selector (runs always when system on)
- task.spawn(function()
- while task.wait(0.1) do
- if not SystemOn then
- continue
- end
- local root = plr.Character
- and plr.Character:FindFirstChild('HumanoidRootPart')
- if not root then
- continue
- end
- local bestRim, bestDist = nil, 85
- for _, rim in ipairs(Rims) do
- if rim:IsDescendantOf(Workspace) then
- local dist = (rim.Position - root.Position).Magnitude
- if dist < bestDist then
- local _, on = Camera:WorldToViewportPoint(rim.Position)
- if on then
- bestRim, bestDist = rim, dist
- end
- end
- end
- end
- selectedRim = bestRim
- end
- end)
- -- === AIM HELPERS ===
- 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 getLolChild(rim)
- if not rim then
- return nil
- end
- for _, ch in ipairs(rim:GetChildren()) do
- if ch:IsA('BasePart') and ch.Name == 'Lol' then
- return ch
- end
- end
- local p = rim.Parent
- if p then
- local c = p:FindFirstChild('Lol')
- if c and c:IsA('BasePart') then
- return c
- end
- end
- return nil
- end
- local function planarDistance(a, b)
- local dx, dz = a.X - b.X, a.Z - b.Z
- return math.sqrt(dx * dx + dz * dz)
- end
- local function getNearestPerfectDistance(current)
- local nearest
- for _, pd in ipairs(PERFECT_DISTANCES) do
- local diff = math.abs(pd - current)
- if not nearest or diff < (math.abs(nearest - current)) then
- nearest = pd
- end
- end
- return nearest or current
- end
- -- === DYNAMIC POWER SELECTOR ===
- local function getPowerForDistance(dist)
- local exact = DISTANCE_TO_POWER[dist]
- if exact then
- return exact
- end
- -- fallback: closest entry
- local bestDist, bestPower = nil, nil
- for d, p in pairs(DISTANCE_TO_POWER) do
- local diff = math.abs(d - dist)
- if not bestDist or diff < (math.abs(bestDist - dist)) then
- bestDist, bestPower = d, p
- end
- end
- return bestPower or 75
- end
- -- === FIRE REMOTE (TEMPLATE REPLAY + DYNAMIC POWER) ===
- local function fireShootRemote(aimPos, shootFrom, targetDist)
- if not (shootRemote and shootKey) then
- return
- end
- local c = plr.Character
- local head = c and c:FindFirstChild('Head')
- local root = c and c.PrimaryPart
- if not (c and head and root) then
- return
- end
- -- ----- TEMPLATE REPLAY -----
- if INCLUDE_TEMPLATE_ARGS and lastArgTemplate then
- local args = table.clone(lastArgTemplate)
- local v3Idx = {}
- for i, v in ipairs(args) do
- if typeof(v) == 'Vector3' then
- table.insert(v3Idx, i)
- end
- end
- if #v3Idx >= 2 then
- args[v3Idx[1]] = aimPos
- args[v3Idx[2]] = shootFrom
- end
- for i, v in ipairs(args) do
- if type(v) == 'string' and v ~= shootKey and #v <= 6 then
- args[i] = shootKey
- break
- end
- end
- -- inject correct power
- for i = #args, math.max(1, #args - 3), -1 do
- if type(args[i]) == 'number' then
- args[i] = getPowerForDistance(targetDist)
- break
- end
- end
- shootRemote:FireServer(table.unpack(args))
- return
- end
- -- ----- FALLBACK -----
- local tool = ballTool or (c and c:FindFirstChildOfClass('Tool'))
- shootRemote:FireServer(
- aimPos,
- shootFrom,
- shootKey,
- tool,
- getPowerForDistance(targetDist), -- dynamic power
- {
- CFrame = root.CFrame,
- FieldOfView = Camera.FieldOfView,
- ViewportSize = Camera.ViewportSize,
- },
- true
- )
- end
- -- === PER-JUMP STATE ===
- local perJumpShotDone = false
- local lastJumpAssistAt = 0
- local wasOutside = true
- local function resetJumpFlags()
- perJumpShotDone = false
- wasOutside = true
- end
- plr.CharacterAdded:Connect(function()
- task.wait(0.5)
- resetJumpFlags()
- end)
- local function isAirborne(hum)
- if not hum then
- return false
- end
- local st = hum:GetState()
- return not (
- st == Enum.HumanoidStateType.Running
- or st == Enum.HumanoidStateType.RunningNoPhysics
- or st == Enum.HumanoidStateType.Landed
- or st == Enum.HumanoidStateType.Seated
- )
- end
- -- === INPUT HANDLERS ===
- UserInputService.InputBegan:Connect(function(i, gp)
- if gp then
- return
- end
- -- V: Toggle system
- if i.KeyCode == Enum.KeyCode.V then
- SystemOn = not SystemOn
- getgenv().PAYLOAD0_SYSTEM_ACTIVE = SystemOn
- notify(SystemOn and 'System On' or 'System Off')
- end
- -- F: Hold to activate auto-shoot
- if i.KeyCode == Enum.KeyCode.F then
- if fKeyDown then
- return
- end
- fKeyDown = true
- SystemActive = true
- notify('AUTO-SHOOT ON (Hold F)')
- end
- -- Click: Only for calibration
- if
- SystemOn
- and i.UserInputType == Enum.UserInputType.MouseButton1
- and hasBall()
- and not shootKey
- then
- notify('Calibrating... click to shoot once.')
- end
- end)
- UserInputService.InputEnded:Connect(function(i, gp)
- if gp or i.KeyCode ~= Enum.KeyCode.F then
- return
- end
- if not fKeyDown then
- return
- end
- fKeyDown = false
- SystemActive = false
- notify('AUTO-SHOOT OFF')
- end)
- -- === MAIN AUTO-SHOOT LOOP (F-HOLD) ===
- RunService.RenderStepped:Connect(function(dt)
- if
- not (
- SystemActive
- and SystemOn
- and hasBall()
- and shootKey
- and selectedRim
- )
- then
- return
- end
- local c = plr.Character
- local hum = c and c:FindFirstChildOfClass('Humanoid')
- local root = c
- and (
- c:FindFirstChild('HumanoidRootPart')
- or c:FindFirstChildWhichIsA('BasePart')
- )
- local head = c and c:FindFirstChild('Head')
- if not (hum and root and head) then
- return
- end
- local rim = selectedRim
- if not rim:IsDescendantOf(Workspace) then
- return
- end
- local lol = getLolChild(rim)
- local refPos = (lol and lol.Position) or rim.Position
- local dist = planarDistance(root.Position, refPos)
- if dist > ACTIVE_RANGE_MAIN then
- return
- end
- local target = getNearestPerfectDistance(dist)
- local diff = dist - target
- local absDiff = math.abs(diff)
- local vel = root.AssemblyLinearVelocity or root.Velocity
- local yVel = vel.Y
- local airborne = (yVel > MIN_JUMP_VELOCITY) or isAirborne(hum)
- -- Auto-jump when entering perfect zone
- if not airborne then
- local entering = (diff > 0)
- and (diff <= AUTOJUMP_PREWINDOW)
- and wasOutside
- if entering and (tick() - lastJumpAssistAt > AUTOJUMP_COOLDOWN) then
- hum:ChangeState(Enum.HumanoidStateType.Jumping)
- lastJumpAssistAt = tick()
- wasOutside = false
- elseif diff > AUTOJUMP_PREWINDOW then
- wasOutside = true
- elseif diff < 0 then
- wasOutside = false
- end
- end
- -- Auto-shoot
- if airborne and not (SINGLE_SHOT_PER_JUMP and perJumpShotDone) then
- local predictedPos = root.Position + vel * dt
- local pDist = planarDistance(predictedPos, refPos)
- local pTarget = getNearestPerfectDistance(pDist)
- if
- math.abs(pDist - pTarget) <= (PERFECT_TOL * PREDICTIVE_BIAS)
- or absDiff <= PERFECT_TOL
- then
- local aimPos = smartAim(rim)
- local dir = (aimPos - head.Position).Unit
- local shootFrom = root.Position + dir * 4
- fireShootRemote(aimPos, shootFrom, target) -- pass the perfect distance
- perJumpShotDone = true
- end
- end
- end)
- -- Reset on land
- task.spawn(function()
- local lastState
- while task.wait(0.02) do
- local hum = plr.Character
- and plr.Character:FindFirstChildOfClass('Humanoid')
- if hum then
- local st = hum:GetState()
- if
- st ~= lastState
- and (
- st == Enum.HumanoidStateType.Landed
- or st == Enum.HumanoidStateType.Running
- )
- then
- resetJumpFlags()
- end
- lastState = st
- end
- end
- end)
- --[[
- Payload0 Arc Visualizer (One-Time Placement Edition)
- Creates static, anchored arcs for each Rim once and never updates them.
- Zero loops, zero runtime cost, no transparency toggles.
- ]]
- -- === SERVICES ===
- local Players = game:GetService('Players')
- local Workspace = game:GetService('Workspace')
- -- === CONFIGURATION ===
- local PERFECT_DISTANCES = { 64.25 }
- local RING_ARC_DEGREES = 180
- local DEGREE_STEP = 4
- local DOT_MATERIAL = Enum.Material.Neon
- local DOT_COLOR = Color3.fromRGB(0, 0, 0)
- local LINK_THICKNESS = 0.25
- local RIM_SIZE =
- Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
- local HEIGHT_OFFSET = -18.361
- local ARC_ADJUSTMENTS = { [1] = -18 }
- -- === INTERNALS ===
- local ArcFolder = Instance.new('Folder', Workspace)
- ArcFolder.Name = 'Payload0_StaticArcs'
- -- === HELPERS ===
- local function isValidRim(o)
- return o:IsA('BasePart') and o.Name == 'Rim' and o.Size == RIM_SIZE
- end
- local function createStaticArc(rimPart, radius, extraDegrees)
- local model = Instance.new('Model')
- model.Name = 'Payload0_StaticArc_' .. rimPart:GetDebugId()
- model.Parent = ArcFolder
- local forward = rimPart.CFrame.LookVector
- local right = rimPart.CFrame.RightVector
- local startDeg = -RING_ARC_DEGREES / 2 - extraDegrees
- local endDeg = RING_ARC_DEGREES / 2 + extraDegrees
- local points = {}
- for deg = startDeg, endDeg, DEGREE_STEP do
- local rad = math.rad(deg)
- local offset = (forward * math.cos(rad) + right * math.sin(rad))
- * radius
- table.insert(
- points,
- rimPart.Position + Vector3.new(offset.X, HEIGHT_OFFSET, offset.Z)
- )
- end
- for i = 1, #points - 1 do
- local a, b = points[i], points[i + 1]
- local dist = (a - b).Magnitude
- local link = Instance.new('Part')
- link.Anchored = true
- link.CanCollide = false
- link.Material = DOT_MATERIAL
- link.Color = DOT_COLOR
- link.Transparency = 0
- link.Size = Vector3.new(LINK_THICKNESS, LINK_THICKNESS, dist)
- link.CFrame = CFrame.new(a, b) * CFrame.new(0, 0, -dist / 2)
- link.Parent = model
- end
- return model
- end
- local function registerRim(rim)
- -- Skip if already has arcs
- if ArcFolder:FindFirstChild('Payload0_StaticArc_' .. rim:GetDebugId()) then
- return
- end
- for i, dist in ipairs(PERFECT_DISTANCES) do
- local extra = ARC_ADJUSTMENTS[i] or 0
- createStaticArc(rim, dist, extra)
- end
- end
- -- === INITIAL SCAN ===
- for _, v in ipairs(Workspace:GetDescendants()) do
- if isValidRim(v) then
- registerRim(v)
- end
- end
- -- === AUTO REGISTER ON SPAWN ===
- Workspace.DescendantAdded:Connect(function(o)
- if isValidRim(o) then
- registerRim(o)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment