Hey, I have recently been trying to make a simple 3rd person shooter in a simplistic style, everything was going swimmingly until I tried to make a health-bar script. I have pulled my hair out and just dont know what to do, normally i try to work things out myself before posting on any forum, but here is the script:

function healthbar(ENTITY* ent, var healthheight, var maxhealth)
{
VECTOR* temp;
while(1)
{
vec_set(temp, ent.x);
vec_to_screen(temp, camera);

PANEL* healthbar =
{
window(temp.x, temp.y, 20, 5, "windowhealth.png", ent.skill1 / maxhealth * 40, NULL);
flags = SHOW;
}

wait(1);
}




Thanks in advance.


One day there will be an unfixable bug,
That day is not today.