Custom HUD?

Is it possible to make your own hud for sandbox?

Yes, via gamemode. An example would be a basic one derived to Sandbox.

Not necessarily, you can hook to HUDPaint.

Uhh, what?

You can make your own HUD, use the hook HUDPaint.

[editline]08:19PM[/editline]

Damn ninjas.

That too.

An example function:



function NewHUD()

local health = LocalPlayer():Health() / 100

draw.RoundedBox( 0, 5, 5, ( 200 * health ) + 0, 3, Color( 190, 0, 0, 255 ) );

end
hook.Add( "HUDPaint", "NewHUD", NewHUD );


i dont know antthing about lua but can sombody make me a hud that has a simple health bar so i can get started on it?

There is a full tutorial on the wiki, duh

link?

Jesus christ. I just gave you an example, Wobbier.

[lua]
function NewHUD()

local health = LocalPlayer():Health() / 100

draw.RoundedBox( 0, 5, 5, ( 200 * health ) + 0, 3, Color( 190, 0, 0, 255 ) );

end
hook.Add( “HUDPaint”, “NewHUD”, NewHUD );
[/lua]

That’s a simple healthbar.

ok i told u i dont know anything about lua u still didnt tell me where to put it