player esp

This commit is contained in:
edshot99 2024-12-18 22:38:34 -06:00
parent bab5f3c375
commit 9243870286

View File

@ -0,0 +1,31 @@
local DrawTextFont = "BudgetLabel"
local plys = player.GetAll()
timer.Create("edshot_esp_findplys", 3, 0, function() plys = player.GetAll() end)
hook.Add("PostDrawHUD", "edshot_esp_PostDrawHUD", function()
for _, ply in pairs(plys) do
if (not IsValid(ply)) or (ply == LocalPlayer()) then continue end
local plyColor = Color(255, 255, 255)
if (not ply:Alive()) then plyColor = Color(255, 0, 0) end
local plyPosition = ply:GetPos():ToScreen()
draw.DrawText(ply:GetName(), DrawTextFont, plyPosition.x, plyPosition.y, plyColor)
draw.DrawText(ply:Health(), DrawTextFont, plyPosition.x, plyPosition.y + 15, plyColor)
draw.DrawText(ply:Armor(), DrawTextFont, plyPosition.x + 30, plyPosition.y + 15, plyColor)
draw.DrawText(math.Round(LocalPlayer():GetPos():Distance(ply:GetPos()), 0), DrawTextFont, plyPosition.x + 60, plyPosition.y + 15, plyColor)
end
end)
hook.Add("PostDrawOpaqueRenderables", "edshot_esp_PostDrawOpaqueRenderables", function(bDrawingDepth, bDrawingSkybox, isDraw3DSkybox)
for _, ply in pairs(plys) do
if (not IsValid(ply)) or (ply == LocalPlayer()) then continue end
local plyColor = Color(0, 255, 0)
if (not ply:Alive()) then plyColor = Color(255, 0, 0) end
render.DrawWireframeBox(ply:GetPos(), ply:GetAngles(), ply:OBBMins(), ply:OBBMaxs(), plyColor)
end
end)