unfortunately, i'm not able to edit my original post
so i'll just post the updated thing with the ap's edit:
PHP Code:
//#CLIENTSIDE
function onCreated() {
init_Attr();
}
function onPlayerenters() {
this.setTimer(random(0,3));
}
function onPlayertouchsme() {
this.setTimer(0);
move(0,0,0.05,0);
dir = getdir(player.x-x,player.y-y);
temp.var = int(random(0,this.messages.size()));
if (temp.var==0) { say2(this.messages[1]); }
else { say2(this.messages[temp.var]); }
this.setTimer(5);
}
function onTimeout() {
doMove();
this.setTimer(int(random(2,5)));
}
function init_Attr() {//in honor of ace2896
showcharacter();
// use this part if its a regular npc
player.head = "head0.png";
player.body = "body.png";
player.shield = "no-shield.png";
colors[0] = "orange"; colors[1] = "white"; colors[2] = "blue"; colors[3] = "red"; colors[4] = "black";
//use this part if its a custom gani npc person
//setcharani("delt_suo-kccutie","kc_kara2.png");
dir = int(random(0,3));
this.messages = {null,"Where have you set the" NL "cabbage this time, Myra!?","My armpits smell like butter.","I wish daddy would stop hitting" NL "mommy.","C-C-C-C-C-COOCAAAINE","MMMMMM CIGARETTES","Well Gertrude, I tend to be more" NL "liberal-centrist on the issue.","Ware da hood @","kekekekekekeke ^_^","I am going to stab your" NL "babies with a sharpened banana.","I once set the internet on fire."};
this.distX = {null,0,-7,0,7,0};
this.distY = {null,0,-7,0,7,0};
this.dispT = {null,.4,.5,.65,.75,1};
}
function doMove() {
temp.array = {int(random(1,5)),int(random(1,5)),int(random(1,5))};
move(this.distX[temp.array[0]]*this.dispT[temp.array[2]],this.distY[temp.array[1]]*this.dispT[temp.array[2]],this.dispT[temp.array[2]],20);
if (this.distX[temp.array[0]]==this.distY[temp.array[1]]==0) {
dir = int(random(0,3));
if (this.ani != "idle") {
setcharani("idle",null);
}
sleep(this.dispT[temp.array[2]]);
}else{
if (this.ani != "walk") {
setcharani("walk",null);
}
}
}
i would have noticed thiat earlier but i've been banned from the forum for the past two years.