Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- location = Instance.new("Folder",game.CoreGui)
- TRANSPARENCY = 0.5
- function checkPart(obj) if (obj:IsA("Part") or obj:IsA("MeshPart")) and obj.Name~="HumanoidRootPart" then return true end end --//Check if the Part is suitable
- function createESP(obj)
- local surface = Instance.new("BoxHandleAdornment",location)
- surface.Adornee = obj --//Creates the SurfaceGui
- surface.AlwaysOnTop = true
- surface.ZIndex = 0
- surface.Transparency = TRANSPARENCY
- surface.Size = Vector3.new(obj.Size.X,obj.Size.Y,obj.Size.Z)
- if game.Players[obj.Parent.Name].Team == game.Players.LocalPlayer.Team then
- surface.Color3 = Color3.fromRGB(0,255,255) --//If in same Team
- else
- surface.Color3 = Color3.fromRGB(255,0,0)
- end
- end
- for i,plr in pairs(game.Workspace.Characters:GetChildren())do
- for i,v in pairs(plr:GetChildren())do
- if checkPart(v) then
- createESP(v)
- end
- end
- end
- game.Workspace.Characters.ChildAdded:Connect(function()
- location:ClearAllChildren()
- for i,plr in pairs(game.Workspace.Characters:GetChildren())do
- for i,v in pairs(plr:GetChildren())do
- if checkPart(v) then
- createESP(v)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement