Hello. This system is great and really easy to use and modify, but I realized there wasn’t a built in tag specific scan so I just made edited versions that only scan for humanoids with certain tags. Both versions below.
local Base = script.Parent
local Map = Base.Map
local RS = game:GetService("RunService")
local CS = game:GetService("CollectionService")
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local HRP:Part = Char:WaitForChild("HumanoidRootPart")
local Dot = script:WaitForChild("PlayerDot")
local camera = workspace.CurrentCamera
local dist = 50
local function tween(o,d,g)
game:GetService("TweenService"):Create(o,TweenInfo.new(d),g):Play()
end
local function Exists(Obj)
for i,v in pairs(Map:GetChildren()) do
if v:FindFirstChild("Object") then
if v.Object.Value == Obj then
return v
end
end
end
return nil
end
RS.RenderStepped:Connect(function(dt)
local _,y,_ = camera.CFrame:ToOrientation()
Map.Rotation = math.deg(y)
Map.North.Rotation = -Map.Rotation
for _,hum in pairs(--[[Your tag here]]) do
local humanoid = hum:FindFirstChild("Humanoid")
if humanoid and not humanoid:IsDescendantOf(Char) then
if hum.PrimaryPart then
local rootPos:Vector3 = hum.PrimaryPart.Position
rootPos = Vector3.new(rootPos.X,0,rootPos.Z)
local HRPPos = Vector3.new(HRP.Position.X,0,HRP.Position.Z)
local a = camera.CFrame.LookVector
a = Vector3.new(a.X,0,a.Z)
local b = (rootPos-HRPPos).Unit
b = Vector3.new(b.X,0,b.Z)
local dotp = math.acos(a:Dot(b))
if (rootPos-HRPPos).Magnitude <= dist then
if not Exists(hum) then
local Point = Dot:Clone()
Point.Parent = Map
Point.Object.Value = hum
local Pos = (rootPos-HRPPos) * 0.5/dist
Point.Position = UDim2.new(Pos.X+0.5,0,Pos.Z+0.5,0)
local Color = Color3.fromRGB(255,dotp < math.pi/4 and 123 or 255,dotp < math.pi/4 and 123 or 255)
Point.BackgroundColor3 = Color
Point.UIStroke.Color = Color
else
local Point = Exists(hum)
local Pos = (rootPos-HRPPos) * 0.5/dist
tween(Point,0.1,{Position = UDim2.new(Pos.X+0.5,0,Pos.Z+0.5,0)})
local Color = Color3.fromRGB(255,dotp < math.pi/4 and 123 or 255,dotp < math.pi/4 and 123 or 255)
tween(Point,0.25,{BackgroundColor3 = Color})
tween(Point.UIStroke,0.25,{Color = Color})
end
else
if Exists(hum) then
Exists(hum):Destroy()
end
end
end
end
end
end)
^-Live Radar
v-Scanning Radar
local Base = script.Parent
local Map = Base.Map
local Line = Base.Line
local RS = game:GetService("RunService")
local CS = game:GetService("CollectionService")
local Player = game.Players.LocalPlayer
local Char = Player.Character or Player.CharacterAdded:Wait()
local HRP:Part = Char:WaitForChild("HumanoidRootPart")
local Dot = script:WaitForChild("PlayerDot")
local camera = workspace.CurrentCamera
local dist = 50
local speed = 1.5
local rot = 0
local function tween(o,d,g)
game:GetService("TweenService"):Create(o,TweenInfo.new(d),g):Play()
end
local db = false
local function addPoint(rotat,rootPos,HRPPos)
local Point = Dot:Clone()
Point.Parent = Map
Point.Rotation = rotat
local diff = (rootPos-HRPPos) * 0.5/dist
Point.PlayerDot.Position = UDim2.new(0.5,0,0.5-diff.Magnitude,0)
return Point
end
RS.RenderStepped:Connect(function(dt)
rot -= dt*60*speed
Line.Rotation = (rot-90) % 360
for _,hum in pairs(CS:GetTagged("Enemy")) do
local humanoid = hum:FindFirstChild("Humanoid")
if humanoid and not humanoid:IsDescendantOf(Char) then
if hum.PrimaryPart then
local rootPos:Vector3 = hum.PrimaryPart.Position
local HRPPos = Vector3.new(HRP.Position.X,0,HRP.Position.Z)
rootPos = Vector3.new(rootPos.X,0,rootPos.Z)
local a = Vector3.new(0,0,-1)
local b = (rootPos-HRPPos).Unit
local dotp = math.deg(math.acos(a:Dot(b)))
if rootPos.X-HRPPos.X < 0 then
dotp = -dotp
end
dotp = dotp < 0 and dotp + 360 or dotp
if (rootPos-HRPPos).Magnitude <= dist then
local _,y,_ = camera.CFrame:ToOrientation()
local rotat = dotp+math.deg(y)
if math.abs(Line.Rotation-rotat) < speed then
if not db then
db = true
local Point = addPoint(rotat,rootPos,HRPPos)
tween(Point.PlayerDot,1,{BackgroundTransparency = 1})
tween(Point.PlayerDot.UIStroke,1,{Transparency = 1})
tween(Point.PlayerDot,1,{Size = UDim2.new(0.05,0,0.05,0)})
game:GetService("Debris"):AddItem(Point,1)
wait(dt*2)
db = false
end
end
end
end
end
end
end)