Advertisement
1DollarH4ck

tracers

Mar 2nd, 2024 (edited)
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local Camera = game:GetService("Workspace").CurrentCamera
  4. local ESPs = {}
  5.  
  6. local function CreateESP(player)
  7. if player.Character and Camera then
  8. local character = player.Character
  9. local esp = {}
  10.  
  11. for _, part in ipairs(character:GetDescendants()) do
  12. if part:IsA("BasePart") then
  13. local espPart = Instance.new("BoxHandleAdornment")
  14. espPart.Adornee = part
  15. espPart.Size = part.Size
  16. espPart.Color3 = Color3.new(1, 0, 0) -- Red color
  17. espPart.Transparency = 0.5 -- 50% transparency
  18. espPart.AlwaysOnTop = true
  19. espPart.ZIndex = 5
  20. espPart.Parent = part
  21.  
  22. table.insert(esp, espPart)
  23. end
  24. end
  25.  
  26. ESPs[player] = esp
  27. end
  28. end
  29.  
  30. local function RemoveESP(player)
  31. local esp = ESPs[player]
  32. if esp then
  33. for _, part in ipairs(esp) do
  34. part:Destroy()
  35. end
  36. ESPs[player] = nil
  37. end
  38. end
  39.  
  40. local function UpdateESP(player)
  41. if player.Character and Camera then
  42. local character = player.Character
  43. local esp = ESPs[player]
  44.  
  45. if esp then
  46. for _, part in ipairs(character:GetDescendants()) do
  47. if part:IsA("BasePart") then
  48. local espPart = esp[_]
  49. if espPart then
  50. espPart.Size = part.Size
  51. espPart.Position = part.Position
  52. end
  53. end
  54. end
  55. end
  56. end
  57. end
  58.  
  59. local function UpdateAllESP()
  60. for player, _ in pairs(ESPs) do
  61. UpdateESP(player)
  62. end
  63. end
  64.  
  65. local function RenderStep()
  66. UpdateAllESP()
  67. end
  68.  
  69. local function PlayerAdded(player)
  70. player.CharacterAdded:Connect(function(character)
  71. CreateESP(player)
  72. end)
  73. player.CharacterRemoving:Connect(function(character)
  74. RemoveESP(player)
  75. end)
  76. end
  77.  
  78. Players.PlayerAdded:Connect(PlayerAdded)
  79. Players.PlayerRemoving:Connect(function(player)
  80. RemoveESP(player)
  81. end)
  82.  
  83. for _, player in ipairs(Players:GetPlayers()) do
  84. PlayerAdded(player)
  85. end
  86.  
  87. RunService.RenderStepped:Connect(RenderStep)
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement