Advertisement
ThemodmenuX123456789

Name Esp2

Jan 4th, 2023
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. local c = workspace.CurrentCamera
  2. local ps = game:GetService("Players")
  3. local lp = ps.LocalPlayer
  4. local rs = game:GetService("RunService")
  5.  
  6. local function esp(p,cr)
  7. local h = cr:WaitForChild("Humanoid")
  8. local hrp = cr:WaitForChild("HumanoidRootPart")
  9.  
  10. local text = Drawing.new("Text")
  11. text.Visible = false
  12. text.Center = true
  13. text.Outline = true
  14. text.Font = 2
  15. text.Color = Color3.fromRGB(255,255,255)
  16. text.Size = 20
  17.  
  18. local c1
  19. local c2
  20. local c3
  21.  
  22. local function dc()
  23. text.Visible = false
  24. text:Remove()
  25. if c1 then
  26. c1:Disconnect()
  27. c1 = nil
  28. end
  29. if c2 then
  30. c2:Disconnect()
  31. c2 = nil
  32. end
  33. if c3 then
  34. c3:Disconnect()
  35. c3 = nil
  36. end
  37. end
  38.  
  39. c2 = cr.AncestryChanged:Connect(function(_,parent)
  40. if not parent then
  41. dc()
  42. end
  43. end)
  44.  
  45. c3 = h.HealthChanged:Connect(function(v)
  46. if (v<=0) or (h:GetState() == Enum.HumanoidStateType.Dead) then
  47. dc()
  48. end
  49. end)
  50.  
  51. c1 = rs.RenderStepped:Connect(function()
  52. local hrp_pos,hrp_onscreen = c:WorldToViewportPoint(hrp.Position)
  53. if hrp_onscreen then
  54. text.Position = Vector2.new(hrp_pos.X, hrp_pos.Y)
  55. text.Text = p.Name
  56. text.Visible = true
  57. else
  58. text.Visible = false
  59. end
  60. end)
  61. end
  62.  
  63. local function p_added(p)
  64. if p.Character then
  65. esp(p,p.Character)
  66. end
  67. p.CharacterAdded:Connect(function(cr)
  68. esp(p,cr)
  69. end)
  70. end
  71.  
  72. for i,p in next, ps:GetPlayers() do
  73. if p ~= lp then
  74. p_added(p)
  75. end
  76. end
  77.  
  78. ps.PlayerAdded:Connect(p_added)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement