You can't edit player.hearts on the clientside, you'll need to trigger the server to do so:
PHP Code:
// Recieve the triggeraction, with cmd being the first parameter passed
function onActionServerside(cmd) {
if (cmd == "heal") {
player.hearts = player.fullhearts;
}
}
//#CLIENTSIDE
function onWeaponFired() {
if(clientr.spellevel >= 10) {
// Call a trigger to the server
// "gui" simply tells it that it needs to trigger a gui, which is actually a weapon
// name simply references the name of the weapon itself, so it's triggering itself
// "heal" is simply a parameter you're going to pass
triggerserver("gui",name,"heal");
setani("lift",NULL);
}
}
You also need to work on your formatting some so it's easier for us to read.