Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task.spawn(function()
- -- AUTO-SHOOT + POWER DETECTION
- -- Hold F → Auto-Jump + Auto-Shoot
- -- Y → Rim Lock / Unlock (toast + deluxe rim visual)
- -- 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
- local SystemActive = false
- local VisualsEnabled = true
- local shootKey = nil
- local selectedRim = nil
- local manualRim = nil
- local activeNotifyGui = nil
- 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)
- local PERFECT_TOL = 0.12
- local PREDICTIVE_BIAS = 2.0
- local MIN_JUMP_VELOCITY = 2.2
- local SINGLE_SHOT_PER_JUMP = true
- local AUTOJUMP_PREWINDOW = 4.0
- local AUTOJUMP_COOLDOWN = 0.20
- local RimSize = Vector3.new(3.632131576538086,0.5587897300720215,3.632131576538086)
- -- ================== POWER SYSTEM ======================
- local currentPower = 0
- local function attachPowerListener(character)
- 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 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)
- local POWER_TO_DISTANCE = {
- [75] = 55.68,
- [80] = 62.25,
- [85] = 68.80,
- }
- local function getTargetDistance()
- return POWER_TO_DISTANCE[currentPower]
- 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
- -- ================== RIM LOCK TOAST ====================
- local rimLockToast = nil
- local function showRimLockToast(text)
- if rimLockToast then
- rimLockToast:Destroy()
- rimLockToast = nil
- end
- local gui = Instance.new("ScreenGui")
- gui.Name = "RimLockToast"
- gui.ResetOnSpawn = false
- gui.Parent = CoreGui
- rimLockToast = gui
- local label = Instance.new("TextLabel")
- label.AnchorPoint = Vector2.new(0.5,0.5)
- label.Position = UDim2.new(0.5,0,0.82,0)
- label.Size = UDim2.new(0,280,0,32)
- label.BackgroundTransparency = 1
- label.Font = Enum.Font.GothamBold
- label.TextSize = 22
- label.TextColor3 = Color3.fromRGB(120,255,150)
- label.Text = text
- label.Parent = gui
- task.delay(1.0,function()
- if rimLockToast == gui then
- gui:Destroy()
- rimLockToast = nil
- end
- end)
- end
- -- ================== NORMAL TOAST NOTIFY ===============
- 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 =======================
- 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),{TextTransparency=0.25}):Play()
- task.wait(0.6)
- TweenService:Create(label,TweenInfo.new(0.6),{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)
- -- ================== SHOOT KEY CAPTURE ==================
- 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
- -- rimLockToast auto-cleans; visual also auto-fades
- end
- end)
- local function getLolChild(rim)
- if not rim or not rim:IsDescendantOf(Workspace) then return nil end
- for _,child in ipairs(rim:GetChildren()) do
- if child:IsA("BasePart") and child.Name == "Lol" then
- return child
- end
- end
- local parent = rim.Parent
- if parent then
- local c = parent:FindFirstChild("Lol")
- if c and c:IsA("BasePart") then
- return c
- end
- end
- return nil
- end
- -- ====================== RIM LOCK VISUALS (DELUXE) ======================
- 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)
- -- Billboard
- 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.TextColor3 = Color3.fromRGB(120, 255, 150)
- tl.TextTransparency = 0
- tl.Text = "LOCKED"
- tl.Parent = bb
- -- Start smaller for pulse
- bb.Size = UDim2.fromOffset(85, 20)
- -- SelectionBox
- local sb = Instance.new("SelectionBox")
- sb.Name = "RimSelectionBox"
- sb.Adornee = target
- sb.Color3 = Color3.fromRGB(120, 255, 150)
- sb.LineThickness = 0.02
- sb.SurfaceTransparency = 1
- sb.Parent = target
- -- Deluxe fade sequence
- task.delay(1.0, function()
- if not bb.Parent then return end
- local fadeTI = TweenInfo.new(0.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
- local moveTI = TweenInfo.new(0.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
- local pulseTI = TweenInfo.new(0.15, Enum.EasingStyle.Back, Enum.EasingDirection.Out)
- -- 1) Pulse
- TweenService:Create(bb, pulseTI, {
- Size = UDim2.fromOffset(110, 28)
- }):Play()
- task.wait(0.15)
- -- 2) Upward drift
- TweenService:Create(
- bb,
- moveTI,
- { StudsOffsetWorldSpace = Vector3.new(0, 2.2, 0) }
- ):Play()
- -- 3) Fade text
- TweenService:Create(
- tl,
- fadeTI,
- { TextTransparency = 1 }
- ):Play()
- -- 4) Fade selection box (line ↓ 0)
- TweenService:Create(
- sb,
- fadeTI,
- { LineThickness = 0 }
- ):Play()
- task.delay(0.35, function()
- if bb.Parent == target then bb:Destroy() end
- if sb.Parent == target then sb:Destroy() end
- end)
- end)
- end
- -- ====================== SET MANUAL RIM ======================
- 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)
- showRimLockToast("LOCKED RIM")
- else
- notify("Auto rim mode", Color3.fromRGB(180,180,180))
- end
- end
- -- ====================== INPUT HANDLING ======================
- UserInputService.InputBegan:Connect(function(input, gp)
- if gp then return end
- if input.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 input.KeyCode == Enum.KeyCode.Y then
- local mousePos = UserInputService:GetMouseLocation()
- local bestRim, bestPixels = nil, 96
- for _,rim in ipairs(Rims) do
- if rim:IsDescendantOf(Workspace) then
- local v3, onScreen = Camera:WorldToViewportPoint(rim.Position)
- if onScreen then
- local dx = v3.X - mousePos.X
- local dy = v3.Y - mousePos.Y
- local d = math.sqrt(dx*dx + dy*dy)
- if d < bestPixels then
- bestRim, bestPixels = rim, d
- end
- end
- end
- end
- if bestRim then
- if manualRim == bestRim then
- setManualRim(nil)
- else
- setManualRim(bestRim)
- end
- else
- notify("No hoop near cursor", Color3.fromRGB(255,120,120))
- end
- elseif input.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(input, gp)
- if gp then return end
- if input.KeyCode == Enum.KeyCode.F and fKeyDown then
- fKeyDown = false
- SystemActive = false
- getgenv().AUTO_JUMP_ACTIVE = false
- notify("🚫 System OFF (F released)", Color3.fromRGB(255,80,80))
- end
- end)
- -- ====================== AUTO RIM SELECT ======================
- task.spawn(function()
- while task.wait(0.085) do
- if manualRim or not SystemActive then
- continue
- end
- local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
- if not root then continue end
- local best, 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
- best, bestDist = rim, dist
- end
- end
- end
- end
- if best and best ~= selectedRim then
- selectedRim = best
- end
- end
- end)
- local function currentTargetRim()
- return manualRim or selectedRim
- end
- -- ====================== AIM MODEL ======================
- local lastTick = 0
- local moveOffset = 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, b)
- local dx = a.X - b.X
- local dz = a.Z - b.Z
- return math.sqrt(dx * dx + dz * dz)
- 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 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 HIGHLIGHT ======================
- 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)
- 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
- 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 = COLOR_GREEN
- hl.OutlineColor = COLOR_GREEN
- elseif absDiff < CLAMP_RADIUS then
- hl.Enabled = true
- hl.FillColor = COLOR_GREEN_SOFT
- hl.OutlineColor = 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
- 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
- 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)
- end)
Advertisement
Add Comment
Please, Sign In to add comment