Advertisement
Oscarka65

Universal ESP

May 8th, 2025
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.76 KB | Source Code | 0 0
  1. -- simple ESP for any games that has teams shit. wont work in games where teams are not in GetService:("Players")
  2. -- its quite simple to understand so u can use it for education or smth idk
  3.  
  4.  
  5. local Players = game:GetService("Players")
  6. local player = Players.LocalPlayer
  7. local Teams = game:GetService("Teams")
  8.  
  9. local SETTINGS = {
  10.     TEXT_SIZE = 18,                              
  11.     TEXT_FONT = Enum.Font.GothamBold,            
  12.     TEXT_OUTLINE = true,                          
  13.     TEXT_OUTLINE_COLOR = Color3.new(0, 0, 0),    
  14.     HIGHLIGHT_ENABLED = true                      
  15. }
  16.  
  17. local function createNametag(character, playerName, otherPlayer)
  18.     local head = character:WaitForChild("Head")
  19.    
  20.     local billboard = Instance.new("BillboardGui")
  21.     billboard.Adornee = head
  22.     billboard.Size = UDim2.new(0, 200, 0, 50)
  23.     billboard.StudsOffset = Vector3.new(0, 4, 0)
  24.     billboard.AlwaysOnTop = true
  25.     billboard.Parent = character
  26.  
  27.     local textLabel = Instance.new("TextLabel")
  28.     textLabel.Size = UDim2.new(1, 0, 1, 0)
  29.     textLabel.BackgroundTransparency = 1
  30.     textLabel.Text = playerName
  31.  
  32.     if otherPlayer.Team then
  33.         textLabel.TextColor3 = otherPlayer.Team.TeamColor.Color
  34.     else
  35.         textLabel.TextColor3 = Color3.new(0.5,0.5,0.5)
  36.     end
  37.  
  38.     textLabel.TextSize = SETTINGS.TEXT_SIZE
  39.     textLabel.Font = SETTINGS.TEXT_FONT
  40.    
  41.     if SETTINGS.TEXT_OUTLINE then
  42.         local outline = Instance.new("UIStroke")
  43.         outline.Color = SETTINGS.TEXT_OUTLINE_COLOR
  44.         outline.Thickness = 1.5
  45.         outline.Parent = textLabel
  46.     end
  47.    
  48.     textLabel.Parent = billboard
  49. end
  50.  
  51. local function highlightPlayer(character, otherPlayer) -- player highlight function no way
  52.     if not SETTINGS.HIGHLIGHT_ENABLED then return end
  53.    
  54.     local highlight = Instance.new("Highlight")
  55.     if otherPlayer.Team then
  56.         highlight.FillColor = otherPlayer.Team.TeamColor.Color
  57.     else
  58.         highlight.FillColor = Color3.new(0.5, 0.5, 0.5)
  59.     end
  60.     highlight.OutlineColor = Color3.new(0, 0, 0)
  61.     highlight.Parent = character
  62. end
  63.  
  64. local function processPlayer(otherPlayer)
  65.     if otherPlayer == player then return end
  66.    
  67.     local character = otherPlayer.Character or otherPlayer.CharacterAdded:Wait()
  68.  
  69.  
  70.     highlightPlayer(character, otherPlayer)
  71.     createNametag(character, otherPlayer.Name, otherPlayer)
  72.    
  73.     otherPlayer.CharacterAdded:Connect(function(newChar)
  74.         highlightPlayer(newChar, otherPlayer)
  75.         createNametag(newChar, otherPlayer.Name, otherPlayer)
  76.     end)
  77. end
  78.  
  79. for _, otherPlayer in ipairs(Players:GetPlayers()) do -- check if player respawned
  80.     task.spawn(processPlayer, otherPlayer)
  81. end
  82.  
  83. Players.PlayerAdded:Connect(processPlayer) -- if player joins it will work ez
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement