Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local user_input_service = game:GetService('UserInputService')
- local plr = game.Players.LocalPlayer
- local players = {}
- local debounce = true
- local teammates = false
- function add_esp(head)
- local billboard_gui = Instance.new('BillboardGui')
- billboard_gui.Parent = head
- billboard_gui.Name = 'esp'
- billboard_gui.AlwaysOnTop = true
- billboard_gui.Size = UDim2.new(1, 0, 1, 0)
- billboard_gui.ResetOnSpawn = false
- local text_label = Instance.new('TextLabel')
- text_label.Parent = billboard_gui
- text_label.Name = 'frame'
- text_label.Size = UDim2.new(1, 0, 1, 0)
- text_label.BackgroundColor3 = Color3.new(0, 255, 0)
- text_label.Text = ''
- end
- function enable_esp()
- debounce = false
- while not debounce do
- for _, v in pairs(game.Players:GetChildren()) do
- if v ~= plr then
- if v.Team ~= plr.Team or teammates == true then
- if game.Workspace:FindFirstChild(v.Name) then
- local char = v.Character
- local health = char.Health
- if health.Value ~= 0 then
- if not char.Head:FindFirstChild('esp') then
- add_esp(char.Head)
- end
- end
- health.Changed:Connect(function()
- if health.Value == 0 then
- if char.Head:FindFirstChild('esp') then
- char.Head.esp:Remove()
- end
- end
- end)
- end
- end
- end
- end
- wait(5)
- end
- end
- function disable_esp()
- debounce = true
- for _, v in pairs(game.Players:GetChildren()) do
- if game.Workspace:FindFirstChild(v.Name) then
- if v.Character.Head:FindFirstChild('esp') then
- v.Character.Head.esp:Remove()
- end
- end
- end
- end
- user_input_service.InputBegan:Connect(function(input_object)
- if input_object.KeyCode == Enum.KeyCode.E then
- if debounce then
- enable_esp()
- else
- disable_esp()
- end
- elseif input_object.KeyCode == Enum.KeyCode.T then
- if teammates == false then
- teammates = true
- else
- teammates = false
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement