Posted By: kholis
how to display entity health status? - 05/26/10 04:31
i want to display health status above each entity head. i used panel to display it, but digits variable cannot be changed. it value always 0.0000
if entity health changed, it will execute this function
Code:
function create_health_panel(){ temp_panel = pan_create("digits(0,0,5.1,*,0,my.health);",2); }
if entity health changed, it will execute this function
Code:
function update_health(){ if(my.state_attacked == true){my.health -= 10;} if(my.state_healed == true){my.health += 10;} pan_setvar(temp_panel,1,1.0,my.health); //update health status }