ExluZive

Roblox Esp nickname script

Nov 1st, 2023
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.58 KB | Gaming | 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("Head")
  9.  
  10.     local text = Drawing.new("Text")
  11.     text.Visible = false
  12.     text.Center = true
  13.     text.Outline = false
  14.     text.Font = 3
  15.     text.Size = 16.16
  16.     text.Color = Color3.new(170,170,170)
  17.  
  18.     local conection
  19.     local conection2
  20.     local conection3
  21.  
  22.     local function dc()
  23.         text.Visible = false
  24.         text:Remove()
  25.         if conection then
  26.             conection:Disconnect()
  27.             conection = nil
  28.         end
  29.         if conection2 then
  30.             conection2:Disconnect()
  31.             conection2 = nil
  32.         end
  33.         if conection3 then
  34.             conection3:Disconnect()
  35.             conection3 = nil
  36.         end
  37.     end
  38.  
  39.     conection2 = cr.AncestryChanged:Connect(function(_,parent)
  40.         if not parent then
  41.             dc()
  42.         end
  43.     end)
  44.  
  45.     conection3 = h.HealthChanged:Connect(function(v)
  46.         if (v<=0) or (h:GetState() == Enum.HumanoidStateType.Dead) then
  47.             dc()
  48.         end
  49.     end)
  50.  
  51.     conection = 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 - 27)
  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)
Tags: Roblox Script esp
Add Comment
Please, Sign In to add comment