Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------
- -- BLOCK 1: AUTO-JUMP + AUTO-SHOOT + POWER-BASED RIM SYSTEM (A.txt)
- -- - Captures shootKey ONCE
- -- - Exports it globally: getgenv().PAYLOAD0_SHOOTKEY
- -- - Handles auto-jump, predictive auto-shoot, rim lock, etc.
- ---------------------------------------------------------------------
- task.spawn(function()
- 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
- 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)
- local currentPower = 0
- -- POWER LISTENER
- 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 ======================
- 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]
- getgenv().PAYLOAD0_SHOOTKEY = shootKey -- <<< GLOBAL EXPORT
- 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 _, 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 ==========
- 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.TextColor3 = Color3.fromRGB(120, 255, 150)
- tl.TextTransparency = 0
- tl.Text = "LOCKED"
- tl.Parent = bb
- bb.Size = UDim2.fromOffset(85, 20)
- 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
- 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)
- TweenService:Create(bb, pulseTI, {
- Size = UDim2.fromOffset(110, 28)
- }):Play()
- task.wait(0.15)
- TweenService:Create(
- bb,
- moveTI,
- { StudsOffsetWorldSpace = Vector3.new(0, 2.2, 0) }
- ):Play()
- TweenService:Create(tl, fadeTI, { TextTransparency = 1 }):Play()
- 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
- 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 =========================
- 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)
- ---------------------------------------------------------------------
- -- BLOCK 2: MANUAL CLICK SHOOT + PUSH-ASSIST PERFECT RANGE SYSTEM
- -- - NEVER captures key
- -- - ONLY reads getgenv().PAYLOAD0_SHOOTKEY
- -- - Uses PERFECT_DISTANCES + push to clamp you into money range
- ---------------------------------------------------------------------
- task.spawn(function()
- 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 Workspace = game:GetService("Workspace")
- local Camera = Workspace.CurrentCamera
- local plr = Players.LocalPlayer
- local char = plr.Character or plr.CharacterAdded:Wait()
- local remotes = ReplicatedStorage:WaitForChild("Remotes")
- local shootRemote = remotes:WaitForChild("Shoot")
- getgenv().PAYLOAD0_SYSTEM_ACTIVE = true
- local VisualsEnabled = true
- local shootKey = nil -- only read from global
- local selectedRim = nil
- local activeNotifyGui
- local PERFECT_DISTANCES = {54.97, 61.53, 68.10}
- local CLAMP_RADIUS = 1
- 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)
- -- 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
- 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.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
- -- SHOOT KEY LISTENER (no capture here)
- task.spawn(function()
- while task.wait(0.1) do
- local k = rawget(getgenv(), "PAYLOAD0_SHOOTKEY")
- if type(k) == "string" then
- shootKey = k
- notify("Shoot key linked (Manual)", COLOR_GREEN)
- break
- end
- end
- end)
- -- RIM TRACKING (nearest visible rim)
- local RimSize = Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
- 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
- end)
- -- auto select closest, camera-visible rim
- task.spawn(function()
- while task.wait(0.1) do
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE 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)
- -- toggles
- UserInputService.InputBegan:Connect(function(i, gp)
- if gp then return end
- if 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)
- )
- elseif i.KeyCode == Enum.KeyCode.V then
- getgenv().PAYLOAD0_SYSTEM_ACTIVE = not getgenv().PAYLOAD0_SYSTEM_ACTIVE
- notify(
- getgenv().PAYLOAD0_SYSTEM_ACTIVE and "✅ Manual System ON"
- or "🚫 Manual System OFF",
- getgenv().PAYLOAD0_SYSTEM_ACTIVE and COLOR_GREEN
- or Color3.fromRGB(255, 80, 80)
- )
- end
- end)
- -- shooting 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 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
- 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(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
- shootRemote:FireServer(aimPos, shootFrom, shootKey)
- end
- -- click to shoot (manual)
- 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
- if shootKey then
- shootAtTarget()
- end
- end
- end)
- -- highlight + push logic
- local hl2 = CoreGui:FindFirstChild("PerfectRangeGlow_Manual") or Instance.new("Highlight")
- hl2.Name = "PerfectRangeGlow_Manual"
- hl2.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- hl2.FillTransparency = 0.25
- hl2.OutlineTransparency = 0
- hl2.Adornee = plr.Character
- hl2.Parent = CoreGui
- hl2.Enabled = false
- plr.CharacterAdded:Connect(function(c2)
- task.wait(0.5)
- hl2.Adornee = c2
- end)
- local moveKeys = {W = false, A = false, S = false, D = false}
- UserInputService.InputBegan:Connect(function(i, gp)
- if gp then return end
- if moveKeys[i.KeyCode.Name] ~= nil then
- moveKeys[i.KeyCode.Name] = true
- end
- end)
- UserInputService.InputEnded:Connect(function(i, gp)
- if gp then return end
- if moveKeys[i.KeyCode.Name] ~= nil then
- moveKeys[i.KeyCode.Name] = false
- end
- end)
- local function shouldPush()
- local count = 0
- for _, v in pairs(moveKeys) do
- if v then count += 1 end
- end
- return count == 1 and (moveKeys.A or moveKeys.D)
- end
- local rimsForPush = {}
- for _, v in ipairs(Workspace:GetDescendants()) do
- if v:IsA("BasePart") and v.Name == "Lol" and v.Parent and v.Parent.Name == "Rim" then
- table.insert(rimsForPush, v)
- end
- end
- local function nearestRim(rootPos)
- local nearest, nearestDist
- for _, rim in ipairs(rimsForPush) 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
- local smoothBias = Vector3.zero
- RunService.RenderStepped:Connect(function()
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then
- hl2.Enabled = false
- return
- end
- local c = plr.Character
- local hum = c and c:FindFirstChildOfClass("Humanoid")
- local root = c and c:FindFirstChild("HumanoidRootPart")
- if not (hum and root) then return end
- if not hasBall() then
- hl2.Enabled = false
- return
- end
- local rim, dist = nearestRim(root.Position)
- if not rim or dist > ACTIVE_RANGE_MAIN then
- hl2.Enabled = false
- smoothBias = Vector3.zero
- return
- end
- local target = getNearestPerfectDistance(dist)
- local diff = dist - target
- local absDiff = math.abs(diff)
- local desired = Vector3.zero
- if shouldPush() and absDiff < CLAMP_RADIUS then
- local strength = (CLAMP_RADIUS - absDiff) / CLAMP_RADIUS
- 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
- hl2.Enabled = true
- if absDiff <= 0.10 then
- hl2.FillColor = COLOR_GREEN
- hl2.OutlineColor = COLOR_GREEN
- elseif absDiff < CLAMP_RADIUS then
- hl2.FillColor = COLOR_GREEN_SOFT
- hl2.OutlineColor = COLOR_GREEN_SOFT
- else
- hl2.Enabled = false
- end
- else
- hl2.Enabled = false
- end
- end)
- end)
Add Comment
Please, Sign In to add comment