ColdSpecs

Completed Power Support ( Now needs push)

Nov 2nd, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.09 KB | None | 0 0
  1. --// ======================================================================
  2. --// PAYLOAD0 • AUTO-AIM + ALIGN-ASSIST SYSTEM [REALTIME POWER SYNC]
  3. --// • Auto-locks nearest visible rim
  4. --// • Auto-learns Shoot key and Power dynamically
  5. --// • Pushback assist active ONLY when player holds a ball
  6. --// • Bright green visuals show ONLY when ball is equipped
  7. --// • Calibration UI shows ONLY when holding a ball + key missing
  8. --// ======================================================================
  9.  
  10. -- === SERVICES ===
  11. local Players = game:GetService('Players')
  12. local UserInputService = game:GetService('UserInputService')
  13. local RunService = game:GetService('RunService')
  14. local ReplicatedStorage = game:GetService('ReplicatedStorage')
  15. local CoreGui = game:GetService('CoreGui')
  16. local TweenService = game:GetService('TweenService')
  17. local Workspace = game:GetService('Workspace')
  18. local Camera = workspace.CurrentCamera
  19.  
  20. local plr = Players.LocalPlayer
  21. local char = plr.Character or plr.CharacterAdded:Wait()
  22.  
  23. -- === STATE ===
  24. getgenv().PAYLOAD0_SYSTEM_ACTIVE = true
  25. local VisualsEnabled = true
  26. local shootKey : string? = nil
  27. local selectedRim : BasePart? = nil
  28. local activeNotifyGui
  29. local ballTool : Tool? = nil
  30.  
  31. -- === CONFIGURATION ===
  32. local PERFECT_DISTANCES = { 54.97, 61.53, 68.10 }
  33. local CLAMP_RADIUS = 1
  34. local ACTIVE_RANGE_MAIN = 90
  35. local MAX_PUSH = 0.06
  36. local DAMPING = 0.9
  37. local COLOR_GREEN = Color3.fromRGB(0, 255, 100)
  38. local COLOR_GREEN_SOFT = Color3.fromRGB(0, 200, 80)
  39.  
  40. -- === NOTIFY SYSTEM ===
  41. local function notify(msg, color)
  42. if activeNotifyGui and activeNotifyGui.Parent then
  43. activeNotifyGui:Destroy()
  44. end
  45. local gui = Instance.new('ScreenGui')
  46. gui.ResetOnSpawn = false
  47. gui.Parent = CoreGui
  48. activeNotifyGui = gui
  49.  
  50. local label = Instance.new('TextLabel')
  51. label.AnchorPoint = Vector2.new(0.5, 0.5)
  52. label.BackgroundTransparency = 1
  53. label.TextColor3 = color or Color3.fromRGB(255, 255, 255)
  54. label.Font = Enum.Font.Code
  55. label.TextSize = 26
  56. label.Text = msg
  57. label.Position = UDim2.new(0.5, 0, 0.9, 0)
  58. label.Parent = gui
  59.  
  60. task.spawn(function()
  61. task.wait(1.2)
  62. if gui == activeNotifyGui then
  63. gui:Destroy()
  64. activeNotifyGui = nil
  65. end
  66. end)
  67. end
  68.  
  69. -- === HELPER: BALL CHECK ===
  70. local function hasBall()
  71. local c = plr.Character
  72. if not c then return false end
  73. for _, tool in ipairs(c:GetChildren()) do
  74. if tool:IsA('Tool') and tool.Name:lower():find('ball') then
  75. ballTool = tool
  76. return true
  77. end
  78. end
  79. ballTool = nil
  80. return false
  81. end
  82.  
  83. -- === CALIBRATE UI ===
  84. local calibrateGui
  85. local function showCalibrateUI()
  86. if calibrateGui or shootKey or not hasBall() then return end
  87. calibrateGui = Instance.new('ScreenGui')
  88. calibrateGui.Name = 'CalibrateReminder'
  89. calibrateGui.ResetOnSpawn = false
  90. calibrateGui.IgnoreGuiInset = true
  91. calibrateGui.Parent = CoreGui
  92.  
  93. local frame = Instance.new('Frame')
  94. frame.AnchorPoint = Vector2.new(0.5, 0.5)
  95. frame.Position = UDim2.new(0.5, 0, 0.85, 0)
  96. frame.Size = UDim2.new(0, 420, 0, 45)
  97. frame.BackgroundTransparency = 0.3
  98. frame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
  99. frame.BorderSizePixel = 0
  100. frame.Parent = calibrateGui
  101.  
  102. local stroke = Instance.new('UIStroke')
  103. stroke.Color = Color3.fromRGB(80, 255, 120)
  104. stroke.Thickness = 1.6
  105. stroke.Parent = frame
  106.  
  107. local corner = Instance.new('UICorner')
  108. corner.CornerRadius = UDim.new(0, 10)
  109. corner.Parent = frame
  110.  
  111. local label = Instance.new('TextLabel')
  112. label.BackgroundTransparency = 1
  113. label.Size = UDim2.new(1, 0, 1, 0)
  114. label.Font = Enum.Font.GothamMedium
  115. label.TextSize = 22
  116. label.TextColor3 = Color3.fromRGB(120, 255, 150)
  117. label.Text = '🏀 Click once to calibrate your shot.'
  118. label.Parent = frame
  119.  
  120. task.spawn(function()
  121. while calibrateGui and not shootKey and hasBall() do
  122. local t1 = TweenService:Create(label, TweenInfo.new(0.8, Enum.EasingStyle.Sine), {TextTransparency = 0.3})
  123. local t2 = TweenService:Create(label, TweenInfo.new(0.8, Enum.EasingStyle.Sine), {TextTransparency = 0})
  124. t1:Play(); t1.Completed:Wait()
  125. t2:Play(); t2.Completed:Wait()
  126. end
  127. end)
  128. end
  129.  
  130. local function removeCalibrateUI()
  131. if calibrateGui then calibrateGui:Destroy(); calibrateGui = nil end
  132. end
  133.  
  134. task.spawn(function()
  135. while task.wait(0.5) do
  136. if not hasBall() or shootKey then removeCalibrateUI() else showCalibrateUI() end
  137. end
  138. end)
  139.  
  140. -- === AUTO POWER SYSTEM ===
  141. local CURRENT_POWER = 75
  142. local POWER_NAMES = { "Power", "ShootPower", "ShotPower", "Shot_Strength", "ShotPowerValue" }
  143.  
  144. local function setPower(p)
  145. if typeof(p) == "number" and p > 0 and p < 1000 then
  146. CURRENT_POWER = p
  147. end
  148. end
  149.  
  150. local function attachPowerWatchersToTool(tool)
  151. if not tool then return end
  152. for _, name in ipairs(POWER_NAMES) do
  153. if tool:GetAttribute(name) ~= nil then
  154. setPower(tool:GetAttribute(name))
  155. end
  156. tool:GetAttributeChangedSignal(name):Connect(function()
  157. setPower(tool:GetAttribute(name))
  158. end)
  159. end
  160. for _, obj in ipairs(tool:GetDescendants()) do
  161. if obj:IsA("NumberValue") and table.find(POWER_NAMES, obj.Name) then
  162. setPower(obj.Value)
  163. obj:GetPropertyChangedSignal("Value"):Connect(function()
  164. setPower(obj.Value)
  165. end)
  166. end
  167. end
  168. tool.DescendantAdded:Connect(function(obj)
  169. if obj:IsA("NumberValue") and table.find(POWER_NAMES, obj.Name) then
  170. setPower(obj.Value)
  171. obj:GetPropertyChangedSignal("Value"):Connect(function()
  172. setPower(obj.Value)
  173. end)
  174. end
  175. end)
  176. end
  177.  
  178. local _orig_hasBall = hasBall
  179. hasBall = function()
  180. local ok = _orig_hasBall()
  181. if ok and ballTool then
  182. attachPowerWatchersToTool(ballTool)
  183. end
  184. return ok
  185. end
  186.  
  187. -- === REMOTE DETECTION ===
  188. local shootRemote : RemoteEvent? = nil
  189. local hookedMeta = nil
  190. local SEARCH_PATTERN = 'shoot'
  191.  
  192. local function getRoots()
  193. local roots = {}
  194. local userFolder = Workspace:FindFirstChild(plr.Name)
  195. if userFolder and userFolder:FindFirstChild('Basketball') then
  196. table.insert(roots, userFolder.Basketball)
  197. end
  198. local iso = Workspace:FindFirstChild('isokcocs')
  199. if iso and iso:FindFirstChild('Basketball') then
  200. table.insert(roots, iso.Basketball)
  201. end
  202. local remotes = ReplicatedStorage:FindFirstChild('Remotes')
  203. if remotes then table.insert(roots, remotes) end
  204. return roots
  205. end
  206.  
  207. local function findShootRemote()
  208. for _, root in ipairs(getRoots()) do
  209. for _, obj in ipairs(root:GetDescendants()) do
  210. if obj:IsA('RemoteEvent') and obj.Name:lower():find(SEARCH_PATTERN) then
  211. return obj
  212. end
  213. end
  214. local direct = root:FindFirstChild('Shoot')
  215. if direct and direct:IsA('RemoteEvent') then
  216. return direct
  217. end
  218. end
  219. return nil
  220. end
  221.  
  222. local function hookRemote(remote)
  223. if hookedMeta then return end
  224. local old
  225. old = hookmetamethod(game, '__namecall', function(self, ...)
  226. local m = getnamecallmethod()
  227. if m == 'FireServer' and self == remote then
  228. local args = {...}
  229. if type(args[3]) == 'string' and not shootKey then
  230. shootKey = args[3]
  231. removeCalibrateUI()
  232. pcall(function() notify('Shoot key captured: '..shootKey, COLOR_GREEN) end)
  233. end
  234. if type(args[5]) == "number" then
  235. setPower(args[5])
  236. end
  237. end
  238. return old(self, ...)
  239. end)
  240. hookedMeta = old
  241. shootRemote = remote
  242. pcall(function() notify('Remote locked: '..remote:GetFullName(), COLOR_GREEN) end)
  243. end
  244.  
  245. local function unhookRemote()
  246. hookedMeta = nil
  247. shootRemote = nil
  248. end
  249.  
  250. RunService.Heartbeat:Connect(function()
  251. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
  252. local current = findShootRemote()
  253. if current then
  254. if current ~= shootRemote then
  255. unhookRemote()
  256. hookRemote(current)
  257. end
  258. elseif shootRemote then
  259. unhookRemote()
  260. end
  261. end)
  262.  
  263. -- === RIM TRACKING ===
  264. local RimSize = Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086)
  265. local Rims = {}
  266. Workspace.DescendantAdded:Connect(function(o)
  267. if o:IsA('BasePart') and o.Name == 'Rim' and o.Size == RimSize then
  268. table.insert(Rims, o)
  269. end
  270. end)
  271. for _, v in ipairs(Workspace:GetDescendants()) do
  272. if v:IsA('BasePart') and v.Name == 'Rim' and v.Size == RimSize then
  273. table.insert(Rims, v)
  274. end
  275. end
  276. Workspace.DescendantRemoving:Connect(function(o)
  277. for i, rim in ipairs(Rims) do
  278. if rim == o then table.remove(Rims, i); break end
  279. end
  280. if selectedRim == o then selectedRim = nil end
  281. end)
  282.  
  283. -- === AUTO RIM LOCK ===
  284. task.spawn(function()
  285. while task.wait(0.1) do
  286. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then continue end
  287. local root = plr.Character and plr.Character:FindFirstChild('HumanoidRootPart')
  288. if not root then continue end
  289. local bestRim, bestDist = nil, 85
  290. for _, rim in ipairs(Rims) do
  291. if rim:IsDescendantOf(Workspace) then
  292. local dist = (rim.Position - root.Position).Magnitude
  293. if dist < bestDist then
  294. local _, on = Camera:WorldToViewportPoint(rim.Position)
  295. if on then bestRim, bestDist = rim, dist end
  296. end
  297. end
  298. end
  299. if bestRim and bestRim ~= selectedRim then
  300. selectedRim = bestRim
  301. end
  302. end
  303. end)
  304.  
  305. -- === TOGGLES ===
  306. UserInputService.InputBegan:Connect(function(i, gp)
  307. if gp then return end
  308. if i.KeyCode == Enum.KeyCode.O then
  309. VisualsEnabled = not VisualsEnabled
  310. notify(VisualsEnabled and '👁 Visuals ON' or '🙈 Visuals OFF',
  311. VisualsEnabled and COLOR_GREEN or Color3.fromRGB(255,80,80))
  312. elseif i.KeyCode == Enum.KeyCode.V then
  313. getgenv().PAYLOAD0_SYSTEM_ACTIVE = not getgenv().PAYLOAD0_SYSTEM_ACTIVE
  314. notify(getgenv().PAYLOAD0_SYSTEM_ACTIVE and '✅ System ON' or '🚫 System OFF',
  315. getgenv().PAYLOAD0_SYSTEM_ACTIVE and COLOR_GREEN or Color3.fromRGB(255,80,80))
  316. end
  317. end)
  318.  
  319. -- === SHOOT LOGIC ===
  320. local lastTick, moveOffset = 0, Vector3.zero
  321. local function computeOffset()
  322. if tick() - lastTick > 0.1 then
  323. local hum = plr.Character and plr.Character:FindFirstChildOfClass('Humanoid')
  324. local moveDir = (hum and hum.MoveDirection) or Vector3.zero
  325. moveOffset = Vector3.new(moveDir.X * 1.5, 0, moveDir.Z * 1.5)
  326. lastTick = tick()
  327. end
  328. return moveOffset
  329. end
  330.  
  331. local function computeArc(dist) return Vector3.new(0, 43 + (dist / 15), 0) end
  332.  
  333. local function smartAim(rim)
  334. local offset = computeOffset()
  335. local root = plr.Character and plr.Character:FindFirstChild('HumanoidRootPart')
  336. if not root then return rim.Position end
  337. local dist = (root.Position - rim.Position).Magnitude
  338. return rim.Position + computeArc(dist) - offset
  339. end
  340.  
  341. local function fireShootRemote(aimPos, shootFrom)
  342. if not shootRemote then return end
  343. if shootRemote.Name:lower():find('shoot') and shootRemote.Parent and shootRemote.Parent:IsDescendantOf(Workspace) then
  344. local char = plr.Character
  345. local root = char and char.PrimaryPart
  346. local head = char and char:FindFirstChild('Head')
  347. if not (char and root and head) then return end
  348. local dir = (aimPos - head.Position).Unit
  349. local stateTable = {
  350. CFrame = root.CFrame,
  351. FieldOfView = Camera.FieldOfView,
  352. ViewportSize = Camera.ViewportSize,
  353. }
  354. local tool = ballTool or (char and char:FindFirstChildOfClass('Tool'))
  355. shootRemote:FireServer(
  356. aimPos,
  357. shootFrom or (root.Position + dir * 4),
  358. shootKey,
  359. tool,
  360. CURRENT_POWER, -- dynamic power
  361. stateTable,
  362. true
  363. )
  364. else
  365. shootRemote:FireServer(aimPos, shootFrom, shootKey)
  366. end
  367. end
  368.  
  369. local function shootAtTarget()
  370. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
  371. if not (selectedRim and selectedRim:IsDescendantOf(Workspace)) then return end
  372. if not shootKey then return end
  373. if not shootRemote then return end
  374. local char = plr.Character
  375. if not char then return end
  376. local head, root = char:FindFirstChild('Head'), char.PrimaryPart
  377. if not (head and root) then return end
  378. local aimPos = smartAim(selectedRim)
  379. local dir = (aimPos - head.Position).Unit
  380. local shootFrom = root.Position + dir * 3.8
  381. if shootFrom.Y - root.Position.Y < 4 then
  382. shootFrom = root.Position + dir * 4
  383. end
  384. fireShootRemote(aimPos, shootFrom)
  385. end
  386.  
  387. UserInputService.InputBegan:Connect(function(i, gp)
  388. if gp or not getgenv().PAYLOAD0_SYSTEM_ACTIVE then return end
  389. if i.UserInputType == Enum.UserInputType.MouseButton1 and hasBall() then
  390. shootAtTarget()
  391. end
  392. end)
  393.  
  394. -- === VISUALS ===
  395. local hl = CoreGui:FindFirstChild('PerfectRangeGlow') or Instance.new('Highlight')
  396. hl.Name = 'PerfectRangeGlow'
  397. hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  398. hl.FillTransparency = 0.25
  399. hl.OutlineTransparency = 0
  400. hl.Adornee = plr.Character
  401. hl.Parent = CoreGui
  402. hl.Enabled = false
  403.  
  404. local moveKeys = { W=false, A=false, S=false, D=false }
  405. UserInputService.InputBegan:Connect(function(i,gp) if gp then return end local k=i.KeyCode.Name if moveKeys[k]~=nil then moveKeys[k]=true end end)
  406. UserInputService.InputEnded:Connect(function(i,gp) if gp then return end local k=i.KeyCode.Name if moveKeys[k]~=nil then moveKeys[k]=false end end)
  407.  
  408. local function shouldPush() local c=0 for _,v in pairs(moveKeys) do if v then c+=1 end end return c==1 and (moveKeys.A or moveKeys.D) end
  409.  
  410. local rimsForPush={}
  411. for _,v in ipairs(Workspace:GetDescendants()) do
  412. if v:IsA('BasePart') and v.Name=='Lol' and v.Parent and v.Parent.Name=='Rim' then
  413. table.insert(rimsForPush,v)
  414. end
  415. end
  416.  
  417. local function nearestRim(rootPos)
  418. local nearest,nearestDist
  419. for _,rim in ipairs(rimsForPush) do
  420. if rim:IsDescendantOf(Workspace) then
  421. local rimXZ=Vector3.new(rim.Position.X,0,rim.Position.Z)
  422. local dist=(rimXZ-Vector3.new(rootPos.X,0,rootPos.Z)).Magnitude
  423. if not nearestDist or dist<nearestDist then nearest,nearestDist=rim,dist end
  424. end
  425. end
  426. return nearest,nearestDist
  427. end
  428.  
  429. local function getNearestPerfectDistance(current)
  430. local nearest,smallestDiff
  431. for _,pd in ipairs(PERFECT_DISTANCES) do
  432. local diff=math.abs(pd-current)
  433. if not smallestDiff or diff<smallestDiff then
  434. nearest,smallestDiff=pd,diff
  435. end
  436. end
  437. return nearest
  438. end
  439.  
  440. local smoothBias=Vector3.zero
  441. RunService.RenderStepped:Connect(function()
  442. if not getgenv().PAYLOAD0_SYSTEM_ACTIVE then hl.Enabled=false return end
  443. local char=plr.Character
  444. local hum=char and char:FindFirstChildOfClass('Humanoid')
  445. local root=char and char:FindFirstChild('HumanoidRootPart')
  446. if not (hum and root) then return end
  447. if not hasBall() then hl.Enabled=false return end
  448. local rim,dist=nearestRim(root.Position)
  449. if not rim or dist>ACTIVE_RANGE_MAIN then hl.Enabled=false smoothBias=Vector3.zero return end
  450. local target=getNearestPerfectDistance(dist)
  451. local diff=dist-target
  452. local absDiff=math.abs(diff)
  453. local desired=Vector3.zero
  454. if shouldPush() and absDiff<CLAMP_RADIUS then
  455. local strength=(CLAMP_RADIUS-absDiff)/CLAMP_RADIUS
  456. local toRim=Vector3.new(rim.Position.X,0,rim.Position.Z)-Vector3.new(root.Position.X,0,root.Position.Z)
  457. local distSign=math.sign(diff)
  458. if distSign>0 then
  459. local pushDir=-toRim.Unit
  460. desired=pushDir*math.min(strength*MAX_PUSH,MAX_PUSH)
  461. end
  462. end
  463. smoothBias=smoothBias*DAMPING+desired*(1-DAMPING)
  464. root.CFrame+=Vector3.new(smoothBias.X,0,smoothBias.Z)
  465.  
  466. if VisualsEnabled then
  467. hl.Enabled=true
  468. if absDiff<=0.10 then hl.FillColor,hl.OutlineColor=COLOR_GREEN,COLOR_GREEN
  469. elseif absDiff<CLAMP_RADIUS then hl.FillColor,hl.OutlineColor=COLOR_GREEN_SOFT,COLOR_GREEN_SOFT
  470. else hl.Enabled=false end
  471. else hl.Enabled=false end
  472. end)
  473.  
  474. plr.CharacterAdded:Connect(function(c)
  475. task.wait(0.5)
  476. hl.Adornee=c
  477. end)
  478.  
Advertisement
Add Comment
Please, Sign In to add comment