ColdSpecs

Basketball Rim Dot (LBU)

Nov 2nd, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. -- 🏀 Multi-Target Dunk Detector (v2)
  2. local Players = game:GetService("Players")
  3. local Workspace = game:GetService("Workspace")
  4.  
  5. local plr = Players.LocalPlayer
  6.  
  7. -- === CONFIG ===
  8. -- Add as many targets as you want: each entry is { Name = "...", Size = Vector3.new(...), Color = Color3.fromRGB(...) }
  9. local TARGET_PROFILES = {
  10. { Name = "Rim", Size = Vector3.new(3.632131576538086, 0.5587897300720215, 3.632131576538086), Color = Color3.fromRGB(0, 255, 0) }
  11. }
  12.  
  13. local SEARCH_RADIUS = 120
  14. local Targets, Markers = {}, {}
  15. local selectedTarget
  16.  
  17. -- === HELPERS ===
  18. local function fuzzyEq(a: Vector3, b: Vector3, eps: number)
  19. eps = eps or 0.05
  20. return math.abs(a.X - b.X) <= eps and math.abs(a.Y - b.Y) <= eps and math.abs(a.Z - b.Z) <= eps
  21. end
  22.  
  23. local function matchProfile(part)
  24. for _, prof in ipairs(TARGET_PROFILES) do
  25. if part.Name == prof.Name and fuzzyEq(part.Size, prof.Size, 0.05) then
  26. return prof
  27. end
  28. end
  29. return nil
  30. end
  31.  
  32. -- === MARKER HANDLING ===
  33. local function makeMarker(part, color)
  34. local marker = Instance.new("Part")
  35. marker.Shape = Enum.PartType.Ball
  36. marker.Size = Vector3.new(0.35, 0.35, 0.35)
  37. marker.Material = Enum.Material.Neon
  38. marker.Color = color or Color3.fromRGB(0, 255, 0)
  39. marker.Anchored = true
  40. marker.CanCollide = false
  41. marker.Parent = Workspace
  42. Markers[part] = marker
  43. end
  44.  
  45. local function updateMarker(part)
  46. local marker = Markers[part]
  47. if marker and part:IsDescendantOf(Workspace) then
  48. marker.Position = part.Position + Vector3.new(0, 2.5, 0)
  49. end
  50. end
  51.  
  52. local function removeMarker(part)
  53. local marker = Markers[part]
  54. if marker then
  55. marker:Destroy()
  56. Markers[part] = nil
  57. end
  58. end
  59.  
  60. -- === SCANNER ===
  61. local function findAllTargets()
  62. table.clear(Targets)
  63. for _, v in ipairs(Workspace:GetDescendants()) do
  64. if v:IsA("BasePart") then
  65. local prof = matchProfile(v)
  66. if prof then
  67. table.insert(Targets, { part = v, profile = prof })
  68. if not Markers[v] then
  69. makeMarker(v, prof.Color)
  70. end
  71. end
  72. end
  73. end
  74. end
  75.  
  76. -- === INITIALIZE ===
  77. findAllTargets()
  78.  
  79. -- === DYNAMIC UPDATES ===
  80. Workspace.DescendantAdded:Connect(function(o)
  81. if o:IsA("BasePart") then
  82. local prof = matchProfile(o)
  83. if prof then
  84. table.insert(Targets, { part = o, profile = prof })
  85. makeMarker(o, prof.Color)
  86. end
  87. end
  88. end)
  89.  
  90. Workspace.DescendantRemoving:Connect(function(o)
  91. for i, data in ipairs(Targets) do
  92. if data.part == o then
  93. table.remove(Targets, i)
  94. break
  95. end
  96. end
  97. removeMarker(o)
  98. if selectedTarget and selectedTarget.part == o then
  99. selectedTarget = nil
  100. end
  101. end)
  102.  
  103. -- === TRACKING LOOP ===
  104. task.spawn(function()
  105. while task.wait(0.1) do
  106. local root = plr.Character and plr.Character:FindFirstChild("HumanoidRootPart")
  107. if not root then continue end
  108.  
  109. local best, bestDist = nil, SEARCH_RADIUS
  110. for _, data in ipairs(Targets) do
  111. local part, prof = data.part, data.profile
  112. if part:IsDescendantOf(Workspace) then
  113. local dist = (part.Position - root.Position).Magnitude
  114. if dist < bestDist then
  115. best, bestDist = data, dist
  116. end
  117. end
  118. updateMarker(part)
  119. end
  120.  
  121. if best and best ~= selectedTarget then
  122. selectedTarget = best
  123. print(string.format("[Tracker] %s selected (%.1f studs away)", best.part:GetFullName(), bestDist))
  124. end
  125.  
  126. -- Visual cue for nearest target
  127. for part, marker in pairs(Markers) do
  128. if selectedTarget and part == selectedTarget.part then
  129. marker.Color = Color3.fromRGB(255, 255, 0)
  130. marker.Size = Vector3.new(0.45, 0.45, 0.45)
  131. else
  132. -- Reset to its profile’s color
  133. local prof = matchProfile(part)
  134. marker.Color = (prof and prof.Color) or Color3.fromRGB(0, 255, 0)
  135. marker.Size = Vector3.new(0.35, 0.35, 0.35)
  136. end
  137. end
  138. end
  139. end)
  140.  
Advertisement
Add Comment
Please, Sign In to add comment