Advertisement
RileyCallan

cool esp radar

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