Advertisement
asgargg

Untitled

Jul 29th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.24 KB | None | 0 0
  1. function Visuals.togglePlayerEsp(state)
  2.         Visuals.playerEspToggle = state
  3.         if state then
  4.             return Visuals.playerEsp()
  5.         else
  6.             local d = game:GetService("CoreGui"):FindFirstChild("PlayerEsp") and game:GetService("CoreGui"):FindFirstChild("PlayerEsp"):Destroy()
  7.         end
  8.     end
  9.  
  10.     function Visuals.playerEsp()
  11.         local playerEspFolder = game:GetService("CoreGui"):FindFirstChild("PlayerEsp") or Instance.new("Folder", game:GetService("CoreGui"))
  12.         playerEspFolder.Name = "PlayerEsp"
  13.         local function Create(player)
  14.             if player.Character then
  15.                 local b= Instance.new("BillboardGui", playerEspFolder)
  16.                 b.AlwaysOnTop = true
  17.                 b.ClipsDescendants = false
  18.                 b.Size = UDim2.new(4, 0, 6, 0)
  19.                 b.Adornee = player.Character
  20.                 b.Enabled = true
  21.                 b.Name = player.Name
  22.                 local container= Instance.new("Frame", esp)
  23.  
  24.                 container.Name = "x"
  25.                 container.Size = UDim2.new(1, -2, 1, -2)
  26.                 container.Position = UDim2.new(0, 1, 0, 1)
  27.                 container.BackgroundTransparency = 1
  28.  
  29.                 local inlines = Instance.new("Folder", container)
  30.                 inlines.Name = "z"
  31.  
  32.                 local inline1 = Instance.new("Frame", inlines)
  33.                 inline1.Name = "t"
  34.                 inline1.BorderSizePixel = 0
  35.                 inline1.Size = UDim2.new(0, 1, 1, 0)
  36.  
  37.                 local inline2 = Instance.new("Frame", inlines)
  38.                 inline2.Name = "t"
  39.                 inline2.BorderSizePixel = 0
  40.                 inline2.Position = UDim2.new(1, 0, 0, 0)
  41.                 inline2.Size = UDim2.new(0, -1, 1, 0)
  42.  
  43.                 local inline3 = Instance.new("Frame", inlines)
  44.                 inline3.Name = "t"
  45.                 inline3.BorderSizePixel = 0
  46.                 inline3.Size = UDim2.new(1, 0, 0, 1)
  47.  
  48.                 local inline4 = Instance.new("Frame", inlines)
  49.                 inline4.Name = "Frame"
  50.                 inline4.BorderSizePixel = 0
  51.                 inline4.Position = UDim2.new(0, 0, 1, 0)
  52.                 inline4.Size = UDim2.new(1, 0, 0, -1)
  53.  
  54.                 for k, v in next, inlines:GetChildren() do
  55.                     v.BackgroundColor3 = player.TeamColor.Color
  56.                 end
  57.             end
  58.         end
  59.  
  60.         for i, player in next, game.Players:GetChildren() do
  61.             if player ~= plr and player.Team ~= plr.Team then
  62.                 Create(player)
  63.             end
  64.         end
  65.  
  66.         spawn(
  67.             function()
  68.                 while Visuals.playerEspToggle do
  69.                     for i, player in next, game.Players:GetChildren() do
  70.                         if player ~= plr then
  71.                             if playerEspFolder:FindFirstChild(player.Name) then
  72.                                 playerEspFolder[player.Name]:Destroy()
  73.                             end
  74.                             if player ~= plr and player.Team ~= plr.Team then
  75.                                 Create(player)
  76.                             end
  77.                         end
  78.                     end
  79.                     wait(4)
  80.                 end
  81.             end
  82.         )
  83.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement