qiell

Untitled

Apr 14th, 2026 (edited)
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.94 KB | None | 0 0
  1. -- Services
  2. local Players = game:GetService("Players")
  3. local RunService = game:GetService("RunService")
  4. local UserInputService = game:GetService("UserInputService")
  5.  
  6. -- Configuration
  7. local RADAR_WIDTH = 160
  8. local RADAR_HEIGHT = 60
  9. local MAX_DISTANCE = 350
  10. local DOT_SIZE = 6
  11. local SAFETY_SCAN_RATE = 5
  12.  
  13. local player = Players.LocalPlayer
  14. local pGui = player:WaitForChild("PlayerGui")
  15. local activeDots = {}
  16.  
  17. -- Cleanup
  18. for _, gui in ipairs(pGui:GetChildren()) do
  19. if gui.Name:find("Delta_Radar") then gui:Destroy() end
  20. end
  21.  
  22. -- UI Setup
  23. local screenGui = Instance.new("ScreenGui")
  24. screenGui.Name = "Delta_Radar_V21_SteadyEye"
  25. screenGui.ResetOnSpawn = false
  26. screenGui.IgnoreGuiInset = true
  27. screenGui.Parent = pGui
  28.  
  29. local radarFrame = Instance.new("Frame")
  30. radarFrame.Size = UDim2.new(0, RADAR_WIDTH, 0, RADAR_HEIGHT)
  31. radarFrame.Position = UDim2.new(0.5, -RADAR_WIDTH/2, 0.05, 0)
  32. radarFrame.BackgroundColor3 = Color3.fromRGB(5, 5, 10)
  33. radarFrame.BackgroundTransparency = 0.2
  34. radarFrame.ClipsDescendants = true
  35. radarFrame.Active = true
  36. radarFrame.Parent = screenGui
  37.  
  38. local radarCorner = Instance.new("UICorner")
  39. radarCorner.CornerRadius = UDim.new(1, 0)
  40. radarCorner.Parent = radarFrame
  41.  
  42. local stroke = Instance.new("UIStroke")
  43. stroke.Thickness = 2
  44. stroke.Color = Color3.fromRGB(0, 80, 200)
  45. stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
  46. stroke.Parent = radarFrame
  47.  
  48. -- Center Pointer
  49. local centerDot = Instance.new("Frame")
  50. centerDot.Size = UDim2.new(0, 6, 0, 6)
  51. centerDot.Position = UDim2.new(0.5, -3, 0.5, -3)
  52. centerDot.BackgroundTransparency = 1
  53. centerDot.ZIndex = 4
  54. centerDot.Parent = radarFrame
  55.  
  56. local directionArrow = Instance.new("TextLabel")
  57. directionArrow.Size = UDim2.new(1, 0, 1, 0)
  58. directionArrow.BackgroundTransparency = 1
  59. directionArrow.Text = "▲"
  60. directionArrow.TextColor3 = Color3.fromRGB(0, 255, 0)
  61. directionArrow.TextSize = 8
  62. directionArrow.ZIndex = 5
  63. directionArrow.Parent = centerDot
  64.  
  65. local arrowStroke = Instance.new("UIStroke")
  66. arrowStroke.Thickness = 1
  67. arrowStroke.Color = Color3.new(0, 0, 0)
  68. arrowStroke.Parent = directionArrow
  69.  
  70. -----------------------------------------------------------
  71. -- DRAGGING
  72. -----------------------------------------------------------
  73. local dragging, dragStart, startPos
  74. radarFrame.InputBegan:Connect(function(input)
  75. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  76. dragging = true
  77. dragStart = input.Position
  78. startPos = radarFrame.Position
  79. end
  80. end)
  81.  
  82. UserInputService.InputEnded:Connect(function(input)
  83. if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  84. dragging = false
  85. end
  86. end)
  87.  
  88. UserInputService.InputChanged:Connect(function(input)
  89. if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
  90. local delta = input.Position - dragStart
  91. radarFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
  92. end
  93. end)
  94.  
  95. -----------------------------------------------------------
  96. -- TARGET LOGIC (V21)
  97. -----------------------------------------------------------
  98.  
  99. local function isTarget(obj)
  100. if not obj or not obj:IsA("Model") then return false end
  101. if Players:GetPlayerFromCharacter(obj) then return false end
  102.  
  103. local hum = obj:FindFirstChildOfClass("Humanoid")
  104. if not hum then return false end
  105.  
  106. local root = obj:FindFirstChild("HumanoidRootPart") or obj.PrimaryPart
  107. if not root then return false end
  108.  
  109. return true
  110. end
  111.  
  112. local function createDot(obj)
  113. if activeDots[obj] then return end
  114.  
  115. local dot = Instance.new("Frame")
  116. dot.Name = "AIDot"
  117. dot.Size = UDim2.new(0, DOT_SIZE, 0, DOT_SIZE)
  118. dot.BackgroundColor3 = Color3.fromRGB(255, 40, 40)
  119. dot.ZIndex = 10
  120. dot.Visible = false -- Start hidden
  121. dot.Parent = radarFrame
  122.  
  123. local dCorner = Instance.new("UICorner")
  124. dCorner.CornerRadius = UDim.new(1, 0)
  125. dCorner.Parent = dot
  126.  
  127. local label = Instance.new("TextLabel")
  128. label.Size = UDim2.new(0, 40, 0, 12)
  129. label.Position = UDim2.new(0.5, -20, 0, -12)
  130. label.BackgroundTransparency = 1
  131. label.TextColor3 = Color3.new(1, 1, 1)
  132. label.TextSize = 8
  133. label.Font = Enum.Font.Code
  134. label.Parent = dot
  135.  
  136. local textStroke = Instance.new("UIStroke")
  137. textStroke.Thickness = 1.5
  138. textStroke.Parent = label
  139.  
  140. activeDots[obj] = {Dot = dot, Label = label}
  141. end
  142.  
  143. local function updateRadar()
  144. local char = player.Character
  145. local root = char and char:FindFirstChild("HumanoidRootPart")
  146. if not root then return end
  147.  
  148. directionArrow.Rotation = -root.Orientation.Y
  149.  
  150. for ai, data in pairs(activeDots) do
  151. -- 1. Check if the object still exists in the game
  152. if not ai or not ai.Parent then
  153. if data.Dot then data.Dot:Destroy() end
  154. activeDots[ai] = nil
  155. continue
  156. end
  157.  
  158. local aiRoot = ai:FindFirstChild("HumanoidRootPart") or ai.PrimaryPart
  159. local hum = ai:FindFirstChildOfClass("Humanoid")
  160.  
  161. -- 2. "Soft Check" for Visibility
  162. -- If it's dead, anchored, or missing a root, we just hide it (no flickering!)
  163. local isActuallyValid = aiRoot and hum and hum.Health > 0 and not aiRoot.Anchored
  164.  
  165. if isActuallyValid then
  166. local offset = aiRoot.Position - root.Position
  167. local xOffset = (offset.X / MAX_DISTANCE) * (RADAR_WIDTH / 2)
  168. local zOffset = (offset.Z / MAX_DISTANCE) * (RADAR_HEIGHT / 2)
  169.  
  170. -- Check if it's within the radar's visual bounds
  171. if math.abs(xOffset) < (RADAR_WIDTH/2 - 5) and math.abs(zOffset) < (RADAR_HEIGHT/2 - 5) then
  172. data.Dot.Visible = true
  173. data.Dot.Position = UDim2.new(0.5, xOffset - (DOT_SIZE/2), 0.5, zOffset - (DOT_SIZE/2))
  174. data.Label.Text = math.floor(offset.Magnitude) .. "m"
  175. else
  176. data.Dot.Visible = false
  177. end
  178. else
  179. -- Target is invalid (dead/anchored), just hide it until it's valid again
  180. data.Dot.Visible = false
  181. end
  182. end
  183. end
  184.  
  185. -----------------------------------------------------------
  186. -- PERFORMANCE LOOPS
  187. -----------------------------------------------------------
  188.  
  189. local function fullSweep()
  190. for _, obj in ipairs(workspace:GetDescendants()) do
  191. if isTarget(obj) then createDot(obj) end
  192. end
  193. end
  194.  
  195. fullSweep()
  196.  
  197. workspace.DescendantAdded:Connect(function(obj)
  198. task.wait(1)
  199. if isTarget(obj) then createDot(obj) end
  200. end)
  201.  
  202. task.spawn(function()
  203. while true do
  204. task.wait(SAFETY_SCAN_RATE)
  205. pcall(fullSweep)
  206. end
  207. end)
  208.  
  209. RunService.Heartbeat:Connect(function()
  210. updateRadar()
  211. end)
  212.  
Advertisement
Add Comment
Please, Sign In to add comment