So i have this script, and without onwater it works fine (I use it for birds), but when i put onwater in, the damn fish doesnt move period. :/
PHP Code:
function onCreated() {
setCharani("armageddon-fish_bass",NULL);
}
//#CLIENTSIDE
function onCreated() {
setTimer(0.05);
drawoverplayer();
dontblocklocal();
this.z = -1;
}
function move() {
this.return = int(random(0,50));
if(this.return > 45) {
if (onwater(this.x+1.5,this.y+2)) {
this.dir = this.dir + int(random(-1,1));
if (this.dir > 3) {
this.dir = 0;
}
if (this.dir < 0) {
this.dir = 3;
}
this.i = this.dir;
}
this.dir = this.i;
this.x += vecx(this.i) / this.speed;
this.y += vecy(this.i) / this.speed;
}
}
function onTimeout() {
checks();
move();
setTimer(0.05);
}