NPC Code:
//#CLIENTSIDE
if (weaponfired) {
disabledefmovement;
setani ddocarina,;
setplayerprop #P2,ddocarina.gif;
timeout=.05;
}
if (timeout) {
this.key = -1;
for (this.i=0;this.i<4;this.i++)
if (keydown(this.i))
this.key = this.i;
if (this.key!=-1){
play ocarina#v(this.key+4*keydown(5)).wav;
this.song={this.song[1],this.song[2],this.song[3],this.song[4],this.song[5],this.key+4*keydown(5)};
this.song0={2,2,0,3,2,0};
setstring this.warpsong0,havenspar.graal 30.5 32.5;
this.matchsong = 0;
if (this.song == this.song0){
tokenize #s(this.warpsong0);
enabledefmovement;
setani idle,;
this.song={-1,-1,-1,-1,-1,-1};
triggeraction 0,0,serverwarp,#t(0),#t(1),#t(2);
}
sleep 0.1;
}
if (keydown(6)) {
enabledefmovement;
setani idle,;
}
timeout=.05;
}
Some code I made about threeforths of a year back. Conceptual, but simple. Comments Appreciated.