ESP

Posts 1–10 of 10 · Page 1 of 1
ESP
So I was wandering how to make my esp not get bigger the farther you get from it.

This is my code so far

Code:
local function nameESP()
	for k, v in pairs( player.GetAll() ) do
		local pos = ( v:GetShootPos() + Vector( 0, 0, 50 ) ):ToScreen()
		draw.DrawText( v:Nick(), "Default", pos.x, pos.y, Color( 255, 255, 255, 255 ), 1 )
		draw.DrawText( v:Health(), "Default", pos.x, pos.y + 60, Color( 255, 255, 255, 255 ), 1 )
	end
end
hook.Add( "HUDPaint", "nameesp", nameESP )
The font stays the exact same size at whatever you set it at.
When I back up the position changes
Quote Originally Posted by meme420 View Post
When I back up the position changes
Well, no shit...

Use GetPos() instead of GetShootPos(). You draw ESP in a very odd way...

Try this:
Code:
hook.Add("HUDPaint", "nameESP", function()
  for k,v in pairs(player.GetAll()) do
    local pos = v:GetPos():ToScreen();
    
    draw.SimpleText( v:Nick(), "Default", pos.x, pos.y, team.GetColor(v:Team()), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER );
    draw.SimpleText( v:Health(), "Default", pos.x, pos.y + 60, team.GetColor(v:Team()), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER );
  end
end)
I swayed away from using a static color, because that's disgusting. Chances are, you're going to playing on a DarkRP server like everyone else, so all white text would be confusing.
Quote Originally Posted by Chief Gooby View Post
Use GetPos() instead of GetShootPos(). You draw ESP in a very odd way...
There's nothing wrong with the method he's using. It's just personal preference.
Quote Originally Posted by meme420 View Post
So I was wandering how to make my esp not get bigger the farther you get from it.

This is my code so far

Code:
local function nameESP()
	for k, v in pairs( player.GetAll() ) do
		local pos = ( v:GetShootPos() + Vector( 0, 0, 50 ) ):ToScreen()
		draw.DrawText( v:Nick(), "Default", pos.x, pos.y, Color( 255, 255, 255, 255 ), 1 )
		draw.DrawText( v:Health(), "Default", pos.x, pos.y + 60, Color( 255, 255, 255, 255 ), 1 )
	end
end
hook.Add( "HUDPaint", "nameesp", nameESP )
make sure you compensate for the fact that the text will still draw on players even after dieing

everything is spaced out for my personal preference

Code:
local function nameESP()

	for k, v in pairs( player.GetAll() ) do

		local pos = ( v:GetShootPos() + Vector( 0, 0, 50 ) ):ToScreen()
                
                if v:Alive() and v:Health() > 0 then 

		    draw.DrawText( v:Nick(), "Default", pos.x, pos.y, Color( 255, 255, 255, 255 ), 1 )
		    draw.DrawText( v:Health(), "Default", pos.x, pos.y + 60, Color( 255, 255, 255, 255 ), 1 )

                end

	end

end

hook.Add( "HUDPaint", "nameesp", nameESP )
Thanks for the help lol, I didn't expect people to actually help
Has your question been solved? @meme420
yea u can close this shit
Quote Originally Posted by meme420 View Post
yea u can close this shit
he committed suicide earlier today so he won't be able to close the thread.
Posts 1–10 of 10 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us