NPC Code:
// NPC Made by CyberX
if(playerenters){
this.power=0;
}
if (actionlumbing) {
message #v(this.power)% done;
lumbpower = strtofloat(#p(0)); //See line below
this.power +=lumbpower; //These two lines could be compacted into one
sleep 0.05; //Minimuim sleep/timeout is 0.1
putleaps 3,x+2,y;
}
if (this.power=100) { //this should be inside an event
message 100% done.;
putleaps 3,x,y;
putleaps 3,x+1,y;
putleaps 3,x+2,y;
putleaps 3,x+3,y;
putleaps 3,x+4,y;
sleep 0.05; //Minimum sleep/timeout is 0.1
this.plus=1+strtofloat(#s(client.lumber)); //This
setstring client.lumber,#v(this.plus); //and this could be compacted into one line
say2 Total of wood: #s(client.lumber);
destroy;
}
NPC Code:
// NPC made by CyberX
if (strtofloat(#s(client.lumber))>19) { //Should be inside an event
set wood1;
}
if (playertouchsme&&!wood1) {
say2 Not enough wood!;
}
if (playertouchsme&&wood1&&money1) {
say2 You've already gotten a
#bwoodpack!
}
if (playertouchsme&&w1) {
say2 You've already gotten a
#bwoodpack!
}
if (playertouchsme&&wood1&&!w1&&!w2&&!money1&&!money2 ) {
timeout = 1;
putleaps 3,x+2,y;
this.less=strtofloat(#s(client.lumber))-20; //See below
setstring client.lumber,#v(this.less); //These two could be compacted into one line
set w1;
freezeplayer 3;
}
if (timeout) {
putleaps 3,x+2,y;
}
there, I have added comments where corrections are necessary, fix that up, and it should work inside NPC-Server