Universal Player Radar Script | Square Map + Team Check | Roblox Script
Free Roblox script · no key system — copy & run on your executor.
Description
Square minimap radar for any game. Shows enemies on map, team check, rotates with camera. Lightweight open source script.
Script code
local cfg = {
size = 150,
pad = 16,
range = 250,
team = true,
rotate = true,
corner = "TopRight",
dot = 4,
me = Color3.fromRGB(255, 255, 255),
foe = Color3.fromRGB(255, 70, 70),
ally = Color3.fromRGB(80, 160, 255),
border = Color3.fromRGB(120, 180, 255),
bg = Color3.fromRGB(8, 12, 22),
}
if not Drawing then return end
local Players = game:GetService("Players")
local RS = game:GetService("RunService")
local lp = Players.LocalPlayer
local max = 39
local ui = {dots = {}}
local half = cfg.size * 0.5
local function mkLine()
local l = Drawing.new("Line")
l.Thickness, l.Transparency, l.Visible = 1, 1, false
return l
end
ui.bg = Drawing.new("Square")
ui.bg.Filled, ui.bg.Transparency, ui.bg.Visible = true, 0.35, true
ui.bg.Size = Vector2.new(cfg.size, cfg.size)
ui.edge = {mkLine(), mkLine(), mkLine(), mkLine()}
for _, l in ipairs(ui.edge) do l.Thickness, l.Color = 2, cfg.border end
ui.cross = {mkLine(), mkLine()}
for _, l in ipairs(ui.cross) do l.Color = Color3.fromRGB(60, 70, 90) end
ui.fwd = mkLine()
ui.fwd.Thickness, ui.fwd.Color = 2, cfg.me
ui.me = Drawing.new("Circle")
ui.me.Filled, ui.me.Radius, ui.me.Color, ui.me.Transparency, ui.me.Visible = true, 3, cfg.me, 1, true
for i = 1, max do
local d = Drawing.new("Circle")
d.Filled, d.Radius, d.Transparency, d.Visible = true, cfg.dot, 1, false
ui.dots[i] = d
end
local function enemy(p)
if p == lp then return false end
if not cfg.team then return true end
return not p.Team or not lp.Team or p.Team ~= lp.Team
end
local function center()
local cam = workspace.CurrentCamera
if not cam then return 0, 0 end
local v = cam.ViewportSize
if cfg.corner == "TopLeft" then
return cfg.pad + half, cfg.pad + half
elseif cfg.corner == "BottomLeft" then
return cfg.pad + half, v.Y - cfg.pad - half
elseif cfg.corner == "BottomRight" then
return v.X - cfg.pad - half, v.Y - cfg.pad - half
end
return v.X - cfg.pad - half, cfg.pad + half
end
local function setSquare(cx, cy)
local x, y = cx - half, cy - half
ui.bg.Position, ui.bg.Size, ui.bg.Color = Vector2.new(x, y), Vector2.new(cfg.size, cfg.size), cfg.bg
local tl, tr, br, bl = Vector2.new(x, y), Vector2.new(x + cfg.size, y), Vector2.new(x + cfg.size, y + cfg.size), Vector2.new(x, y + cfg.size)
ui.edge[1].From, ui.edge[1].To, ui.edge[1].Visible = tl, tr, true
ui.edge[2].From, ui.edge[2].To, ui.edge[2].Visible = tr, br, true
ui.edge[3].From, ui.edge[3].To, ui.edge[3].Visible = br, bl, true
ui.edge[4].From, ui.edge[4].To, ui.edge[4].Visible = bl, tl, true
ui.cross[1].From, ui.cross[1].To, ui.cross[1].Visible = Vector2.new(cx, y), Vector2.new(cx, y + cfg.size), true
ui.cross[2].From, ui.cross[2].To, ui.cross[2].Visible = Vector2.new(x, cy), Vector2.new(x + cfg.size, cy), true
ui.fwd.From, ui.fwd.To, ui.fwd.Visible = Vector2.new(cx, cy), Vector2.new(cx, cy - 10), cfg.rotate
ui.me.Position = Vector2.new(cx, cy)
end
local function mapPos(cx, cy, rel, yaw)
local x, z = rel.X, rel.Z
if cfg.rotate then
local c, s = math.cos(-yaw), math.sin(-yaw)
x, z = rel.X * c - rel.Z * s, rel.X * s + rel.Z * c
end
x = math.clamp(x / cfg.range, -1, 1)
z = math.clamp(z / cfg.range, -1, 1)
return Vector2.new(cx + x * half, cy - z * half)
end
RS.RenderStepped:Connect(function()
local cam = workspace.CurrentCamera
local me = lp.Character and lp.Character:FindFirstChild("HumanoidRootPart")
if not cam or not me then return end
local cx, cy = center()
setSquare(cx, cy)
local _, yaw = cam.CFrame:ToEulerAnglesYXZ()
local n = 0
for _, p in ipairs(Players:GetPlayers()) do
if p == lp then continue end
if cfg.team and not enemy(p) then continue end
local root = p.Character and p.Character:FindFirstChild("HumanoidRootPart")
local hum = p.Character and p.Character:FindFirstChildOfClass("Humanoid")
if root and hum and hum.Health > 0 then
n += 1
if n <= max then
local d = ui.dots[n]
d.Position = mapPos(cx, cy, root.Position - me.Position, yaw)
d.Color = (p.Team and lp.Team and p.Team == lp.Team) and cfg.ally or cfg.foe
d.Radius, d.Visible = cfg.dot, true
end
end
end
for i = n + 1, max do ui.dots[i].Visible = false end
end)
Long script — expand to view syntax highlighting
Discussion
0 / 20Log in to join the discussion.
No comments yetBe the first to ask a question or leave feedback.
Universal Player Radar Script | Square Map + Team Check | Roblox Script