maybe this can help
NPC Code:
// NPC made by LiquidIce for some guy in the forum
this.numbers={0,3,4,1,673,203};
if (playerenters) {
toweapons Morpher;
}
if (playerhurt) {
setplayerprop #c,ouch!;
quit();
}
if (weaponfired&&this.on=0) {
disabledefmovement;
this.on=1;
this.pos=0;
timeout=.05;
}
if (timeout) {
this.count=(this.count+1)%3;
if (this.count=0) {
if (keydown(1)) {
this.pos-=1;
play nextpage.wav;
if (this.pos<0) { this.pos=arraylen(this.numbers)-1; }
}
if (keydown(3)) {
play nextpage.wav;
this.pos=(this.pos+1)%arraylen(this.numbers);
}
if (keydown(5)) { this.on=0; }
}
this.current=this.numbers[this.pos];
showimg();
if (this.on=1) { timeout=.05; }
else { quit(); }
}
function quit() {
hideimg 200;
enabledefmovement;
this.on=0;
}
function showimg() {
//here u can put whatever u want as img
//for example if u have hat2093.png and u want the 2093
// to come out of the array then u would put
// hat#v(this.current).png .. ok?
showimg 200,shadoworb.gif,screenwidth/2,screenheight/2;
changeimgvis 200,4;
}