Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local Camera = workspace.CurrentCamera
- -- Function to create ESP box
- function createBox(player)
- local box = Instance.new("BoxHandleAdornment")
- box.Size = player.Character.HumanoidRootPart.Size + Vector3.new(0.1, 0.1, 0.1)
- box.Color3 = Color3.fromRGB(255, 0, 0)
- box.AlwaysOnTop = true
- box.ZIndex = 5
- box.Transparency = 0.5
- box.Adornee = player.Character.HumanoidRootPart
- box.Parent = player.Character.HumanoidRootPart
- end
- -- Loop through all players and create an ESP box for each one
- for i, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer and player.Character then
- createBox(player)
- end
- end
- -- Update ESP box positions every frame
- game:GetService("RunService").RenderStepped:connect(function()
- for i, player in ipairs(Players:GetPlayers()) do
- if player ~= Players.LocalPlayer and player.Character then
- local onScreen, position = Camera:WorldToViewportPoint(player.Character.HumanoidRootPart.Position)
- local box = player.Character.HumanoidRootPart:FindFirstChildOfClass("BoxHandleAdornment")
- if onScreen and box then
- box.Size = player.Character.HumanoidRootPart.Size + Vector3.new(0.1, 0.1, 0.1)
- box.Color3 = Color3.fromRGB(255, 0, 0)
- box.Transparency = 0.5
- box.CFrame = CFrame.new(position)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement