Quote:
Originally posted by SkooL
I am trying to create an NPCw to make it seem as though the player has 200 MP. It will be an item the player may purchase. Anyways, I was wondering if anyone could figure out why this doesn't work...
NPC Code:
if (created) {
this.playermagic=playermp;
}
if (playerenters) {
toweapons -200MP;
}
if (this.playermagic>playermp) {
playermp+=int(this.playermagic-playermp/2);
this.playermagic=playermp;
}
|
try somethign like
if (playerenters) {
toweapons -200MP;
}
while (this.magic != playermp) {
if (this.magic>playermp) {
playermp = int((this.magic-playermp)/2+playermp);
}else{
this.magic = playermp;
}
}