• Vertical hunger hud
    6 replies, posted
Idk how to make a vertical hunger hud, so lower hunger becomes lower its table falls. that is my hud now, vertical hp, vertical armor. https://files.facepunch.com/forum/upload/149560/0407b662-d556-43a3-8f50-9b4a019ba6a4/image.png Here is the code of my HUD I Need to make a vertical hunger like those. please! local health_bar_height = 110     local health_bar_x = 55     local health_bar_y = 29 local armor_bar_height = 110     local armor_bar_width = 30     local armor_bar_x = 90     local armor_bar_y = 29     local armor_max = 100 local hunger_bar_height = 110 local hunger_bar_width = 30 local hunger_bar_x = 100 local hunger_bar_y = 29 local hunger_max = 100 hook.Add("HUDPaint", "DrawMyHUD", function()     draw.RoundedBox(0, 15, ScrH () - 30 - 109, 30, 109, Color( 89, 23, 23,249))     draw.RoundedBox(0, 15, ScrH() - health_bar_y - health_bar_height / LocalPlayer():GetMaxHealth() * LocalPlayer():Health(), 30, health_bar_height / LocalPlayer():GetMaxHealth() * LocalPlayer():Health(),Color( 210, 57, 43))     draw.RoundedBox(0, armor_bar_x, ScrH() - armor_bar_y - armor_bar_height / armor_max * LocalPlayer():Armor(), armor_bar_width, armor_bar_height / armor_max * LocalPlayer():Armor(), Color(120,120,255)) end)
player:getDarkRPVar("energy")
can you please give me an example code. I am poor at Lua. That is mine, but is error local hunger = math.ceil(LocalPlayer():getDarkRPVar("Energy") or 0)         draw.RoundedBox(0, armor_bar_x, ScrH() - armor_bar_y - armor_bar_height / armor_max hunger*, armor_bar_width, armor_bar_height / armor_max hunger*, Color(120,120,255))
no sense i am poor at lua
local health_bar_height = 110     local health_bar_x = 55     local health_bar_y = 29 local armor_bar_height = 110     local armor_bar_width = 30     local armor_bar_x = 90     local armor_bar_y = 29     local armor_max = 100 local hunger_bar_height = 110 local hunger_bar_width = 30 local hunger_bar_x = 100 local hunger_bar_y = 29 local hunger_max = 100 hook.Add("HUDPaint", "DrawMyHUD", function()     draw.RoundedBox(0, 15, ScrH () - 30 - 109, 30, 109, Color( 89, 23, 23,249))     draw.RoundedBox(0, 15, ScrH() - health_bar_y - health_bar_height / LocalPlayer():GetMaxHealth() * LocalPlayer():Health(), 30, health_bar_height / LocalPlayer():GetMaxHealth() * LocalPlayer():Health(),Color( 210, 57, 43))     draw.RoundedBox(0, armor_bar_x, ScrH() - armor_bar_y - armor_bar_height / armor_max * LocalPlayer():Armor(), armor_bar_width, armor_bar_height / armor_max * LocalPlayer():Armor(), Color(120,120,255)) --------------------------------------------------------------THATS HUNGER WTF IS WRONG WITH THAT??     draw.RoundedBox(0, 15, ScrH() - hunger_bar_y - hunger_bar_height / math.ceil(LocalPlayer():getDarkRPVar("Energy"), 30, hunger_bar_height / math.ceil(LocalPlayer():getDarkRPVar("Energy"),Color( 210, 57, 43)) end) [ERROR] addons/gbeorg_hud/gamemodes/darkrp/gamemode/modules/gbeorghud/cl_hud.lua:112: ')' expected (to close '(' at line 110) near 'end'   1. unknown - addons/gbeorg_hud/gamemodes/darkrp/gamemode/modules/gbeorghud/cl_hud.lua:0
"this is my HUD" "i am poor at lua" it doesn't matter how bad you are at coding, the error is extremely self explanatory. 112: ')' expected (to close '(' at line 110) near 'end' just think it over, every ( needs a )
Sorry, you need to Log In to post a reply to this thread.