So I am trying to make it where when you look at the entity (he_tank) it prints something, of course after fixing this I will make it draw something.
So I tried this: and its not working.
[CODE]
hook.Add('HUDPaint','PaintOnHudForTimer',function()
eyepos = LocalPlayer():GetEyeTrace()
if eyepos.Entity:GetClass() == 'he_tank' then
print('Hello')
end
end)
[/CODE]
Btw when you help me fix this could you also explain to make how to print out a timers progress, like making a timer for 30 seconds and drawing the timer countdown.
Looks fine to me -- make sure you add validity checks on LocalPlayer and eyepos.Entity to prevent NULL entity errors. You can check a timer's progress with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/timer/TimeLeft]timer.TimeLeft[/url]
Oh yeah lol, I guess I fixed it last night lol, sorry ive been busy all day xD. One more thing, I haven't coded in a while so I forgot a little something. How do I use AND in a if statement xD. So I tried (if VARIABLE and VARIABLE2 > 0 then. I'm trying to make it where both of them has to be greater than zero to pass. ITs not working like that. Please help if you can thx!
if (VARIABLE > 0 and VARIABLE2 > 0) then
[quote][IMG]https://vgy.me/pPl65N.png[/IMG][/quote]
Ask here next time: [url]https://facepunch.com/forums/65[/url]
Sorry, you need to Log In to post a reply to this thread.