Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Services
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- -- Configuration
- local RADAR_WIDTH = 160
- local RADAR_HEIGHT = 60
- local MAX_DISTANCE = 350
- local DOT_SIZE = 6
- local SAFETY_SCAN_RATE = 5
- local player = Players.LocalPlayer
- local pGui = player:WaitForChild("PlayerGui")
- local activeDots = {}
- -- Cleanup
- for _, gui in ipairs(pGui:GetChildren()) do
- if gui.Name:find("Delta_Radar") then gui:Destroy() end
- end
- -- UI Setup
- local screenGui = Instance.new("ScreenGui")
- screenGui.Name = "Delta_Radar_V21_SteadyEye"
- screenGui.ResetOnSpawn = false
- screenGui.IgnoreGuiInset = true
- screenGui.Parent = pGui
- local radarFrame = Instance.new("Frame")
- radarFrame.Size = UDim2.new(0, RADAR_WIDTH, 0, RADAR_HEIGHT)
- radarFrame.Position = UDim2.new(0.5, -RADAR_WIDTH/2, 0.05, 0)
- radarFrame.BackgroundColor3 = Color3.fromRGB(5, 5, 10)
- radarFrame.BackgroundTransparency = 0.2
- radarFrame.ClipsDescendants = true
- radarFrame.Active = true
- radarFrame.Parent = screenGui
- local radarCorner = Instance.new("UICorner")
- radarCorner.CornerRadius = UDim.new(1, 0)
- radarCorner.Parent = radarFrame
- local stroke = Instance.new("UIStroke")
- stroke.Thickness = 2
- stroke.Color = Color3.fromRGB(0, 80, 200)
- stroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
- stroke.Parent = radarFrame
- -- Center Pointer
- local centerDot = Instance.new("Frame")
- centerDot.Size = UDim2.new(0, 6, 0, 6)
- centerDot.Position = UDim2.new(0.5, -3, 0.5, -3)
- centerDot.BackgroundTransparency = 1
- centerDot.ZIndex = 4
- centerDot.Parent = radarFrame
- local directionArrow = Instance.new("TextLabel")
- directionArrow.Size = UDim2.new(1, 0, 1, 0)
- directionArrow.BackgroundTransparency = 1
- directionArrow.Text = "▲"
- directionArrow.TextColor3 = Color3.fromRGB(0, 255, 0)
- directionArrow.TextSize = 8
- directionArrow.ZIndex = 5
- directionArrow.Parent = centerDot
- local arrowStroke = Instance.new("UIStroke")
- arrowStroke.Thickness = 1
- arrowStroke.Color = Color3.new(0, 0, 0)
- arrowStroke.Parent = directionArrow
- -----------------------------------------------------------
- -- DRAGGING
- -----------------------------------------------------------
- local dragging, dragStart, startPos
- radarFrame.InputBegan:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = true
- dragStart = input.Position
- startPos = radarFrame.Position
- end
- end)
- UserInputService.InputEnded:Connect(function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
- dragging = false
- end
- end)
- UserInputService.InputChanged:Connect(function(input)
- if dragging and (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) then
- local delta = input.Position - dragStart
- radarFrame.Position = UDim2.new(startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y)
- end
- end)
- -----------------------------------------------------------
- -- TARGET LOGIC (V21)
- -----------------------------------------------------------
- local function isTarget(obj)
- if not obj or not obj:IsA("Model") then return false end
- if Players:GetPlayerFromCharacter(obj) then return false end
- local hum = obj:FindFirstChildOfClass("Humanoid")
- if not hum then return false end
- local root = obj:FindFirstChild("HumanoidRootPart") or obj.PrimaryPart
- if not root then return false end
- return true
- end
- local function createDot(obj)
- if activeDots[obj] then return end
- local dot = Instance.new("Frame")
- dot.Name = "AIDot"
- dot.Size = UDim2.new(0, DOT_SIZE, 0, DOT_SIZE)
- dot.BackgroundColor3 = Color3.fromRGB(255, 40, 40)
- dot.ZIndex = 10
- dot.Visible = false -- Start hidden
- dot.Parent = radarFrame
- local dCorner = Instance.new("UICorner")
- dCorner.CornerRadius = UDim.new(1, 0)
- dCorner.Parent = dot
- local label = Instance.new("TextLabel")
- label.Size = UDim2.new(0, 40, 0, 12)
- label.Position = UDim2.new(0.5, -20, 0, -12)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.new(1, 1, 1)
- label.TextSize = 8
- label.Font = Enum.Font.Code
- label.Parent = dot
- local textStroke = Instance.new("UIStroke")
- textStroke.Thickness = 1.5
- textStroke.Parent = label
- activeDots[obj] = {Dot = dot, Label = label}
- end
- local function updateRadar()
- local char = player.Character
- local root = char and char:FindFirstChild("HumanoidRootPart")
- if not root then return end
- directionArrow.Rotation = -root.Orientation.Y
- for ai, data in pairs(activeDots) do
- -- 1. Check if the object still exists in the game
- if not ai or not ai.Parent then
- if data.Dot then data.Dot:Destroy() end
- activeDots[ai] = nil
- continue
- end
- local aiRoot = ai:FindFirstChild("HumanoidRootPart") or ai.PrimaryPart
- local hum = ai:FindFirstChildOfClass("Humanoid")
- -- 2. "Soft Check" for Visibility
- -- If it's dead, anchored, or missing a root, we just hide it (no flickering!)
- local isActuallyValid = aiRoot and hum and hum.Health > 0 and not aiRoot.Anchored
- if isActuallyValid then
- local offset = aiRoot.Position - root.Position
- local xOffset = (offset.X / MAX_DISTANCE) * (RADAR_WIDTH / 2)
- local zOffset = (offset.Z / MAX_DISTANCE) * (RADAR_HEIGHT / 2)
- -- Check if it's within the radar's visual bounds
- if math.abs(xOffset) < (RADAR_WIDTH/2 - 5) and math.abs(zOffset) < (RADAR_HEIGHT/2 - 5) then
- data.Dot.Visible = true
- data.Dot.Position = UDim2.new(0.5, xOffset - (DOT_SIZE/2), 0.5, zOffset - (DOT_SIZE/2))
- data.Label.Text = math.floor(offset.Magnitude) .. "m"
- else
- data.Dot.Visible = false
- end
- else
- -- Target is invalid (dead/anchored), just hide it until it's valid again
- data.Dot.Visible = false
- end
- end
- end
- -----------------------------------------------------------
- -- PERFORMANCE LOOPS
- -----------------------------------------------------------
- local function fullSweep()
- for _, obj in ipairs(workspace:GetDescendants()) do
- if isTarget(obj) then createDot(obj) end
- end
- end
- fullSweep()
- workspace.DescendantAdded:Connect(function(obj)
- task.wait(1)
- if isTarget(obj) then createDot(obj) end
- end)
- task.spawn(function()
- while true do
- task.wait(SAFETY_SCAN_RATE)
- pcall(fullSweep)
- end
- end)
- RunService.Heartbeat:Connect(function()
- updateRadar()
- end)
Advertisement
Add Comment
Please, Sign In to add comment