|
Can you tell me whats wrong with this level up system for my new server?
// NPC made by nervNAT
if (playerenters) {
if (!hasweapon(*System)) {
toweapons *System;
setstring client.maxmp,#v(int(strtofloat(#s(client.level))*1 .5));
setstring client.maxhp,#v(int(strtofloat(#s(client.level))*1 .8));
setstring client.hp,#s(client.maxhp);
setstring client.mp,#s(client.maxmp);
setstring client.maxexp,1000000;
setstring client.level,1;
}
this.baddiecount=compuscount;
timeout=.05;
}
if (timeout) {
if (playerhearts<playerfullhearts) setstring client.hp,#v(strtofloat(#s(client.hp))-1);
setstring client.exptonext,#v(strtofloat(#s(client.level))*5 );
baddycheck();
playerhearts=playerfullhearts;
if (strtofloat(#s(client.hp))>strtofloat(#s(client.ma xhp))) setstring client.hp,#s(client.maxhp);
if (strtofloat(#s(client.mp))>strtofloat(#s(client.ma xmp))) setstring client.mp,#s(client.maxmp);
exp();
if (strtofloat(#s(client.hp))<=0) dead();
showimg 0,@HP:#s(client.hp)/#s(client.maxhp),570,10;
changeimgvis 0,4;
showimg 1,@MP:#s(client.mp)/#s(client.maxmp),570,25;
changeimgvis 1,4;
showimg 2,@EXP:#s(client.exp)/#s(client.exptonext),570,40;
changeimgvis 2,4;
showimg 3,@Level:#s(client.level),570,55;
changeimgvis 3,4;
timeout=.05;
}
function baddycheck() {
for (this.i=0;this.i<compuscount;this.i++) {
if (compus[this.i].mode==3) {
if (compus[this.i].type==0) this.exp=1;
if (compus[this.i].type==1) this.exp=2;
if (compus[this.i].type==2) this.exp=3;
if (compus[this.i].type==3) this.exp=3;
if (compus[this.i].type==4) this.exp=3;
if (compus[this.i].type==5) this.exp=1;
if (compus[this.i].type==6) this.exp=1;
if (compus[this.i].type==7) this.exp=4;
if (compus[this.i].type==8) this.exp=5;
if (compus[this.i].type==9) this.exp=6;
}}
if (this.baddiecount!=compuscount) {
setstring client.exp,#v(strtofloat(#s(client.exp))+this.exp) ;
this.baddiecount=compuscount;
}}
function dead() {
freezeplayer 3;
setani dead,dead;
setstring client.hp,#s(client.maxhp);
setstring client.deaths,#v(strtofloat(#s(client.deaths))+1);
}
function exp() {
setstring client.maxmp,#v(int(strtofloat(#s(client.level))*1 .5));
setstring client.maxhp,#v(int(strtofloat(#s(client.level))*1 .8));
if (strtofloat(#s(client.exp))>strtofloat(#s(client.m axexp))) setstring client.exp,#s(client.maxexp);
if (strtofloat(#s(client.exp))>=strtofloat(#s(client. exptonext))) {
setstring client.level,#v(strtofloat(#s(client.level))+1);
setstring client.exp,#v(strtofloat(#s(client.exp))-strtofloat(#s(client.exptonext)));
setstring client.hp,#s(client.maxhp);
setstring client.mp,#s(client.maxmp);
setplayerprop #c,Level Up!;
}
}
BTW i didnt make this another staf on my server did...he just dont have gold days left on his acc |