easy newbie npc help

Hello i just need to add a name hovering above a npc i created that opens a menu. thats it.

There are many options…

In a draw hook you could:

local _x, _y = ( self:GetPos( ) + Vector( 0, 0, 90 ) ):ToScreen( );

And draw the text using surface commands…

Alternatively, you could use Cam 2d3d and render text above the head, but you’d need to do it in a render hook ( ENT:Draw may work )…

hmm can you elaborate :slight_smile: thnx anyways im good so far


Just look at the example there and see if you can modify it to how you want.

thnx. :slight_smile: i will try to get it working

i’m still having trouble … trying to get a name above the npc :slight_smile: any help would be great

Give us what you have and somebody will get around to fixing it for you

i don’t got much resources tats why i came here.

[editline]27th September 2014[/editline]

surface.CreateFont( “coolvetica”, 64, 500, true, false, “Text64” )
function GM:PostDrawOpaqueRenderables()
for _, ent in pairs(ents.FindByClass(“npcclass”)) do
cam.Start3D2D(ent:GetPos()+Vector(0,0,90), ent:GetAngles() + Angle(0,90,90), 0.1)
draw.SimpleText(“Hello World!”, “Text64”, 0, -90, Color(255,0,0,255), TEXT_ALIGN_CENTER, 1)

i got that from here http://forum.facepunch.com/showthread.php?t=1061784 i put it in my cl_init dosnt seem to work. no errors.

[noparse][lua][/lua][/noparse] tags …


[editline]27th September 2014[/editline]

Bump still need help my bros