Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// ======================================================================
- --// PAYLOAD0 • AUTO-AIM + ALIGN-ASSIST SYSTEM [UPDATED REMOTE VERSION]
- --// • Auto-locks nearest visible rim
- --// • Smart aim + push assist
- --// • Uses workspace.Basketball.shoot_event (new structure)
- --// • Captures shootKey automatically when detected
- --// • Works only when holding a ball
- --// ======================================================================
- -- === 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()
- -- === REMOTE ===
- local Basketball = Workspace:WaitForChild('Basketball')
- local shootRemote = Basketball:WaitForChild('shoot_event')
- -- === STATE ===
- getgenv().PAYLOAD0_SYSTEM_ACTIVE = true
- local VisualsEnabled = true
- local shootKey: string? = nil
- local selectedRim: BasePart? = nil
- local activeNotifyGui
- -- === CONFIGURATION ===
- 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)
- -- === HELPER: BALL CHECK ===
- local function hasBall()
- local char = plr.Character
- if not char then
- return false
- end
- for _, tool in ipairs(char:GetChildren()) do
- if tool:IsA('Tool') and tool.Name:lower():find('ball') then
- return true
- end
- end
- return false
- end
- -- === NOTIFY SYSTEM ===
- local function notify(msg, color)
- if activeNotifyGui and activeNotifyGui.Parent then
- activeNotifyGui:Destroy()
- end
- local gui = Instance.new('ScreenGui', CoreGui)
- gui.ResetOnSpawn = false
- activeNotifyGui = gui
- local label = Instance.new('TextLabel', gui)
- 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)
- task.spawn(function()
- task.wait(1.2)
- 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', CoreGui)
- calibrateGui.Name = 'CalibrateReminder'
- calibrateGui.ResetOnSpawn = false
- calibrateGui.IgnoreGuiInset = true
- local frame = Instance.new('Frame', calibrateGui)
- 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
- local stroke = Instance.new('UIStroke', frame)
- stroke.Color = Color3.fromRGB(80, 255, 120)
- stroke.Thickness = 1.6
- local corner = Instance.new('UICorner', frame)
- corner.CornerRadius = UDim.new(0, 10)
- local label = Instance.new('TextLabel', frame)
- 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.'
- task.spawn(function()
- while calibrateGui and not shootKey and hasBall() do
- local t1 = TweenService:Create(
- label,
- TweenInfo.new(0.8),
- { TextTransparency = 0.3 }
- )
- local t2 = TweenService:Create(
- label,
- TweenInfo.new(0.8),
- { 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)
- -- === RIM TRACKING ===
- local RimSize =
- Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
- local Rims = {}
- local function registerRim(v)
- if v:IsA('BasePart') and v.Name == 'Rim' and v.Size == RimSize then
- table.insert(Rims, v)
- end
- end
- for _, v in ipairs(Workspace:GetDescendants()) do
- registerRim(v)
- end
- Workspace.DescendantAdded:Connect(registerRim)
- 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 RIM LOCK ===
- 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)
- )
- end
- if i.KeyCode == Enum.KeyCode.V then
- getgenv().PAYLOAD0_SYSTEM_ACTIVE = not getgenv().PAYLOAD0_SYSTEM_ACTIVE
- notify(
- getgenv().PAYLOAD0_SYSTEM_ACTIVE and '✅ System ON'
- or '🚫 System OFF',
- getgenv().PAYLOAD0_SYSTEM_ACTIVE and COLOR_GREEN
- or Color3.fromRGB(255, 80, 80)
- )
- end
- end)
- -- === SHOOT REMOTE CAPTURE ===
- local old
- old = 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 old(self, ...)
- end)
- -- === SMART AIM ===
- local function computeOffset()
- local hum = plr.Character
- and plr.Character:FindFirstChildOfClass('Humanoid')
- local moveDir = (hum and hum.MoveDirection) or Vector3.zero
- return Vector3.new(moveDir.X * 1.5, 0, moveDir.Z * 1.5)
- end
- local function computeArc(dist)
- return Vector3.new(0, 43 + (dist / 15), 0)
- end
- local function smartAim(rim)
- 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) - computeOffset()
- end
- -- === SHOOT FUNCTION (NEW STRUCTURE) ===
- local vector = getfenv().vector or {}
- vector.create = vector.create or Vector3.new
- local function shootAtTarget()
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then
- return
- end
- if not (selectedRim and selectedRim:IsDescendantOf(Workspace)) then
- return
- end
- if not hasBall() or not shootKey then
- return
- end
- local char = plr.Character
- local head, root =
- char and char:FindFirstChild('Head'),
- char and char:FindFirstChild('HumanoidRootPart')
- 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
- -- Construct args for the new shoot_event format
- local args = {
- vector.create(aimPos.X, aimPos.Y, aimPos.Z), -- aim position
- vector.create(shootFrom.X, shootFrom.Y, shootFrom.Z), -- from
- shootKey, -- shootKey emoji
- Instance.new('Tool', nil), -- dummy Tool
- 35, -- power
- {
- CFrame.new(root.CFrame:GetComponents()),
- CFrame.new(aimPos),
- 70,
- Vector2.new(1280, 737.5),
- },
- true,
- }
- shootRemote:FireServer(unpack(args))
- end
- -- === FIRE ON CLICK ===
- 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)
- -- === 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
- -- === LIVE UPDATE ===
- RunService.RenderStepped:Connect(function()
- if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then
- hl.Enabled = false
- return
- end
- if not hasBall() then
- hl.Enabled = false
- return
- end
- local char = plr.Character
- local root = char and char:FindFirstChild('HumanoidRootPart')
- if not root or not selectedRim then
- hl.Enabled = false
- return
- end
- local dist = (selectedRim.Position - root.Position).Magnitude
- local near = math.abs(dist - PERFECT_DISTANCES[1]) < 1
- if VisualsEnabled and near then
- hl.Enabled = true
- hl.FillColor, hl.OutlineColor = COLOR_GREEN, COLOR_GREEN
- else
- hl.Enabled = false
- end
- end)
- plr.CharacterAdded:Connect(function(c)
- task.wait(0.5)
- hl.Adornee = c
- end)
Advertisement
Add Comment
Please, Sign In to add comment