VenoxComeback

newesp

Apr 16th, 2025 (edited)
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3.  
  4. -- Store highlights for cleanup
  5. local highlights = {}
  6.  
  7. -- Function to create highlight
  8. local function highlightPlayer(player)
  9. if player == LocalPlayer then return end
  10.  
  11. player.CharacterAdded:Connect(function(char)
  12. local highlight = Instance.new("Highlight")
  13. highlight.FillColor = Color3.fromRGB(255, 100, 100) -- light red
  14. highlight.OutlineColor = Color3.new(1, 1, 1) -- white outline
  15. highlight.FillTransparency = 0.3
  16. highlight.OutlineTransparency = 0
  17. highlight.Adornee = char
  18. highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop -- shows through walls
  19. highlight.Parent = game.CoreGui -- put in CoreGui so it doesn't get deleted by scripts
  20.  
  21. highlights[player] = highlight
  22. end)
  23.  
  24. -- If character already exists
  25. if player.Character then
  26. local highlight = Instance.new("Highlight")
  27. highlight.FillColor = Color3.fromRGB(255, 100, 100)
  28. highlight.OutlineColor = Color3.new(1, 1, 1)
  29. highlight.FillTransparency = 0.3
  30. highlight.OutlineTransparency = 0
  31. highlight.Adornee = player.Character
  32. highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  33. highlight.Parent = game.CoreGui
  34.  
  35. highlights[player] = highlight
  36. end
  37. end
  38.  
  39. -- Add to all current players
  40. for _, player in pairs(Players:GetPlayers()) do
  41. highlightPlayer(player)
  42. end
  43.  
  44. -- Add to new players
  45. Players.PlayerAdded:Connect(function(player)
  46. highlightPlayer(player)
  47. end)
  48.  
  49. -- Remove highlights on leave
  50. Players.PlayerRemoving:Connect(function(player)
  51. if highlights[player] then
  52. highlights[player]:Destroy()
  53. highlights[player] = nil
  54. end
  55. end)
  56.  
Add Comment
Please, Sign In to add comment