how can i get it to work for my npc? the example is for player
[QUOTE=TrippleT;46192875]how can i get it to work for my npc? the example is for player[/QUOTE]
[url]https://github.com/FPtje/DarkRP/blob/master/entities/entities/gunlab/cl_init.lua[/url]
i tryed that and nothing comes up i replaced self: with ent: [CODE]hook.Add("PostDrawOpaqueRenderables", "buble", function()
for _, ent in pairs(ents.FindByClass("npc_jeffery1")) do
local Pos = ent:GetPos()
local Ang = ent:GetAngles()
surface.SetFont("HUDNumber5")
local text = "hello"
local TextWidth = surface.GetTextSize(text)
Ang:RotateAroundAxis(Ang:Forward(), 90)
local TextAng = Ang
TextAng:RotateAroundAxis(TextAng:Right(), CurTime() * -180)
cam.Start3D2D(Pos + Ang:Right() * -30, TextAng, 0.2)
draw.WordBox(2, -TextWidth*0.5 + 5, -30, text, "HUDNumber5", Color(140, 0, 0, 100), Color(255,255,255,255))
cam.End3D2D()
end
end)[/CODE]
[editline]9th October 2014[/editline]
ok i got it to work [CODE]hook.Add("PostDrawOpaqueRenderables", "buble", function()
for _, ent in pairs(ents.FindByClass("npc_jeffery1")) do
ent:DrawModel()
local Pos = ent:GetPos()
local Ang = ent:GetAngles()
surface.SetFont("HUDNumber5")
local text = "hello"
local TextWidth = surface.GetTextSize(text)
Ang:RotateAroundAxis(Ang:Forward(), 90)
local TextAng = Ang
TextAng:RotateAroundAxis(TextAng:Right(), CurTime() * -180)
cam.Start3D2D(Pos + Ang:Right() * -75, TextAng, 0.2)
draw.WordBox(2, -TextWidth*0.5 + 5, -30, text, "HUDNumber5", Color(140, 0, 0, 100), Color(255,255,255,255))
cam.End3D2D()
end
end)[/CODE]
[editline]9th October 2014[/editline]
how can i make the text in my jobinfo label to stop going off the side? i want the text to go down and everything i try makes it go off the side [IMG]http://i.imgur.com/l88iaGJ.png[/IMG]
Sorry, you need to Log In to post a reply to this thread.