Advertisement
ProHuilonYTZ

chatgpt's esp script requested

Sep 27th, 2024
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.39 KB | None | 0 0
  1. -- ESP Script (Chams, Name, Box, Tracers)
  2.  
  3. local RunService = game:GetService("RunService")
  4. local Players = game:GetService("Players")
  5. local LocalPlayer = Players.LocalPlayer
  6. local Camera = workspace.CurrentCamera
  7.  
  8. -- Settings
  9. local ESPSettings = {
  10.     BoxColor = Color3.fromRGB(255, 0, 0), -- Red box
  11.     NameColor = Color3.fromRGB(255, 255, 255), -- White name
  12.     TracerColor = Color3.fromRGB(0, 255, 0), -- Green tracers
  13.     ChamColor = BrickColor.new("Bright yellow"), -- Yellow chams
  14.     ChamTransparency = 0.7, -- Chams transparency (0 = opaque, 1 = invisible)
  15.     TextSize = 14, -- ESP Name Text Size
  16. }
  17.  
  18. -- Function to create Chams (highlight players through walls)
  19. local function createChams(character)
  20.     for _, part in pairs(character:GetChildren()) do
  21.         if part:IsA("BasePart") then
  22.             local cham = Instance.new("BoxHandleAdornment")
  23.             cham.Size = part.Size
  24.             cham.Adornee = part
  25.             cham.Color = ESPSettings.ChamColor
  26.             cham.Transparency = ESPSettings.ChamTransparency
  27.             cham.ZIndex = 0
  28.             cham.AlwaysOnTop = true
  29.             cham.Parent = part
  30.         end
  31.     end
  32. end
  33.  
  34. -- Function to create ESP (Names, Boxes, Tracers)
  35. local function createESP(player)
  36.     local box = Drawing.new("Square")
  37.     local name = Drawing.new("Text")
  38.     local tracer = Drawing.new("Line")
  39.  
  40.     RunService.RenderStepped:Connect(function()
  41.         if player and player.Character and player.Character:FindFirstChild("HumanoidRootPart") and player ~= LocalPlayer then
  42.             local rootPart = player.Character.HumanoidRootPart
  43.             local pos, onScreen = Camera:WorldToViewportPoint(rootPart.Position)
  44.            
  45.             if onScreen then
  46.                 -- Box ESP
  47.                 box.Visible = true
  48.                 box.Color = ESPSettings.BoxColor
  49.                 box.Thickness = 1
  50.                 box.Transparency = 1
  51.                 box.Size = Vector2.new(2000 / pos.Z, 2500 / pos.Z)
  52.                 box.Position = Vector2.new(pos.X - box.Size.X / 2, pos.Y - box.Size.Y / 2)
  53.  
  54.                 -- Name ESP
  55.                 name.Visible = true
  56.                 name.Text = player.Name
  57.                 name.Size = ESPSettings.TextSize
  58.                 name.Color = ESPSettings.NameColor
  59.                 name.Position = Vector2.new(pos.X, pos.Y - 25)
  60.  
  61.                 -- Tracer ESP
  62.                 tracer.Visible = true
  63.                 tracer.From = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y)
  64.                 tracer.To = Vector2.new(pos.X, pos.Y)
  65.                 tracer.Color = ESPSettings.TracerColor
  66.                 tracer.Thickness = 1
  67.             else
  68.                 box.Visible = false
  69.                 name.Visible = false
  70.                 tracer.Visible = false
  71.             end
  72.         else
  73.             box.Visible = false
  74.             name.Visible = false
  75.             tracer.Visible = false
  76.         end
  77.     end)
  78. end
  79.  
  80. -- Apply ESP to all players
  81. for _, player in pairs(Players:GetPlayers()) do
  82.     if player ~= LocalPlayer then
  83.         createESP(player)
  84.         player.CharacterAdded:Connect(function(character)
  85.             createChams(character)
  86.         end)
  87.     end
  88. end
  89.  
  90. -- Update ESP when a new player joins
  91. Players.PlayerAdded:Connect(function(player)
  92.     player.CharacterAdded:Connect(function(character)
  93.         createChams(character)
  94.         createESP(player)
  95.     end)
  96. end)
  97.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement