Well I´m trying to make a health bar in a gani. I was looking around the forums for help and my result was this:
PHP Code:
SCRIPT
function onPlayerEnters() {
hideimgs(200, 3000);
temp.pl = findplayer(player.account);
with (findimg(200)) {
x = player.x + 2/16;
y = player.y - 1.75;
image = "pirate_healthbar.png";
width = maxWidth;
height = maxHeight;
attachtoowner = true;
}
with (findimg(201+pl.id)) {
x = player.x + 10/16;
y = player.y - 1.75 + 3/16;
image = "pirate_healthbar-progress.png";
width = getimgwidth(image);
height = getimgheight(image);
attachtoowner = true;
}
part=(pl.clientr.health_hearts/pl.clientr.health_fullhearts)*findimg(201+pl.id).width;
changeimgpart(201+pl.id, findimg(201+pl.id).width-part, 0, part, findimg(201+pl.id).height);
}
SCRIPTEND
I know it´s not updating constantly but thats not my problem. My problem is that it shows the clients hp in the correct form. But the bar at the other players keeps saying that the player has 100% health even when it´s not true.
How can I fix it?