Just a little guy you can control with on and off commands, has a sword (S) and bow (D)
NPC Code:
//Open Source NPC scripted by Brady (Baddies)
//Feel free to use the script in any way that you want.
if (created) {
setstring this.mode,0;
enabledefmovement;
showcharacter;
this.speed=.5;
swordpower=1;
}
if (created || timeout) {timeout=.05}
if (playersays(on)) {this.mode=1;disabledefmovement;}
if (playersays(off)) {this.mode=0;enabledefmovement}
if (timeout && this.mode=1) {
if (keydown(0)) {dir=0;if (!onwater(x+1.5,y+2)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+1.5,y+.7)) {y-=this.speed}}
if (keydown(1)) {dir=1;if (!onwater(x+1.5,y+1.5)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+.2,y+2)) {x-=this.speed}}
if (keydown(2)) {dir=2;if (!onwater(x+1.5,y+2)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+1.5,y+3.2)) {y+=this.speed}}
if (keydown(3)) {dir=3;if (!onwater(x+1.5,y+1.5)) {setcharani walk,} else {setcharani swim,;};if (!onwall(x+2.8,y+2)) {x+=this.speed}}
if (keydown(4)) {setcharani shoot,wbow1.gif;sleep .35;timeout=.05;shootarrow dir;}
if (keydown(5)) {setcharani sword,;sleep .35;timeout=.05}
if (!keydown(0) && !keydown(1) && !keydown(2) && !keydown(3) && !keydown(5) && !onwater(x+1.5,y+1.5)) {setcharani idle,}
}