Advertisement
Zynee

Untitled

Jan 19th, 2025 (edited)
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.87 KB | None | 0 0
  1. local Players = game:service("Players")
  2. local Player = Players.LocalPlayer
  3. local Mouse = Player:GetMouse()
  4. local Camera = game:service("Workspace").CurrentCamera
  5. local RS = game:service("RunService")
  6. local UIS = game:service("UserInputService")
  7.  
  8. repeat wait() until Player.Character ~= nil and Player.Character.PrimaryPart ~= nil
  9.  
  10. local LerpColorModule = loadstring(game:HttpGet("https://pastebin.com/raw/wRnsJeid"))()
  11. local HealthBarLerp = LerpColorModule:Lerp(Color3.fromRGB(255, 0, 0), Color3.fromRGB(0, 255, 0))
  12.  
  13. local function NewCircle(Transparency, Color, Radius, Filled, Thickness)
  14.     local c = Drawing.new("Circle")
  15.     c.Transparency = Transparency
  16.     c.Color = Color
  17.     c.Visible = false
  18.     c.Thickness = Thickness
  19.     c.Position = Vector2.new(0, 0)
  20.     c.Radius = Radius
  21.     c.NumSides = math.clamp(Radius * 55 / 100, 10, 75)
  22.     c.Filled = Filled
  23.     return c
  24. end
  25.  
  26. local RadarInfo = {
  27.     Position = Vector2.new(200, 200),
  28.     Radius = 100,
  29.     Scale = 1,
  30.     RadarBack = Color3.fromRGB(10, 10, 10),
  31.     RadarBorder = Color3.fromRGB(75, 75, 75),
  32.     LocalPlayerDot = Color3.fromRGB(255, 255, 255),
  33.     PlayerDot = Color3.fromRGB(60, 170, 255),
  34.     Team = Color3.fromRGB(0, 255, 0),
  35.     Enemy = Color3.fromRGB(255, 0, 0),
  36.     Health_Color = true,
  37.     Team_Check = true
  38. }
  39.  
  40. local RadarBackground = NewCircle(0.9, RadarInfo.RadarBack, RadarInfo.Radius, true, 1)
  41. RadarBackground.Visible = true
  42. RadarBackground.Position = RadarInfo.Position
  43.  
  44. local RadarBorder = NewCircle(0.75, RadarInfo.RadarBorder, RadarInfo.Radius, false, 3)
  45. RadarBorder.Visible = true
  46. RadarBorder.Position = RadarInfo.Position
  47.  
  48. local function GetRelative(pos)
  49.     local char = Player.Character
  50.     if char ~= nil and char.PrimaryPart ~= nil then
  51.         local pmpart = char.PrimaryPart
  52.         local camerapos = Vector3.new(Camera.CFrame.Position.X, pmpart.Position.Y, Camera.CFrame.Position.Z)
  53.         local newcf = CFrame.new(pmpart.Position, camerapos)
  54.         local r = newcf:PointToObjectSpace(pos)
  55.         return r.X, r.Z
  56.     else
  57.         return 0, 0
  58.     end
  59. end
  60.  
  61. local function PlaceDot(plr)
  62.     local PlayerDot = NewCircle(1, RadarInfo.PlayerDot, 3, true, 1)
  63.  
  64.     local function Update()
  65.         local c
  66.         c = game:service("RunService").RenderStepped:Connect(function()
  67.             local char = plr.Character
  68.             if char and char:FindFirstChildOfClass("Humanoid") and char.PrimaryPart ~= nil and char:FindFirstChildOfClass("Humanoid").Health > 0 then
  69.                 local hum = char:FindFirstChildOfClass("Humanoid")
  70.                 local scale = RadarInfo.Scale
  71.                 local relx, rely = GetRelative(char.PrimaryPart.Position)
  72.                 local newpos = RadarInfo.Position - Vector2.new(relx * scale, rely * scale)
  73.  
  74.                 if (newpos - RadarInfo.Position).magnitude < RadarInfo.Radius - 2 then
  75.                     PlayerDot.Radius = 3
  76.                     PlayerDot.Position = newpos
  77.                     PlayerDot.Visible = true
  78.                 else
  79.                     local dist = (RadarInfo.Position - newpos).magnitude
  80.                     local calc = (RadarInfo.Position - newpos).unit * (dist - RadarInfo.Radius)
  81.                     local inside = Vector2.new(newpos.X + calc.X, newpos.Y + calc.Y)
  82.                     PlayerDot.Radius = 2
  83.                     PlayerDot.Position = inside
  84.                     PlayerDot.Visible = true
  85.                 end
  86.  
  87.                 PlayerDot.Color = RadarInfo.PlayerDot
  88.                 if RadarInfo.Team_Check then
  89.                     if plr.TeamColor == Player.TeamColor then
  90.                         PlayerDot.Color = RadarInfo.Team
  91.                     else
  92.                         PlayerDot.Color = RadarInfo.Enemy
  93.                     end
  94.                 end
  95.  
  96.                 if RadarInfo.Health_Color then
  97.                     PlayerDot.Color = HealthBarLerp(hum.Health / hum.MaxHealth)
  98.                 end
  99.             else
  100.                 PlayerDot.Visible = false
  101.                 if Players:FindFirstChild(plr.Name) == nil then
  102.                     PlayerDot:Remove()
  103.                     c:Disconnect()
  104.                 end
  105.             end
  106.         end)
  107.     end
  108.     coroutine.wrap(Update)()
  109. end
  110.  
  111. for _, v in pairs(Players:GetChildren()) do
  112.     if v.Name ~= Player.Name then
  113.         PlaceDot(v)
  114.     end
  115. end
  116.  
  117. local function NewLocalDot()
  118.     local d = Drawing.new("Triangle")
  119.     d.Visible = true
  120.     d.Thickness = 1
  121.     d.Filled = true
  122.     d.Color = RadarInfo.LocalPlayerDot
  123.     d.PointA = RadarInfo.Position + Vector2.new(0, -6)
  124.     d.PointB = RadarInfo.Position + Vector2.new(-3, 6)
  125.     d.PointC = RadarInfo.Position + Vector2.new(3, 6)
  126.     return d
  127. end
  128.  
  129. local LocalPlayerDot = NewLocalDot()
  130.  
  131. Players.PlayerAdded:Connect(function(v)
  132.     if v.Name ~= Player.Name then
  133.         PlaceDot(v)
  134.     end
  135.     LocalPlayerDot:Remove()
  136.     LocalPlayerDot = NewLocalDot()
  137. end)
  138.  
  139. coroutine.wrap(function()
  140.     local c
  141.     c = game:service("RunService").RenderStepped:Connect(function()
  142.         if LocalPlayerDot ~= nil then
  143.             LocalPlayerDot.Color = RadarInfo.LocalPlayerDot
  144.             LocalPlayerDot.PointA = RadarInfo.Position + Vector2.new(0, -6)
  145.             LocalPlayerDot.PointB = RadarInfo.Position + Vector2.new(-3, 6)
  146.             LocalPlayerDot.PointC = RadarInfo.Position + Vector2.new(3, 6)
  147.         end
  148.         RadarBackground.Position = RadarInfo.Position
  149.         RadarBackground.Radius = RadarInfo.Radius
  150.         RadarBackground.Color = RadarInfo.RadarBack
  151.  
  152.         RadarBorder.Position = RadarInfo.Position
  153.         RadarBorder.Radius = RadarInfo.Radius
  154.         RadarBorder.Color = RadarInfo.RadarBorder
  155.     end)
  156. end)()
  157.  
  158. local inset = game:service("GuiService"):GetGuiInset()
  159.  
  160. local dragging = false
  161. local offset = Vector2.new(0, 0)
  162.  
  163. UIS.InputBegan:Connect(function(input)
  164.     if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and
  165.        (Vector2.new(Mouse.X, Mouse.Y + inset.Y) - RadarInfo.Position).magnitude < RadarInfo.Radius then
  166.         offset = RadarInfo.Position - Vector2.new(Mouse.X, Mouse.Y)
  167.         dragging = true
  168.     end
  169. end)
  170.  
  171. UIS.InputEnded:Connect(function(input)
  172.     if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
  173.         dragging = false
  174.     end
  175. end)
  176.  
  177. coroutine.wrap(function()
  178.     local dot = NewCircle(1, Color3.fromRGB(255, 255, 255), 3, true, 1)
  179.     local c
  180.     c = game:service("RunService").RenderStepped:Connect(function()
  181.         if (Vector2.new(Mouse.X, Mouse.Y + inset.Y) - RadarInfo.Position).magnitude < RadarInfo.Radius then
  182.             dot.Position = Vector2.new(Mouse.X, Mouse.Y + inset.Y)
  183.             dot.Visible = true
  184.         else
  185.             dot.Visible = false
  186.         end
  187.         if dragging then
  188.             RadarInfo.Position = Vector2.new(Mouse.X, Mouse.Y) + offset
  189.         end
  190.     end)
  191. end)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement