• Text above ShopNPC
    20 replies, posted
Hey, I'm trying to put a text above my npc, his name. But I don't know how to do it :/ I try function ENT:Draw with cam.3d2d, but doesn't work. Someone know how to do that? thank.
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexedb0.html[/url]
[QUOTE=Didileking;40820536]I try function ENT:Draw with cam.3d2d, but doesn't work.[/QUOTE]
[QUOTE=Didileking;40825100][/QUOTE]Show us your attempted coding at it. You might have done something wrong.
cl_init.lua [lua]function ENT:Draw() cam.Start3D2D( Vector( 222, -73 , -100 ), Angle(0, 0, 0), 0.25 ) draw.DrawText("AAAAAAAAAAA", "DermaLarge", 2, 2, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER ) cam.End3D2D() end[/lua]
bump
Stop bumping. Replace Vector( 222, -73 , -100 ) with self:GetPos() and look around your entity.
[QUOTE=Robotboy655;40829065]Stop bumping. Replace Vector( 222, -73 , -100 ) with self:GetPos() and look around your entity.[/QUOTE] I bump because my thread was on the second pages.. And I replace Vector( 222, -73, -100 ) by Vector( self:GetPos() ) and doesn't work...
I can help you ^^ Add me on steam reggae59
bump
[QUOTE=Didileking;40841212]bump[/QUOTE] You're so impatient... You'll be lucky to get any help with the amount of patience you have...
[QUOTE=Jongunner;40841282]You're so impatient... You'll be lucky to get any help with the amount of patience you have...[/QUOTE] I'm impatient because i'm stuck. I have to finish my gamemode and i'm really stuck on this bullshit..
I forgot to tell you, client functions are not called on NPCs. ( base_ai )
Personally, it would be alot easier to make a perma textscreen, but ok.
[QUOTE=Robotboy655;40842972]I forgot to tell you, client functions are not called on NPCs. ( base_ai )[/QUOTE] So, how I can have a text above my npc?
Using hooks?
[QUOTE=Robotboy655;40843750]Using hooks?[/QUOTE] And what hook I can use?
[QUOTE=Didileking;40843910]And what hook I can use?[/QUOTE] [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7e79.html"]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7e79.html[/URL]
[QUOTE=brandonj4;40844069][URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7e79.html"]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index7e79.html[/URL][/QUOTE] It's not a hook lol
[lua] hook.Add("PostDrawOpaqueRenderables", "DrawNPCText", function() cam.Start3D2D( self:GetPos(), Angle(0, 0, 0), 0.25 ) draw.DrawText("AAAAAAAAAAA", "DermaLarge", 2, 2, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER ) cam.End3D2D() end) [/lua]
[QUOTE=Gamz365;40846149][lua] hook.Add("PostDrawOpaqueRenderables", "DrawNPCText", function() cam.Start3D2D( self:GetPos(), Angle(0, 0, 0), 0.25 ) draw.DrawText("AAAAAAAAAAA", "DermaLarge", 2, 2, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER ) cam.End3D2D() end) [/lua][/QUOTE] Thank a lot ! :D
Sorry, you need to Log In to post a reply to this thread.