Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- PAYLOAD0 – POWER-BASED DYNAMIC CALIBRATION
- -- Hold F → Auto-Jump + Auto-Shoot
- -- Y → Rim Lock / Unlock
- -- O → Visuals Toggle
- -- Uses live Power → Perfect Distance mapping
- -- ====================== 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
- -- ====================== LOCALS ========================
- local plr = Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:Wait()
- local remotes = ReplicatedStorage:WaitForChild('Remotes')
- local shootRemote = remotes:WaitForChild('Shoot')
- -- ====================== STATE =========================
- getgenv().AUTO_JUMP_ACTIVE = false -- Controlled by F hold
- local SystemActive = false -- DEFAULT OFF
- local VisualsEnabled = true
- local shootKey = nil -- captured from legit rc
- local selectedRim = nil -- auto-selected rim
- local manualRim = nil -- Y-key locked rim
- local activeNotifyGui = nil
- -- F-key hold tracking
- local fKeyDown = false
- -- ====================== CONFIG ========================
- local CLAMP_RADIUS = 1
- local ACTIVE_RANGE_MAIN = 90
- local COLOR_GREEN = Color3.fromRGB(0, 255, 100)
- local COLOR_GREEN_SOFT = Color3.fromRGB(0, 200, 80)
- -- Timing
- local PERFECT_TOL = 0.12
- local PREDICTIVE_BIAS = 2.0
- local MIN_JUMP_VELOCITY = 2.2
- local SINGLE_SHOT_PER_JUMP = true
- -- Auto-jump
- local AUTOJUMP_PREWINDOW = 4.0
- local AUTOJUMP_COOLDOWN = 0.20
- -- Rim signature
- local RimSize =
- Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
- -- ================== POWER SYSTEM ======================
- -- Dynamic Calibration / Power-Based Range Calibration
- -- Tracks live Power so perfect distance auto-updates
- local currentPower = 0
- local function attachPowerListener(character: Model)
- if not character then
- return
- end
- task.spawn(function()
- local ev = character:FindFirstChild('E_V')
- or character:WaitForChild('E_V', 10)
- if not ev then
- return
- end
- local power = ev:FindFirstChild('Power') or ev:WaitForChild('Power', 10)
- if not power or not power.Value then
- return
- end
- currentPower = power.Value
- power:GetPropertyChangedSignal('Value'):Connect(function()
- currentPower = power.Value
- end)
- end)
- end
- attachPowerListener(char)
- plr.CharacterAdded:Connect(function(c2)
- char = c2
- attachPowerListener(c2)
- end)
- -- Power → Perfect Distance Map (edit these to match your game)
- local POWER_TO_DISTANCE = {
- [75] = 54.97,
- [80] = 61.53,
- [85] = 68.10,
- }
- local function getTargetDistance()
- return POWER_TO_DISTANCE[currentPower] or nil
- end
- -- ====================== HELPERS =======================
- 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
- return true
- end
- end
- return false
- end
- local function notify(msg, color)
- if activeNotifyGui and activeNotifyGui.Parent then
- activeNotifyGui:Destroy()
- end
- local gui = Instance.new('ScreenGui')
- gui.ResetOnSpawn = false
- gui.Name = 'PAYLOAD0_Toast'
- 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 = color or Color3.fromRGB(255, 255, 255)
- label.Text = msg
- label.Parent = gui
- task.delay(1.0, function()
- if gui == activeNotifyGui then
- gui:Destroy()
- activeNotifyGui = nil
- end
- end)
- end
- -- ===== Calibrate UI (remains until shootKey captured) =====
- 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.25
- 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.fromScale(1, 1)
- label.Font = Enum.Font.GothamMedium
- label.TextSize = 22
- label.TextColor3 = Color3.fromRGB(120, 255, 150)
- label.Text = 'Click once to calibrate your shot (key capture).'
- label.Parent = frame
- task.spawn(function()
- while calibrateGui and not shootKey and hasBall() do
- TweenService:Create(
- label,
- TweenInfo.new(0.6, Enum.EasingStyle.Sine),
- { TextTransparency = 0.25 }
- ):Play()
- task.wait(0.6)
- TweenService:Create(
- label,
- TweenInfo.new(0.6, Enum.EasingStyle.Sine),
- { TextTransparency = 0 }
- ):Play()
- task.wait(0.6)
- end
- end)
- end
- local function removeCalibrateUI()
- if calibrateGui then
- calibrateGui:Destroy()
- calibrateGui = nil
- end
- end
- task.spawn(function()
- while task.wait(0.4) do
- if not hasBall() or shootKey then
- removeCalibrateUI()
- else
- showCalibrateUI()
- end
- end
- end)
- -- ===== Capture shootKey from remote =====
- local oldNamecall
- oldNamecall = hookmetamethod(game, '__namecall', function(self, ...)
- local m = getnamecallmethod()
- if m == 'FireServer' and self == shootRemote then
- local args = { ... }
- if type(args[3]) == 'string' and not shootKey then
- shootKey = args[3]
- removeCalibrateUI()
- notify('Shoot key captured!', COLOR_GREEN)
- end
- end
- return oldNamecall(self, ...)
- end)
- -- ===== Rim tracking =====
- local Rims = {}
- Workspace.DescendantAdded:Connect(function(o)
- if o:IsA('BasePart') and o.Name == 'Rim' and o.Size == RimSize then
- table.insert(Rims, o)
- end
- end)
- 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.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
- if manualRim == o then
- manualRim = nil
- end
- end)
- local function getLolChild(rim)
- if not rim or not rim:IsDescendantOf(Workspace) 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
- -- ===== Rim Lock Visuals (Y key) =====
- local function clearRimLockVisual(rim)
- if rim and rim:FindFirstChild('RimLockBillboard') then
- rim.RimLockBillboard:Destroy()
- end
- if rim and rim:FindFirstChild('RimSelectionBox') then
- rim.RimSelectionBox:Destroy()
- end
- end
- local function makeLockVisual(target)
- local bb = Instance.new('BillboardGui')
- bb.Name = 'RimLockBillboard'
- bb.Size = UDim2.fromOffset(100, 24)
- bb.AlwaysOnTop = true
- bb.LightInfluence = 0
- bb.StudsOffsetWorldSpace = Vector3.new(0, 1.5, 0)
- bb.Parent = target
- local tl = Instance.new('TextLabel')
- tl.BackgroundTransparency = 1
- tl.Size = UDim2.fromScale(1, 1)
- tl.Font = Enum.Font.GothamBold
- tl.TextSize = 16
- tl.Text = 'LOCKED'
- tl.TextColor3 = Color3.fromRGB(120, 255, 150)
- tl.Parent = bb
- local sb = Instance.new('SelectionBox')
- sb.Name = 'RimSelectionBox'
- sb.Adornee = target
- sb.LineThickness = 0.02
- sb.SurfaceTransparency = 1
- sb.Parent = target
- end
- local function setManualRim(rim)
- if manualRim == rim then
- return
- end
- if manualRim then
- clearRimLockVisual(manualRim)
- end
- manualRim = rim
- if manualRim and manualRim:IsDescendantOf(Workspace) then
- makeLockVisual(manualRim)
- notify('Locked to hoop (Y)', COLOR_GREEN)
- else
- notify('Auto rim mode', Color3.fromRGB(180, 180, 180))
- end
- end
- -- ===== INPUT: F Hold + Y Lock + O Visuals =====
- UserInputService.InputBegan:Connect(function(i, gp)
- if gp then
- return
- end
- if i.KeyCode == Enum.KeyCode.F then
- if not fKeyDown then
- fKeyDown = true
- SystemActive = true
- getgenv().AUTO_JUMP_ACTIVE = true
- notify('✅ System ON (Hold F)', COLOR_GREEN)
- end
- elseif i.KeyCode == Enum.KeyCode.Y then
- -- Y = Lock nearest visible rim
- local mousePos = UserInputService:GetMouseLocation()
- local best, bestPixels = nil, 96
- for _, rim in ipairs(Rims) do
- if rim:IsDescendantOf(Workspace) then
- local v3, on = Camera:WorldToViewportPoint(rim.Position)
- if on then
- local dx, dy = v3.X - mousePos.X, v3.Y - mousePos.Y
- local d = math.sqrt(dx * dx + dy * dy)
- if d < bestPixels then
- best, bestPixels = rim, d
- end
- end
- end
- end
- if best then
- if manualRim == best then
- setManualRim(nil)
- else
- setManualRim(best)
- end
- else
- notify('No hoop near cursor', Color3.fromRGB(255, 120, 120))
- end
- elseif i.KeyCode == Enum.KeyCode.O then
- VisualsEnabled = not VisualsEnabled
- notify(
- VisualsEnabled and '👁 Visuals ON' or '🙈 Visuals OFF',
- VisualsEnabled and COLOR_GREEN or Color3.fromRGB(255, 80, 80)
- )
- end
- end)
- UserInputService.InputEnded:Connect(function(i, gp)
- if gp then
- return
- end
- if i.KeyCode == Enum.KeyCode.F then
- if fKeyDown then
- fKeyDown = false
- SystemActive = false
- getgenv().AUTO_JUMP_ACTIVE = false
- notify('🚫 System OFF (F released)', Color3.fromRGB(255, 80, 80))
- end
- end
- end)
- -- ===== Auto rim selector (when not locked) =====
- task.spawn(function()
- while task.wait(0.085) do
- if not SystemActive or manualRim 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
- if bestRim and bestRim ~= selectedRim then
- selectedRim = bestRim
- end
- end
- end)
- local function currentTargetRim()
- return manualRim or selectedRim
- end
- -- ===== Aim model =====
- local lastTick, moveOffset = 0, Vector3.zero
- local function computeOffset()
- if tick() - lastTick > 0.09 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 planarDistance(a: Vector3, b: Vector3)
- local dx, dz = a.X - b.X, a.Z - b.Z
- return math.sqrt(dx * dx + dz * dz)
- end
- local function smartAim(rim: BasePart)
- 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 shootAtTarget()
- if not (SystemActive and shootKey and hasBall()) then
- return
- end
- local rim = currentTargetRim()
- if not (rim and rim:IsDescendantOf(Workspace)) then
- return
- end
- local c = plr.Character
- if not c then
- return
- end
- local head = c:FindFirstChild('Head')
- local root = c.PrimaryPart
- if not (head and root) then
- return
- end
- local aimPos = smartAim(rim)
- local dir = (aimPos - head.Position).Unit
- local shootFrom = root.Position + dir * 4
- shootRemote:FireServer(aimPos, shootFrom, shootKey)
- end
- -- ===== Visual cue =====
- 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
- plr.CharacterAdded:Connect(function(c2)
- task.wait(0.5)
- hl.Adornee = c2
- end)
- -- ===== Per-jump state =====
- local perJumpShotDone = false
- local lastJumpAssistAt = 0
- local wasOutside = true
- local function resetJumpFlags()
- perJumpShotDone = false
- end
- plr.CharacterAdded:Connect(function()
- task.wait(0.5)
- resetJumpFlags()
- end)
- local function isAirborne(hum: Humanoid?)
- 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
- -- ===== Core loop (RenderStepped) =====
- RunService.RenderStepped:Connect(function(dt)
- if not SystemActive then
- hl.Enabled = false
- return
- end
- local c = plr.Character
- local hum = c and c:FindFirstChildOfClass('Humanoid')
- local root = c
- and (
- c:FindFirstChild('HumanoidRootPart')
- or c:FindFirstChildWhichIsA('BasePart')
- )
- if not (hum and root) then
- hl.Enabled = false
- return
- end
- local rim = currentTargetRim()
- if not rim or not rim:IsDescendantOf(Workspace) then
- hl.Enabled = false
- 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
- hl.Enabled = false
- return
- end
- -- Power-based target distance
- local target = getTargetDistance()
- if not target then
- hl.Enabled = false
- return
- end
- local diff = dist - target
- local absDiff = math.abs(diff)
- -- Visuals
- if VisualsEnabled then
- if absDiff <= PERFECT_TOL then
- hl.Enabled = true
- hl.FillColor, hl.OutlineColor = COLOR_GREEN, COLOR_GREEN
- elseif absDiff < CLAMP_RADIUS then
- hl.Enabled = true
- hl.FillColor, hl.OutlineColor = COLOR_GREEN_SOFT, COLOR_GREEN_SOFT
- else
- hl.Enabled = false
- end
- else
- hl.Enabled = false
- end
- local vel = root.AssemblyLinearVelocity or root.Velocity
- local yVel = vel.Y
- local airborne = (yVel > MIN_JUMP_VELOCITY) or isAirborne(hum)
- -- Auto-jump (front-entry only)
- if hasBall() and getgenv().AUTO_JUMP_ACTIVE and not airborne then
- local enteringFromFront = (diff > 0)
- and (diff <= AUTOJUMP_PREWINDOW)
- and wasOutside
- if
- enteringFromFront
- and (time() - lastJumpAssistAt > AUTOJUMP_COOLDOWN)
- then
- hum:ChangeState(Enum.HumanoidStateType.Jumping)
- lastJumpAssistAt = time()
- wasOutside = false
- elseif diff > AUTOJUMP_PREWINDOW then
- wasOutside = true
- elseif diff < 0 then
- wasOutside = false
- end
- else
- wasOutside = (diff > AUTOJUMP_PREWINDOW)
- end
- -- Auto-shoot (power-calibrated)
- if
- hasBall()
- and airborne
- and shootKey
- and not (SINGLE_SHOT_PER_JUMP and perJumpShotDone)
- then
- local target2 = getTargetDistance()
- if not target2 then
- return
- end
- local predictedPos = root.Position + vel * dt
- local pDist = planarDistance(predictedPos, refPos)
- if math.abs(pDist - target2) <= (PERFECT_TOL * PREDICTIVE_BIAS) then
- shootAtTarget()
- perJumpShotDone = true
- return
- end
- if absDiff <= PERFECT_TOL then
- shootAtTarget()
- perJumpShotDone = true
- return
- 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 then
- if
- st == Enum.HumanoidStateType.Landed
- or st == Enum.HumanoidStateType.Running
- or st == Enum.HumanoidStateType.Seated
- then
- resetJumpFlags()
- end
- lastState = st
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment