Messi33536086

Untitled

Nov 12th, 2025
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.81 KB | None | 0 0
  1. local Esp = {}
  2. local Players = game:GetService("Players")
  3. local LocalPlayer = Players.LocalPlayer
  4. local highlights = {}
  5. Esp.Enabled = true
  6. Esp.Transparency = 0.6
  7. Esp.Outline = true
  8. Esp.CurrentColor = "Red"
  9. Esp.Colors = {
  10. Red = Color3.fromRGB(255,0,0),
  11. Green = Color3.fromRGB(0,255,0),
  12. Blue = Color3.fromRGB(0,0,255),
  13. Yellow = Color3.fromRGB(255,255,0),
  14. Purple = Color3.fromRGB(170,0,255),
  15. Orange = Color3.fromRGB(255,165,0),
  16. White = Color3.fromRGB(255,255,255),
  17. Black = Color3.fromRGB(0,0,0),
  18. Cyan = Color3.fromRGB(0,255,255),
  19. Magenta = Color3.fromRGB(255,0,255),
  20. Pink = Color3.fromRGB(255,192,203),
  21. Lime = Color3.fromRGB(0,255,0),
  22. Gray = Color3.fromRGB(128,128,128),
  23. Brown = Color3.fromRGB(139,69,19),
  24. Gold = Color3.fromRGB(255,215,0)
  25. }
  26.  
  27. local function createHighlight(player)
  28. if not player.Character then return end
  29. if highlights[player] then highlights[player]:Destroy() end
  30. local hi = Instance.new("Highlight")
  31. hi.Name = "ESPHighlight"
  32. hi.Adornee = player.Character
  33. hi.Parent = player.Character
  34. hi.FillTransparency = Esp.Transparency
  35. hi.OutlineTransparency = Esp.Outline and 0 or 1
  36. hi.FillColor = Esp.Colors[Esp.CurrentColor] or Color3.fromRGB(255,0,0)
  37. hi.OutlineColor = Color3.fromRGB(255,255,255)
  38. highlights[player] = hi
  39. end
  40.  
  41. local function removeHighlight(player)
  42. if highlights[player] then
  43. highlights[player]:Destroy()
  44. highlights[player] = nil
  45. end
  46. end
  47.  
  48. local function updateAll()
  49. for _,p in pairs(Players:GetPlayers()) do
  50. if p ~= LocalPlayer then
  51. if p.Character and Esp.Enabled then createHighlight(p) end
  52. end
  53. end
  54. end
  55.  
  56. function Esp:CreateEsp(name,color,updateable)
  57. Esp.CurrentColor = color or "Red"
  58. for _,p in pairs(Players:GetPlayers()) do
  59. if p ~= LocalPlayer then
  60. if p.Character then createHighlight(p) end
  61. if updateable then
  62. p.CharacterAdded:Connect(function() if Esp.Enabled then createHighlight(p) end end)
  63. p.CharacterRemoving:Connect(function() removeHighlight(p) end)
  64. end
  65. end
  66. end
  67. if updateable then
  68. Players.PlayerAdded:Connect(function(p)
  69. if p ~= LocalPlayer then
  70. p.CharacterAdded:Connect(function() if Esp.Enabled then createHighlight(p) end end)
  71. p.CharacterRemoving:Connect(function() removeHighlight(p) end)
  72. end
  73. end)
  74. Players.PlayerRemoving:Connect(function(p) removeHighlight(p) end)
  75. end
  76. end
  77.  
  78. function Esp:RemoveAll()
  79. for p,_ in pairs(highlights) do
  80. removeHighlight(p)
  81. end
  82. end
  83.  
  84. function Esp:ChangeColor(color)
  85. Esp.CurrentColor = color or Esp.CurrentColor
  86. updateAll()
  87. end
  88.  
  89. function Esp:Set(state)
  90. Esp.Enabled = state
  91. if not state then self:RemoveAll() else updateAll() end
  92. end
  93.  
  94. function Esp:SetTransparency(value)
  95. Esp.Transparency = value or Esp.Transparency
  96. updateAll()
  97. end
  98.  
  99. function Esp:SetOutline(state)
  100. Esp.Outline = state
  101. updateAll()
  102. end
  103.  
  104. return Esp
Advertisement
Add Comment
Please, Sign In to add comment