• Health Bar Issue
    1 replies, posted
Hello there, I'm having an issue with my health bar for a HUD I'm making. Here's issue https://files.facepunch.com/forum/upload/353385/24f9e6d8-f1ee-4232-ab22-120ccf0854de/image.png And here's my code: draw.RoundedBox(0, 30, ScrH() - 275 / 100 * client:Health(), 30, math.Clamp(client:Health(), 0, (client:Health()/client:GetMaxHealth()) * 100) * 2, Color(255, 0, 0))
When you have problems like this consider the equations that generate arguments to the function you're calling. Let's assume your health bar is 100 pixels tall (aka 1:1 with health). you need x, y, w, h you have a proper x and w y will depend on the height if the player has 20 hp, the bar would appear to go from 20 to 100 on the screen - so y will be health() finally h = (total height - top position) = (100 - y)
Sorry, you need to Log In to post a reply to this thread.