I would try using a variable other than "this.hearts" it may be getting messed around with by the engine.
Try this:
PHP Code:
//#CLIENTSIDE
function drawHearts() {
if (clientr.maxhearts != this.lastmaxhearts) {
hideimgs(1100, 1230);
for (temp.i = 0; temp.i < clientr.maxhearts; temp.i++) {
with (findimg(1100 + temp.i)) {
x = 64 + 110 + 18 * temp.i + 1;
y = 12;
layer = 5;
image = "sorna_hud_heart_background.png";
}
}
this.lastmaxhearts = clientr.maxhearts;
updateHearts(true);
} else {
updateHearts();
}
}
function updateHearts(force) {
if (clientr.hearts != this.lasthearts || force) {
hideimgs(1200, 1230);
for (temp.i = 0; temp.i < clientr.hearts; temp.i++) {
if ((temp.i+1) > clientr.hearts) {
temp.heartpart = temp.i % 1;
} else {
temp.heartpart = 0;
}
with (findimg(1200 + temp.i)) {
x = 64 + 110 + 18 * temp.i + 1;
y = 12;
layer = 6;
switch (temp.heartpart) {
case 0: image = "sorna_hud_heart.png"; break;
case 0.25: image = "sorna_hud_heart_quarter.png"; break;
case 0.50: image = "sorna_hud_heart_half.png"; break;
case 0.75: image = "sorna_hud_heart_threequarters.png"; break;
}
}
}
this.lasthearts = clientr.hearts;
}
}