Advertisement
Dodikman

Test ESP Arsenal

Jul 1st, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 KB | None | 0 0
  1. local user_input_service = game:GetService('UserInputService')
  2. local plr = game.Players.LocalPlayer
  3. local players = {}
  4. local debounce = true
  5. local teammates = false
  6.  
  7. function add_esp(head)
  8.     local billboard_gui = Instance.new('BillboardGui')
  9.     billboard_gui.Parent = head
  10.     billboard_gui.Name = 'esp'
  11.     billboard_gui.AlwaysOnTop = true
  12.     billboard_gui.Size = UDim2.new(1, 0, 1, 0)
  13.     billboard_gui.ResetOnSpawn = false
  14.     local text_label = Instance.new('TextLabel')
  15.     text_label.Parent = billboard_gui
  16.     text_label.Name = 'frame'
  17.     text_label.Size = UDim2.new(1, 0, 1, 0)
  18.     text_label.BackgroundColor3 = Color3.new(0, 255, 0)
  19.     text_label.Text = ''
  20. end
  21.  
  22. function enable_esp()
  23.     debounce = false
  24.     while not debounce do
  25.         for _, v in pairs(game.Players:GetChildren()) do
  26.             if v ~= plr then
  27.                 if v.Team ~= plr.Team or teammates == true then
  28.                     if game.Workspace:FindFirstChild(v.Name) then
  29.                         local char = v.Character
  30.                         local health = char.Health
  31.                         if health.Value ~= 0 then
  32.                             if not char.Head:FindFirstChild('esp') then
  33.                                 add_esp(char.Head)
  34.                             end
  35.                         end
  36.                         health.Changed:Connect(function()
  37.                             if health.Value == 0 then
  38.                                 if char.Head:FindFirstChild('esp') then
  39.                                     char.Head.esp:Remove()
  40.                                 end
  41.                             end
  42.                         end)
  43.                     end
  44.                 end
  45.             end
  46.         end
  47.         wait(5)
  48.     end
  49. end
  50.  
  51. function disable_esp()
  52.     debounce = true
  53.     for _, v in pairs(game.Players:GetChildren()) do
  54.         if game.Workspace:FindFirstChild(v.Name) then
  55.             if v.Character.Head:FindFirstChild('esp') then
  56.                 v.Character.Head.esp:Remove()
  57.             end
  58.         end
  59.     end
  60. end
  61.  
  62. user_input_service.InputBegan:Connect(function(input_object)
  63.     if input_object.KeyCode == Enum.KeyCode.E then
  64.         if debounce then
  65.             enable_esp()
  66.         else
  67.             disable_esp()
  68.         end
  69.     elseif input_object.KeyCode == Enum.KeyCode.T then
  70.         if teammates == false then
  71.             teammates = true
  72.         else
  73.             teammates = false
  74.         end
  75.     end
  76. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement