Hi i’m wanting to make a health bar in a derma frame but don’t know if there is a way to draw on the frame or not.
http://wiki.garrysmod.com/?title=DColorCube can be used for this.
I think he means your actual Health in the derma frame, not creating a custom one IN a derma frame.
Would this be useful?
Thanks Busymonkey i think thats just what i need
Yea, you’re gonna have to figure out how to make the HUD into it, yourself though, cause I have no idea.
actually, wouldnt it just be this?
function PANEL:PaintOver() draw.RoundedBox(3, X, Y, 200, 100, Color(51, 58, 51, 255)) draw.SimpleText(client:Health() .. "%", "ScoreboardText", 100, 50, Color(86, 104, 86, 255), 0, 0) end
( X, Y ) being the position cordinates, obviously.
ya i know how to make a health bar already just i wanted it on Derma to be able and move it.
DermaThingi.Paint = function() draw.RoundedBox(3, X, Y, 200, 100, Color(51, 58, 51, 255)) draw.SimpleText(client:Health() .. "%", "ScoreboardText", 100, 50, Color(86, 104, 86, 255), 0, 0) end end
Shouldn’t it be LocalPlayer():Health() ?
i defined client in my code so it works thanks for all your guys help!
No, it’s better to just define client as LocalPlayer()
Kk, didn’t know that :).
Yeah it just saves you having to keep typing out LocalPlayer()
What’s the correct way to define?
local client = LocalPlayer()
or is it the other way around?
[sp]I both the function and the snippet from the Wiki and combined them[/sp]
That seems about right yeah, although I have never done that before I just do LocalPlayer()
To define you do
[lua]local <insert name you want to use instead of LocalPlayer()> = LocalPlayer()[/lua]