This works:
// NPC made by Stalin
if (playerenters) {
message Deposit;
}
if (playertouchsme) {
playerdeposit=0;
disabledefmovement;
showimg 510,@Arial@b@ENTER THE AMOUNT TO DEPOSIT,(screenwidth/2)-80,(screenheight/2-120);
showimg 511,@Arial@>#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100);
showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80);
this.mode=1;
this.mode4=0;
this.mode2=1;
timeout=.05;
}
if(timeout && this.mode==1 && this.mode4==0){
setani idle,;
if(this.mode2==1){
showimg 511,@Arial@>#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100);
}else{
showimg 511,@Arial@#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100);
}
if(this.mode2==2){
showimg 512,@Arial@>Done,(screenwidth/2)-80,(screenheight/2-80);
}else{
showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80);
}
changeimgvis 510,4;
changeimgvis 511,4;
changeimgvis 512,4;
if(keydown(0)){
this.mode2=1;
this.mode3=1;
timeout=.05;
}
if(keydown(2)){
this.mode2=2;
this.mode3=0;
timeout=.05;
}
if(keydown(3) && playerdeposit<playerrupees && this.mode3==1){
playerdeposit+=1;
timeout=.05;
}
if(keydown(1) && playerdeposit>0 && this.mode3==1){
playerdeposit-=1;
timeout=.05;
}
if (keydown(4) && this.mode2==2) {
enabledefmovement;
hideimg 510;
hideimg 511;
hideimg 512;
this.mode4=1;
}
timeout=.05;
} |