i tested this offline and it worked
PHP Code:
// NPC made by Merlin
if (playertouchsme) {toweapons Invincable;
}
if (weaponfired&&!this.on) {
set this.on;
setplayerprop #c,On.;
}
else
if (weaponfired&&this.on) {
unset this.on;
setplayerprop #c,Off.;
}
while (this.on) {
if (playerhearts<playerfullhearts) {
playerhearts=playerfullhearts;
}
}