• Derma Health Bar?
    15 replies, posted
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.
[QUOTE=thejjokerr;22017445][URL]http://wiki.garrysmod.com/?title=DColorCube[/URL] can be used for this.[/QUOTE] I think he means your actual Health in the derma frame, not creating a custom one IN a derma frame.
[url]http://wiki.garrysmod.com/?title=Panel.PaintOver[/url] 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. [editline]04:39PM[/editline] actually, wouldnt it just be this? [code]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 [/code] ( 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.
[code] 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 [/code]
[QUOTE=Busymonkey;22026099][code] 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 [/code][/QUOTE] Shouldn't it be LocalPlayer():Health() ?
i defined client in my code so it works thanks for all your guys help!
[QUOTE=sintwin;22026593]Shouldn't it be LocalPlayer():Health() ?[/QUOTE] No, it's better to just define client as LocalPlayer()
[QUOTE=HeavyMtl123;22026857]No, it's better to just define client as LocalPlayer()[/QUOTE] Kk, didn't know that :).
[QUOTE=sintwin;22027152]Kk, didn't know that :).[/QUOTE] Yeah it just saves you having to keep typing out LocalPlayer()
What's the correct way to define? Isent it? 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]
Sorry, you need to Log In to post a reply to this thread.