ColdSpecs

Streefball Last piece (I promise)

Nov 18th, 2025
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.39 KB | None | 0 0
  1. ---------------------------------------------------------------------
  2. -- BLOCK 1: AUTO-JUMP + AUTO-SHOOT + POWER-BASED RIM SYSTEM (A.txt)
  3. -- - Captures shootKey ONCE
  4. -- - Exports it globally: getgenv().PAYLOAD0_SHOOTKEY
  5. -- - Handles auto-jump, predictive auto-shoot, rim lock, etc.
  6. ---------------------------------------------------------------------
  7. task.spawn(function()
  8.  
  9. local Players = game:GetService("Players")
  10. local UserInputService = game:GetService("UserInputService")
  11. local RunService = game:GetService("RunService")
  12. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  13. local CoreGui = game:GetService("CoreGui")
  14. local TweenService = game:GetService("TweenService")
  15. local Workspace = game:GetService("Workspace")
  16. local Camera = Workspace.CurrentCamera
  17.  
  18. -- ====================== LOCALS ========================
  19. local plr = Players.LocalPlayer
  20. local char = plr.Character or plr.CharacterAdded:Wait()
  21. local remotes = ReplicatedStorage:WaitForChild("Remotes")
  22. local shootRemote = remotes:WaitForChild("Shoot")
  23.  
  24. -- ====================== STATE =========================
  25. getgenv().AUTO_JUMP_ACTIVE = false
  26. local SystemActive = false
  27. local VisualsEnabled = true
  28. local shootKey = nil
  29. local selectedRim = nil
  30. local manualRim = nil
  31. local activeNotifyGui = nil
  32. local fKeyDown = false
  33.  
  34. local CLAMP_RADIUS = 1
  35. local ACTIVE_RANGE_MAIN = 90
  36. local COLOR_GREEN = Color3.fromRGB(0, 255, 100)
  37. local COLOR_GREEN_SOFT = Color3.fromRGB(0, 200, 80)
  38.  
  39. local PERFECT_TOL = 0.12
  40. local PREDICTIVE_BIAS = 2.0
  41. local MIN_JUMP_VELOCITY = 2.2
  42. local SINGLE_SHOT_PER_JUMP = true
  43.  
  44. local AUTOJUMP_PREWINDOW = 4.0
  45. local AUTOJUMP_COOLDOWN = 0.20
  46.  
  47. local RimSize = Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
  48.  
  49. local currentPower = 0
  50.  
  51. -- POWER LISTENER
  52. local function attachPowerListener(character)
  53. if not character then return end
  54.  
  55. task.spawn(function()
  56. local ev = character:FindFirstChild("E_V") or character:WaitForChild("E_V", 10)
  57. if not ev then return end
  58.  
  59. local power = ev:FindFirstChild("Power") or ev:WaitForChild("Power", 10)
  60. if not power then return end
  61.  
  62. currentPower = power.Value
  63. power:GetPropertyChangedSignal("Value"):Connect(function()
  64. currentPower = power.Value
  65. end)
  66. end)
  67. end
  68.  
  69. attachPowerListener(char)
  70. plr.CharacterAdded:Connect(function(c2)
  71. char = c2
  72. attachPowerListener(c2)
  73. end)
  74.  
  75. local POWER_TO_DISTANCE = {
  76. [75] = 55.68,
  77. [80] = 62.25,
  78. [85] = 68.80,
  79. }
  80.  
  81. local function getTargetDistance()
  82. return POWER_TO_DISTANCE[currentPower]
  83. end
  84.  
  85. -- ====================== HELPERS =======================
  86. local function hasBall()
  87. local c = plr.Character
  88. if not c then return false end
  89.  
  90. for _, tool in ipairs(c:GetChildren()) do
  91. if tool:IsA("Tool") and tool.Name:lower():find("ball") then
  92. return true
  93. end
  94. end
  95. return false
  96. end
  97.  
  98. -- ================== RIM LOCK TOAST ====================
  99. local rimLockToast = nil
  100.  
  101. local function showRimLockToast(text)
  102. if rimLockToast then
  103. rimLockToast:Destroy()
  104. rimLockToast = nil
  105. end
  106.  
  107. local gui = Instance.new("ScreenGui")
  108. gui.Name = "RimLockToast"
  109. gui.ResetOnSpawn = false
  110. gui.Parent = CoreGui
  111. rimLockToast = gui
  112.  
  113. local label = Instance.new("TextLabel")
  114. label.AnchorPoint = Vector2.new(0.5, 0.5)
  115. label.Position = UDim2.new(0.5, 0, 0.82, 0)
  116. label.Size = UDim2.new(0, 280, 0, 32)
  117. label.BackgroundTransparency = 1
  118. label.Font = Enum.Font.GothamBold
  119. label.TextSize = 22
  120. label.TextColor3 = Color3.fromRGB(120, 255, 150)
  121. label.Text = text
  122. label.Parent = gui
  123.  
  124. task.delay(1.0, function()
  125. if rimLockToast == gui then
  126. gui:Destroy()
  127. rimLockToast = nil
  128. end
  129. end)
  130. end
  131.  
  132. -- ================== NORMAL TOAST ======================
  133. local function notify(msg, color)
  134. if activeNotifyGui and activeNotifyGui.Parent then
  135. activeNotifyGui:Destroy()
  136. end
  137.  
  138. local gui = Instance.new("ScreenGui")
  139. gui.ResetOnSpawn = false
  140. gui.Name = "PAYLOAD0_Toast"
  141. gui.Parent = CoreGui
  142. activeNotifyGui = gui
  143.  
  144. local label = Instance.new("TextLabel")
  145. label.AnchorPoint = Vector2.new(0.5, 0.5)
  146. label.Position = UDim2.new(0.5, 0, 0.9, 0)
  147. label.Size = UDim2.new(0, 560, 0, 38)
  148. label.BackgroundTransparency = 1
  149. label.Font = Enum.Font.Code
  150. label.TextSize = 26
  151. label.TextColor3 = color or Color3.fromRGB(255, 255, 255)
  152. label.Text = msg
  153. label.Parent = gui
  154.  
  155. task.delay(1.0, function()
  156. if gui == activeNotifyGui then
  157. gui:Destroy()
  158. activeNotifyGui = nil
  159. end
  160. end)
  161. end
  162.  
  163. -- ================== CALIBRATE UI ======================
  164. local calibrateGui
  165.  
  166. local function showCalibrateUI()
  167. if calibrateGui or shootKey or not hasBall() then return end
  168.  
  169. calibrateGui = Instance.new("ScreenGui")
  170. calibrateGui.Name = "CalibrateReminder"
  171. calibrateGui.ResetOnSpawn = false
  172. calibrateGui.IgnoreGuiInset = true
  173. calibrateGui.Parent = CoreGui
  174.  
  175. local frame = Instance.new("Frame")
  176. frame.AnchorPoint = Vector2.new(0.5, 0.5)
  177. frame.Position = UDim2.new(0.5, 0, 0.85, 0)
  178. frame.Size = UDim2.new(0, 420, 0, 45)
  179. frame.BackgroundTransparency = 0.25
  180. frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  181. frame.BorderSizePixel = 0
  182. frame.Parent = calibrateGui
  183.  
  184. local stroke = Instance.new("UIStroke")
  185. stroke.Color = Color3.fromRGB(80, 255, 120)
  186. stroke.Thickness = 1.6
  187. stroke.Parent = frame
  188.  
  189. local corner = Instance.new("UICorner")
  190. corner.CornerRadius = UDim.new(0, 10)
  191. corner.Parent = frame
  192.  
  193. local label = Instance.new("TextLabel")
  194. label.BackgroundTransparency = 1
  195. label.Size = UDim2.fromScale(1, 1)
  196. label.Font = Enum.Font.GothamMedium
  197. label.TextSize = 22
  198. label.TextColor3 = Color3.fromRGB(120, 255, 150)
  199. label.Text = "Click once to calibrate your shot (key capture)."
  200. label.Parent = frame
  201.  
  202. task.spawn(function()
  203. while calibrateGui and not shootKey and hasBall() do
  204. TweenService:Create(
  205. label,
  206. TweenInfo.new(0.6),
  207. { TextTransparency = 0.25 }
  208. ):Play()
  209. task.wait(0.6)
  210. TweenService:Create(
  211. label,
  212. TweenInfo.new(0.6),
  213. { TextTransparency = 0 }
  214. ):Play()
  215. task.wait(0.6)
  216. end
  217. end)
  218. end
  219.  
  220. local function removeCalibrateUI()
  221. if calibrateGui then
  222. calibrateGui:Destroy()
  223. calibrateGui = nil
  224. end
  225. end
  226.  
  227. task.spawn(function()
  228. while task.wait(0.4) do
  229. if not hasBall() or shootKey then
  230. removeCalibrateUI()
  231. else
  232. showCalibrateUI()
  233. end
  234. end
  235. end)
  236.  
  237. -- ================== SHOOT KEY CAPTURE =================
  238. local oldNamecall
  239. oldNamecall = hookmetamethod(game, "__namecall", function(self, ...)
  240. local m = getnamecallmethod()
  241. if m == "FireServer" and self == shootRemote then
  242. local args = { ... }
  243. if type(args[3]) == "string" and not shootKey then
  244. shootKey = args[3]
  245. getgenv().PAYLOAD0_SHOOTKEY = shootKey -- <<< GLOBAL EXPORT
  246. removeCalibrateUI()
  247. notify("Shoot key captured!", COLOR_GREEN)
  248. end
  249. end
  250. return oldNamecall(self, ...)
  251. end)
  252.  
  253. -- ====================== RIM TRACKING ==================
  254. local Rims = {}
  255.  
  256. Workspace.DescendantAdded:Connect(function(o)
  257. if o:IsA("BasePart") and o.Name == "Rim" and o.Size == RimSize then
  258. table.insert(Rims, o)
  259. end
  260. end)
  261.  
  262. for _, v in ipairs(Workspace:GetDescendants()) do
  263. if v:IsA("BasePart") and v.Name == "Rim" and v.Size == RimSize then
  264. table.insert(Rims, v)
  265. end
  266. end
  267.  
  268. Workspace.DescendantRemoving:Connect(function(o)
  269. for i, rim in ipairs(Rims) do
  270. if rim == o then
  271. table.remove(Rims, i)
  272. break
  273. end
  274. end
  275.  
  276. if selectedRim == o then
  277. selectedRim = nil
  278. end
  279.  
  280. if manualRim == o then
  281. manualRim = nil
  282. end
  283. end)
  284.  
  285. local function getLolChild(rim)
  286. if not rim or not rim:IsDescendantOf(Workspace) then return nil end
  287.  
  288. for _, child in ipairs(rim:GetChildren()) do
  289. if child:IsA("BasePart") and child.Name == "Lol" then
  290. return child
  291. end
  292. end
  293.  
  294. local parent = rim.Parent
  295. if parent then
  296. local c = parent:FindFirstChild("Lol")
  297. if c and c:IsA("BasePart") then
  298. return c
  299. end
  300. end
  301. return nil
  302. end
  303.  
  304. -- ========== RIM LOCK VISUALS ==========
  305. local function clearRimLockVisual(rim)
  306. if rim and rim:FindFirstChild("RimLockBillboard") then
  307. rim.RimLockBillboard:Destroy()
  308. end
  309. if rim and rim:FindFirstChild("RimSelectionBox") then
  310. rim.RimSelectionBox:Destroy()
  311. end
  312. end
  313.  
  314. local function makeLockVisual(target)
  315. local bb = Instance.new("BillboardGui")
  316. bb.Name = "RimLockBillboard"
  317. bb.Size = UDim2.fromOffset(100, 24)
  318. bb.AlwaysOnTop = true
  319. bb.LightInfluence = 0
  320. bb.StudsOffsetWorldSpace = Vector3.new(0, 1.5, 0)
  321. bb.Parent = target
  322.  
  323. local tl = Instance.new("TextLabel")
  324. tl.BackgroundTransparency = 1
  325. tl.Size = UDim2.fromScale(1, 1)
  326. tl.Font = Enum.Font.GothamBold
  327. tl.TextSize = 16
  328. tl.TextColor3 = Color3.fromRGB(120, 255, 150)
  329. tl.TextTransparency = 0
  330. tl.Text = "LOCKED"
  331. tl.Parent = bb
  332.  
  333. bb.Size = UDim2.fromOffset(85, 20)
  334.  
  335. local sb = Instance.new("SelectionBox")
  336. sb.Name = "RimSelectionBox"
  337. sb.Adornee = target
  338. sb.Color3 = Color3.fromRGB(120, 255, 150)
  339. sb.LineThickness = 0.02
  340. sb.SurfaceTransparency = 1
  341. sb.Parent = target
  342.  
  343. task.delay(1.0, function()
  344. if not bb.Parent then return end
  345.  
  346. local fadeTI = TweenInfo.new(0.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  347. local moveTI = TweenInfo.new(0.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
  348. local pulseTI = TweenInfo.new(0.15, Enum.EasingStyle.Back, Enum.EasingDirection.Out)
  349.  
  350. TweenService:Create(bb, pulseTI, {
  351. Size = UDim2.fromOffset(110, 28)
  352. }):Play()
  353.  
  354. task.wait(0.15)
  355.  
  356. TweenService:Create(
  357. bb,
  358. moveTI,
  359. { StudsOffsetWorldSpace = Vector3.new(0, 2.2, 0) }
  360. ):Play()
  361.  
  362. TweenService:Create(tl, fadeTI, { TextTransparency = 1 }):Play()
  363. TweenService:Create(sb, fadeTI, { LineThickness = 0 }):Play()
  364.  
  365. task.delay(0.35, function()
  366. if bb.Parent == target then bb:Destroy() end
  367. if sb.Parent == target then sb:Destroy() end
  368. end)
  369. end)
  370. end
  371.  
  372. local function setManualRim(rim)
  373. if manualRim == rim then return end
  374.  
  375. if manualRim then
  376. clearRimLockVisual(manualRim)
  377. end
  378.  
  379. manualRim = rim
  380.  
  381. if manualRim and manualRim:IsDescendantOf(Workspace) then
  382. makeLockVisual(manualRim)
  383. showRimLockToast("LOCKED RIM")
  384. else
  385. notify("Auto rim mode", Color3.fromRGB(180, 180, 180))
  386. end
  387. end
  388.  
  389. -- ====================== INPUT HANDLING =================
  390. UserInputService.InputBegan:Connect(function(input, gp)
  391. if gp then return end
  392.  
  393. if input.KeyCode == Enum.KeyCode.F then
  394. if not fKeyDown then
  395. fKeyDown = true
  396. SystemActive = true
  397. getgenv().AUTO_JUMP_ACTIVE = true
  398. notify("✅ System ON (Hold F)", COLOR_GREEN)
  399. end
  400.  
  401. elseif input.KeyCode == Enum.KeyCode.Y then
  402. local mousePos = UserInputService:GetMouseLocation()
  403. local bestRim, bestPixels = nil, 96
  404.  
  405. for _, rim in ipairs(Rims) do
  406. if rim:IsDescendantOf(Workspace) then
  407. local v3, onScreen = Camera:WorldToViewportPoint(rim.Position)
  408. if onScreen then
  409. local dx = v3.X - mousePos.X
  410. local dy = v3.Y - mousePos.Y
  411. local d = math.sqrt(dx * dx + dy * dy)
  412. if d < bestPixels then
  413. bestRim, bestPixels = rim, d
  414. end
  415. end
  416. end
  417. end
  418.  
  419. if bestRim then
  420. if manualRim == bestRim then
  421. setManualRim(nil)
  422. else
  423. setManualRim(bestRim)
  424. end
  425. else
  426. notify("No hoop near cursor", Color3.fromRGB(255, 120, 120))
  427. end
  428.  
  429. elseif input.KeyCode == Enum.KeyCode.O then
  430. VisualsEnabled = not VisualsEnabled
  431. notify(
  432. VisualsEnabled and "👁 Visuals ON" or "🙈 Visuals OFF",
  433. VisualsEnabled and COLOR_GREEN or Color3.fromRGB(255, 80, 80)
  434. )
  435. end
  436. end)
  437.  
  438. UserInputService.InputEnded:Connect(function(input, gp)
  439. if gp then return end
  440.  
  441. if input.KeyCode == Enum.KeyCode.F and fKeyDown then
  442. fKeyDown = false
  443. SystemActive = false
  444. getgenv().AUTO_JUMP_ACTIVE = false
  445. notify("🚫 System OFF (F released)", Color3.fromRGB(255, 80, 80))
  446. end
  447. end)
  448.  
  449. -- ====================== AUTO RIM SELECT =================
  450. task.spawn(function()
  451. while task.wait(0.085) do
  452. if manualRim or not SystemActive then
  453. continue
  454. end
  455.  
  456. local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
  457. if not root then continue end
  458.  
  459. local best, bestDist = nil, 85
  460. for _, rim in ipairs(Rims) do
  461. if rim:IsDescendantOf(Workspace) then
  462. local dist = (rim.Position - root.Position).Magnitude
  463. if dist < bestDist then
  464. local _, on = Camera:WorldToViewportPoint(rim.Position)
  465. if on then
  466. best, bestDist = rim, dist
  467. end
  468. end
  469. end
  470. end
  471.  
  472. if best and best ~= selectedRim then
  473. selectedRim = best
  474. end
  475. end
  476. end)
  477.  
  478. local function currentTargetRim()
  479. return manualRim or selectedRim
  480. end
  481.  
  482. -- ====================== AIM MODEL ======================
  483. local lastTick = 0
  484. local moveOffset = Vector3.zero
  485.  
  486. local function computeOffset()
  487. if tick() - lastTick > 0.09 then
  488. local hum = plr.Character and plr.Character:FindFirstChildOfClass("Humanoid")
  489. local moveDir = (hum and hum.MoveDirection) or Vector3.zero
  490. moveOffset = Vector3.new(moveDir.X * 1.5, 0, moveDir.Z * 1.5)
  491. lastTick = tick()
  492. end
  493. return moveOffset
  494. end
  495.  
  496. local function computeArc(dist)
  497. return Vector3.new(0, 43 + (dist / 15), 0)
  498. end
  499.  
  500. local function planarDistance(a, b)
  501. local dx = a.X - b.X
  502. local dz = a.Z - b.Z
  503. return math.sqrt(dx * dx + dz * dz)
  504. end
  505.  
  506. local function smartAim(rim)
  507. local offset = computeOffset()
  508. local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
  509. if not root then return rim.Position end
  510.  
  511. local dist = (root.Position - rim.Position).Magnitude
  512. return rim.Position + computeArc(dist) - offset
  513. end
  514.  
  515. local function shootAtTarget()
  516. if not (SystemActive and shootKey and hasBall()) then return end
  517.  
  518. local rim = currentTargetRim()
  519. if not (rim and rim:IsDescendantOf(Workspace)) then return end
  520.  
  521. local c = plr.Character
  522. if not c then return end
  523.  
  524. local head = c:FindFirstChild("Head")
  525. local root = c.PrimaryPart
  526. if not (head and root) then return end
  527.  
  528. local aimPos = smartAim(rim)
  529. local dir = (aimPos - head.Position).Unit
  530. local shootFrom = root.Position + dir * 4
  531.  
  532. shootRemote:FireServer(aimPos, shootFrom, shootKey)
  533. end
  534.  
  535. -- ====================== VISUAL HIGHLIGHT =================
  536. local hl = CoreGui:FindFirstChild("PerfectRangeGlow") or Instance.new("Highlight")
  537. hl.Name = "PerfectRangeGlow"
  538. hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  539. hl.FillTransparency = 0.25
  540. hl.OutlineTransparency = 0
  541. hl.Adornee = plr.Character
  542. hl.Parent = CoreGui
  543. hl.Enabled = false
  544.  
  545. plr.CharacterAdded:Connect(function(c2)
  546. task.wait(0.5)
  547. hl.Adornee = c2
  548. end)
  549.  
  550. -- ====================== PER-JUMP STATE ====================
  551. local perJumpShotDone = false
  552. local lastJumpAssistAt = 0
  553. local wasOutside = true
  554.  
  555. local function resetJumpFlags()
  556. perJumpShotDone = false
  557. end
  558.  
  559. plr.CharacterAdded:Connect(function()
  560. task.wait(0.5)
  561. resetJumpFlags()
  562. end)
  563.  
  564. local function isAirborne(hum)
  565. if not hum then return false end
  566. local st = hum:GetState()
  567. return not (
  568. st == Enum.HumanoidStateType.Running
  569. or st == Enum.HumanoidStateType.RunningNoPhysics
  570. or st == Enum.HumanoidStateType.Landed
  571. or st == Enum.HumanoidStateType.Seated
  572. )
  573. end
  574.  
  575. -- ====================== CORE LOOP =========================
  576. RunService.RenderStepped:Connect(function(dt)
  577. if not SystemActive then
  578. hl.Enabled = false
  579. return
  580. end
  581.  
  582. local c = plr.Character
  583. local hum = c and c:FindFirstChildOfClass("Humanoid")
  584. local root = c and (c:FindFirstChild("HumanoidRootPart") or c:FindFirstChildWhichIsA("BasePart"))
  585. if not (hum and root) then
  586. hl.Enabled = false
  587. return
  588. end
  589.  
  590. local rim = currentTargetRim()
  591. if not rim or not rim:IsDescendantOf(Workspace) then
  592. hl.Enabled = false
  593. return
  594. end
  595.  
  596. local lol = getLolChild(rim)
  597. local refPos = (lol and lol.Position) or rim.Position
  598.  
  599. local dist = planarDistance(root.Position, refPos)
  600. if dist > ACTIVE_RANGE_MAIN then
  601. hl.Enabled = false
  602. return
  603. end
  604.  
  605. local target = getTargetDistance()
  606. if not target then
  607. hl.Enabled = false
  608. return
  609. end
  610.  
  611. local diff = dist - target
  612. local absDiff = math.abs(diff)
  613.  
  614. -- Visuals
  615. if VisualsEnabled then
  616. if absDiff <= PERFECT_TOL then
  617. hl.Enabled = true
  618. hl.FillColor = COLOR_GREEN
  619. hl.OutlineColor = COLOR_GREEN
  620. elseif absDiff < CLAMP_RADIUS then
  621. hl.Enabled = true
  622. hl.FillColor = COLOR_GREEN_SOFT
  623. hl.OutlineColor = COLOR_GREEN_SOFT
  624. else
  625. hl.Enabled = false
  626. end
  627. else
  628. hl.Enabled = false
  629. end
  630.  
  631. local vel = root.AssemblyLinearVelocity or root.Velocity
  632. local yVel = vel.Y
  633. local airborne = (yVel > MIN_JUMP_VELOCITY) or isAirborne(hum)
  634.  
  635. -- AUTO-JUMP
  636. if hasBall() and getgenv().AUTO_JUMP_ACTIVE and not airborne then
  637. local enteringFromFront = (diff > 0) and (diff <= AUTOJUMP_PREWINDOW) and wasOutside
  638.  
  639. if enteringFromFront and (time() - lastJumpAssistAt > AUTOJUMP_COOLDOWN) then
  640. hum:ChangeState(Enum.HumanoidStateType.Jumping)
  641. lastJumpAssistAt = time()
  642. wasOutside = false
  643. elseif diff > AUTOJUMP_PREWINDOW then
  644. wasOutside = true
  645. elseif diff < 0 then
  646. wasOutside = false
  647. end
  648. else
  649. wasOutside = (diff > AUTOJUMP_PREWINDOW)
  650. end
  651.  
  652. -- AUTO-SHOOT
  653. if hasBall() and airborne and shootKey and not (SINGLE_SHOT_PER_JUMP and perJumpShotDone) then
  654. local target2 = getTargetDistance()
  655. if not target2 then return end
  656.  
  657. local predictedPos = root.Position + vel * dt
  658. local pDist = planarDistance(predictedPos, refPos)
  659.  
  660. if math.abs(pDist - target2) <= (PERFECT_TOL * PREDICTIVE_BIAS) then
  661. shootAtTarget()
  662. perJumpShotDone = true
  663. return
  664. end
  665.  
  666. if absDiff <= PERFECT_TOL then
  667. shootAtTarget()
  668. perJumpShotDone = true
  669. return
  670. end
  671. end
  672. end)
  673.  
  674. -- ====================== RESET ON LAND =====================
  675. task.spawn(function()
  676. local lastState
  677. while task.wait(0.02) do
  678. local hum = plr.Character and plr.Character:FindFirstChildOfClass("Humanoid")
  679. if hum then
  680. local st = hum:GetState()
  681. if st ~= lastState then
  682. if st == Enum.HumanoidStateType.Landed
  683. or st == Enum.HumanoidStateType.Running
  684. or st == Enum.HumanoidStateType.Seated
  685. then
  686. resetJumpFlags()
  687. end
  688. lastState = st
  689. end
  690. end
  691. end
  692. end)
  693. end)
  694.  
  695. ---------------------------------------------------------------------
  696. -- BLOCK 2: MANUAL CLICK SHOOT + PUSH-ASSIST PERFECT RANGE SYSTEM
  697. -- - NEVER captures key
  698. -- - ONLY reads getgenv().PAYLOAD0_SHOOTKEY
  699. -- - Uses PERFECT_DISTANCES + push to clamp you into money range
  700. ---------------------------------------------------------------------
  701. task.spawn(function()
  702.  
  703. local Players = game:GetService("Players")
  704. local UserInputService = game:GetService("UserInputService")
  705. local RunService = game:GetService("RunService")
  706. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  707. local CoreGui = game:GetService("CoreGui")
  708. local Workspace = game:GetService("Workspace")
  709. local Camera = Workspace.CurrentCamera
  710.  
  711. local plr = Players.LocalPlayer
  712. local char = plr.Character or plr.CharacterAdded:Wait()
  713. local remotes = ReplicatedStorage:WaitForChild("Remotes")
  714. local shootRemote = remotes:WaitForChild("Shoot")
  715.  
  716. getgenv().PAYLOAD0_SYSTEM_ACTIVE = true
  717.  
  718. local VisualsEnabled = true
  719. local shootKey = nil -- only read from global
  720. local selectedRim = nil
  721. local activeNotifyGui
  722.  
  723. local PERFECT_DISTANCES = {54.97, 61.53, 68.10}
  724. local CLAMP_RADIUS = 1
  725. local ACTIVE_RANGE_MAIN = 90
  726. local MAX_PUSH = 0.06
  727. local DAMPING = 0.9
  728.  
  729. local COLOR_GREEN = Color3.fromRGB(0, 255, 100)
  730. local COLOR_GREEN_SOFT = Color3.fromRGB(0, 200, 80)
  731.  
  732. -- ball check
  733. local function hasBall()
  734. local c = plr.Character
  735. if not c then return false end
  736. for _, tool in ipairs(c:GetChildren()) do
  737. if tool:IsA("Tool") and tool.Name:lower():find("ball") then
  738. return true
  739. end
  740. end
  741. return false
  742. end
  743.  
  744. local function notify(msg, color)
  745. if activeNotifyGui and activeNotifyGui.Parent then
  746. activeNotifyGui:Destroy()
  747. end
  748. local gui = Instance.new("ScreenGui")
  749. gui.ResetOnSpawn = false
  750. gui.Parent = CoreGui
  751. activeNotifyGui = gui
  752.  
  753. local label = Instance.new("TextLabel")
  754. label.AnchorPoint = Vector2.new(0.5, 0.5)
  755. label.BackgroundTransparency = 1
  756. label.TextColor3 = color or Color3.fromRGB(255, 255, 255)
  757. label.Font = Enum.Font.Code
  758. label.TextSize = 26
  759. label.Text = msg
  760. label.Position = UDim2.new(0.5, 0, 0.9, 0)
  761. label.Parent = gui
  762.  
  763. task.spawn(function()
  764. task.wait(1.2)
  765. if gui == activeNotifyGui then
  766. gui:Destroy()
  767. activeNotifyGui = nil
  768. end
  769. end)
  770. end
  771.  
  772. -- SHOOT KEY LISTENER (no capture here)
  773. task.spawn(function()
  774. while task.wait(0.1) do
  775. local k = rawget(getgenv(), "PAYLOAD0_SHOOTKEY")
  776. if type(k) == "string" then
  777. shootKey = k
  778. notify("Shoot key linked (Manual)", COLOR_GREEN)
  779. break
  780. end
  781. end
  782. end)
  783.  
  784. -- RIM TRACKING (nearest visible rim)
  785. local RimSize = Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
  786. local Rims = {}
  787.  
  788. Workspace.DescendantAdded:Connect(function(o)
  789. if o:IsA("BasePart") and o.Name == "Rim" and o.Size == RimSize then
  790. table.insert(Rims, o)
  791. end
  792. end)
  793.  
  794. for _, v in ipairs(Workspace:GetDescendants()) do
  795. if v:IsA("BasePart") and v.Name == "Rim" and v.Size == RimSize then
  796. table.insert(Rims, v)
  797. end
  798. end
  799.  
  800. Workspace.DescendantRemoving:Connect(function(o)
  801. for i, rim in ipairs(Rims) do
  802. if rim == o then
  803. table.remove(Rims, i)
  804. break
  805. end
  806. end
  807. if selectedRim == o then
  808. selectedRim = nil
  809. end
  810. end)
  811.  
  812. -- auto select closest, camera-visible rim
  813. task.spawn(function()
  814. while task.wait(0.1) do
  815. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then
  816. continue
  817. end
  818. local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
  819. if not root then continue end
  820.  
  821. local bestRim, bestDist = nil, 85
  822. for _, rim in ipairs(Rims) do
  823. if rim:IsDescendantOf(Workspace) then
  824. local dist = (rim.Position - root.Position).Magnitude
  825. if dist < bestDist then
  826. local _, on = Camera:WorldToViewportPoint(rim.Position)
  827. if on then
  828. bestRim, bestDist = rim, dist
  829. end
  830. end
  831. end
  832. end
  833. if bestRim and bestRim ~= selectedRim then
  834. selectedRim = bestRim
  835. end
  836. end
  837. end)
  838.  
  839. -- toggles
  840. UserInputService.InputBegan:Connect(function(i, gp)
  841. if gp then return end
  842.  
  843. if i.KeyCode == Enum.KeyCode.O then
  844. VisualsEnabled = not VisualsEnabled
  845. notify(
  846. VisualsEnabled and "👁 Visuals ON" or "🙈 Visuals OFF",
  847. VisualsEnabled and COLOR_GREEN or Color3.fromRGB(255, 80, 80)
  848. )
  849. elseif i.KeyCode == Enum.KeyCode.V then
  850. getgenv().PAYLOAD0_SYSTEM_ACTIVE = not getgenv().PAYLOAD0_SYSTEM_ACTIVE
  851. notify(
  852. getgenv().PAYLOAD0_SYSTEM_ACTIVE and "✅ Manual System ON"
  853. or "🚫 Manual System OFF",
  854. getgenv().PAYLOAD0_SYSTEM_ACTIVE and COLOR_GREEN
  855. or Color3.fromRGB(255, 80, 80)
  856. )
  857. end
  858. end)
  859.  
  860. -- shooting helpers
  861. local lastTick, moveOffset = 0, Vector3.zero
  862. local function computeOffset()
  863. if tick() - lastTick > 0.1 then
  864. local hum = plr.Character and plr.Character:FindFirstChildOfClass("Humanoid")
  865. local moveDir = (hum and hum.MoveDirection) or Vector3.zero
  866. moveOffset = Vector3.new(moveDir.X * 1.5, 0, moveDir.Z * 1.5)
  867. lastTick = tick()
  868. end
  869. return moveOffset
  870. end
  871.  
  872. local function computeArc(dist)
  873. return Vector3.new(0, 43 + (dist / 15), 0)
  874. end
  875.  
  876. local function smartAim(rim)
  877. local offset = computeOffset()
  878. local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
  879. if not root then return rim.Position end
  880. local dist = (root.Position - rim.Position).Magnitude
  881. return rim.Position + computeArc(dist) - offset
  882. end
  883.  
  884. local function shootAtTarget()
  885. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
  886. if not (selectedRim and selectedRim:IsDescendantOf(Workspace)) then return end
  887. if not shootKey then return end
  888. local c = plr.Character
  889. if not c then return end
  890. local head = c:FindFirstChild("Head")
  891. local root = c.PrimaryPart
  892. if not (head and root) then return end
  893.  
  894. local aimPos = smartAim(selectedRim)
  895. local dir = (aimPos - head.Position).Unit
  896. local shootFrom = root.Position + dir * 3.8
  897. if shootFrom.Y - root.Position.Y < 4 then
  898. shootFrom = root.Position + dir * 4
  899. end
  900. shootRemote:FireServer(aimPos, shootFrom, shootKey)
  901. end
  902.  
  903. -- click to shoot (manual)
  904. UserInputService.InputBegan:Connect(function(i, gp)
  905. if gp or not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
  906. if i.UserInputType == Enum.UserInputType.MouseButton1 and hasBall() then
  907. if shootKey then
  908. shootAtTarget()
  909. end
  910. end
  911. end)
  912.  
  913. -- highlight + push logic
  914. local hl2 = CoreGui:FindFirstChild("PerfectRangeGlow_Manual") or Instance.new("Highlight")
  915. hl2.Name = "PerfectRangeGlow_Manual"
  916. hl2.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  917. hl2.FillTransparency = 0.25
  918. hl2.OutlineTransparency = 0
  919. hl2.Adornee = plr.Character
  920. hl2.Parent = CoreGui
  921. hl2.Enabled = false
  922.  
  923. plr.CharacterAdded:Connect(function(c2)
  924. task.wait(0.5)
  925. hl2.Adornee = c2
  926. end)
  927.  
  928. local moveKeys = {W = false, A = false, S = false, D = false}
  929. UserInputService.InputBegan:Connect(function(i, gp)
  930. if gp then return end
  931. if moveKeys[i.KeyCode.Name] ~= nil then
  932. moveKeys[i.KeyCode.Name] = true
  933. end
  934. end)
  935. UserInputService.InputEnded:Connect(function(i, gp)
  936. if gp then return end
  937. if moveKeys[i.KeyCode.Name] ~= nil then
  938. moveKeys[i.KeyCode.Name] = false
  939. end
  940. end)
  941.  
  942. local function shouldPush()
  943. local count = 0
  944. for _, v in pairs(moveKeys) do
  945. if v then count += 1 end
  946. end
  947. return count == 1 and (moveKeys.A or moveKeys.D)
  948. end
  949.  
  950. local rimsForPush = {}
  951. for _, v in ipairs(Workspace:GetDescendants()) do
  952. if v:IsA("BasePart") and v.Name == "Lol" and v.Parent and v.Parent.Name == "Rim" then
  953. table.insert(rimsForPush, v)
  954. end
  955. end
  956.  
  957. local function nearestRim(rootPos)
  958. local nearest, nearestDist
  959. for _, rim in ipairs(rimsForPush) do
  960. if rim:IsDescendantOf(Workspace) then
  961. local rimXZ = Vector3.new(rim.Position.X, 0, rim.Position.Z)
  962. local dist = (rimXZ - Vector3.new(rootPos.X, 0, rootPos.Z)).Magnitude
  963. if not nearestDist or dist < nearestDist then
  964. nearest, nearestDist = rim, dist
  965. end
  966. end
  967. end
  968. return nearest, nearestDist
  969. end
  970.  
  971. local function getNearestPerfectDistance(current)
  972. local nearest, smallestDiff
  973. for _, pd in ipairs(PERFECT_DISTANCES) do
  974. local diff = math.abs(pd - current)
  975. if not smallestDiff or diff < smallestDiff then
  976. nearest, smallestDiff = pd, diff
  977. end
  978. end
  979. return nearest
  980. end
  981.  
  982. local smoothBias = Vector3.zero
  983. RunService.RenderStepped:Connect(function()
  984. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then
  985. hl2.Enabled = false
  986. return
  987. end
  988.  
  989. local c = plr.Character
  990. local hum = c and c:FindFirstChildOfClass("Humanoid")
  991. local root = c and c:FindFirstChild("HumanoidRootPart")
  992. if not (hum and root) then return end
  993.  
  994. if not hasBall() then
  995. hl2.Enabled = false
  996. return
  997. end
  998.  
  999. local rim, dist = nearestRim(root.Position)
  1000. if not rim or dist > ACTIVE_RANGE_MAIN then
  1001. hl2.Enabled = false
  1002. smoothBias = Vector3.zero
  1003. return
  1004. end
  1005.  
  1006. local target = getNearestPerfectDistance(dist)
  1007. local diff = dist - target
  1008. local absDiff = math.abs(diff)
  1009. local desired = Vector3.zero
  1010.  
  1011. if shouldPush() and absDiff < CLAMP_RADIUS then
  1012. local strength = (CLAMP_RADIUS - absDiff) / CLAMP_RADIUS
  1013. local toRim = Vector3.new(rim.Position.X, 0, rim.Position.Z)
  1014. - Vector3.new(root.Position.X, 0, root.Position.Z)
  1015. local distSign = math.sign(diff)
  1016. if distSign > 0 then
  1017. local pushDir = -toRim.Unit
  1018. desired = pushDir * math.min(strength * MAX_PUSH, MAX_PUSH)
  1019. end
  1020. end
  1021.  
  1022. smoothBias = smoothBias * DAMPING + desired * (1 - DAMPING)
  1023. root.CFrame += Vector3.new(smoothBias.X, 0, smoothBias.Z)
  1024.  
  1025. if VisualsEnabled then
  1026. hl2.Enabled = true
  1027. if absDiff <= 0.10 then
  1028. hl2.FillColor = COLOR_GREEN
  1029. hl2.OutlineColor = COLOR_GREEN
  1030. elseif absDiff < CLAMP_RADIUS then
  1031. hl2.FillColor = COLOR_GREEN_SOFT
  1032. hl2.OutlineColor = COLOR_GREEN_SOFT
  1033. else
  1034. hl2.Enabled = false
  1035. end
  1036. else
  1037. hl2.Enabled = false
  1038. end
  1039. end)
  1040. end)
  1041.  
Add Comment
Please, Sign In to add comment