mess w/ x,y's to change things around .. and yah u can use a loop but this is simple to understand..
NPC Code:
if (playertouchsme) {
disabledefmovement;
this.on=1;
timeout=.1;
setani idle,;
}
if (keydown(1)&&this.on=1) { this.pos=0; }
if (keydown(3)&&this.on=1) { this.pos=1; }
if (keydown(4)&&this.on=1) {
if (this.pos=1) { this.on=0; }
else {
quit();
//put below here whatever you want it to do when the player chooses yes
setlevel2 whateveryourhouse.graal,30,30;
//end
}
}
if (timeout) {
showimg 200,@Go under house?,screenwidth/2-50,(screenheight/2)-30;
if (this.pos=0) {
showimg 201,@@b@yes,(screenwidth/2)-20,screenheight/2;
showimg 202,@no,(screenwidth/2)+20,screenheight/2;
}
else {
showimg 201,@yes,(screenwidth/2)-20,screenheight/2;
showimg 202,@@b@no,(screenwidth/2)+20,screenheight/2;
}
changeimgvis 200,4;
changeimgvis 201,4;
changeimgvis 202,4;
if (this.on=1) { timeout=.1; }
else { quit(); }
}
function quit() {
this.on=0; hideimg 200;hideimg 201; hideimg 202; enabledefmovement;
}