Advertisement
1DollarH4ck

ESP

Apr 15th, 2023
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local Camera = workspace.CurrentCamera
  3.  
  4. -- Function to create ESP box
  5. function createBox(player)
  6. local box = Instance.new("BoxHandleAdornment")
  7. box.Size = player.Character.HumanoidRootPart.Size + Vector3.new(0.1, 0.1, 0.1)
  8. box.Color3 = Color3.fromRGB(255, 0, 0)
  9. box.AlwaysOnTop = true
  10. box.ZIndex = 5
  11. box.Transparency = 0.5
  12. box.Adornee = player.Character.HumanoidRootPart
  13. box.Parent = player.Character.HumanoidRootPart
  14. end
  15.  
  16. -- Loop through all players and create an ESP box for each one
  17. for i, player in ipairs(Players:GetPlayers()) do
  18. if player ~= Players.LocalPlayer and player.Character then
  19. createBox(player)
  20. end
  21. end
  22.  
  23. -- Update ESP box positions every frame
  24. game:GetService("RunService").RenderStepped:connect(function()
  25. for i, player in ipairs(Players:GetPlayers()) do
  26. if player ~= Players.LocalPlayer and player.Character then
  27. local onScreen, position = Camera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
  28. local box = player.Character.HumanoidRootPart:FindFirstChildOfClass("BoxHandleAdornment")
  29. if onScreen and box then
  30. box.Size = player.Character.HumanoidRootPart.Size + Vector3.new(0.1, 0.1, 0.1)
  31. box.Color3 = Color3.fromRGB(255, 0, 0)
  32. box.Transparency = 0.5
  33. box.CFrame = CFrame.new(position)
  34. end
  35. end
  36. end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement