MaxproGlitcher

Radar en devollpement .lua

Dec 19th, 2024 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local LocalPlayer = Players.LocalPlayer
  4.  
  5. local gui = Instance.new("ScreenGui", LocalPlayer:WaitForChild("PlayerGui"))
  6.  
  7. local function createUIElement(class, properties, parent)
  8. local element = Instance.new(class)
  9. for prop, value in pairs(properties) do
  10. element[prop] = value
  11. end
  12. element.Parent = parent
  13. return element
  14. end
  15.  
  16. local radarFrame = createUIElement("Frame", {
  17. AnchorPoint = Vector2.new(0.5, 0.5),
  18. Position = UDim2.new(0.85, 0, 0.75, 0),
  19. Size = UDim2.new(0, 250, 0, 250),
  20. BackgroundColor3 = Color3.new(0, 0, 0),
  21. BackgroundTransparency = 0.5,
  22. BorderSizePixel = 0,
  23. ClipsDescendants = true
  24. }, gui)
  25.  
  26. createUIElement("UICorner", { CornerRadius = UDim.new(1, 0) }, radarFrame)
  27.  
  28. -- Contour rouge vif pour le cercle
  29. createUIElement("UIStroke", {
  30. Color = Color3.new(1, 0, 0), -- Rouge vif
  31. Thickness = 3, -- Épaisseur du contour
  32. Transparency = 0 -- Pas de transparence
  33. }, radarFrame)
  34.  
  35. local blipCache = {}
  36.  
  37. local function updateRadar()
  38. local localChar = LocalPlayer.Character
  39. local localRoot = localChar and localChar:FindFirstChild("HumanoidRootPart")
  40. if not localRoot then return end
  41.  
  42. local activePlayers = {}
  43.  
  44. for _, player in ipairs(Players:GetPlayers()) do
  45. local root = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
  46. if root then
  47. local dist = (root.Position - localRoot.Position).Magnitude
  48. if dist <= 100 or player == LocalPlayer then
  49. local relPos = (root.Position - localRoot.Position)
  50. local x, z = relPos.X, relPos.Z
  51. local blip = blipCache[player]
  52.  
  53. if not blip then
  54. blip = {
  55. frame = createUIElement("Frame", {
  56. AnchorPoint = Vector2.new(0.5, 0.5),
  57. Size = UDim2.new(0, 10, 0, 10),
  58. BorderSizePixel = 0,
  59. ZIndex = 2
  60. }, radarFrame),
  61. label = createUIElement("TextLabel", {
  62. AnchorPoint = Vector2.new(0.5, 0),
  63. Size = UDim2.new(0, 50, 0, 15),
  64. BackgroundTransparency = 1,
  65. TextScaled = true,
  66. TextColor3 = Color3.new(1, 0, 0), -- Nom en rouge
  67. TextStrokeTransparency = 0.8,
  68. ZIndex = 3,
  69. Font = Enum.Font.SourceSans,
  70. Text = player.Name
  71. }, radarFrame)
  72. }
  73. createUIElement("UICorner", { CornerRadius = UDim.new(1, 0) }, blip.frame)
  74. blipCache[player] = blip
  75. end
  76.  
  77. -- Si c'est le joueur local, son point est noir
  78. blip.frame.BackgroundColor3 = player == LocalPlayer and Color3.new(0, 0, 0) or Color3.new(1, 0, 0)
  79. blip.frame.Position = UDim2.new(0.5, x, 0.5, z)
  80. blip.label.Position = UDim2.new(0.5, x, 0.5, z - 15)
  81. activePlayers[player] = true
  82. end
  83. end
  84. end
  85.  
  86. for player, blip in pairs(blipCache) do
  87. if not activePlayers[player] then
  88. blip.frame:Destroy()
  89. blip.label:Destroy()
  90. blipCache[player] = nil
  91. end
  92. end
  93. end
  94.  
  95. RunService.RenderStepped:Connect(updateRadar)
  96.  
Advertisement
Add Comment
Please, Sign In to add comment