The *real* NPC Server way to do it
NPC Code:
if (created) {
showcharacter;
setcharprop #3,head19.png;
setcharprop #C0,orange;
setcharprop #C1,gray;
setcharprop #C2,gray;
setcharprop #C3,brown;
setcharprop #C4,black;
setcharprop #2,izludeshield.png;
setcharprop #n,Stefan;
shieldpower = 1;
dir = 2;
ap = 100;
x += 0.5;
}
if (playertouchsme) {
dir = (playerdir+1)%4;
putnpc2 x+vecx(dir)*3,y+vecy(dir)*3,{
if (created) {
showcharacter;
setani gralat,1;
}
if (playertouchsme) {
playerrupees ++;
destroy;
}
};
message Here you are, greedy person!;
sleep 3;
dir = (dir+1)%4;
message;
}
A NPC that just increases your Gralat count would be really unrealistic

Totally off topic: Hmm, it would be cool if the code-Vb tag would format your script the same way the debugger on Graal does...