Ok another thing.
I decided to move the projectile serverside, because I was told that I had to do it like that, so it looks somewhat like this:
PHP Code:
function onCreated() {
setimg("shuriken_icon.gif");
setshape(1,12,12);
this.dird = player.dir;
this.spread = random(-client.spread,client.spread);
dontblock();
scheduleevent(3,"StarDestroy","");
setTimer(0.1);
}
function onTimeOut() {
if (!onwall(this.x + 6/16 + vecx(this.dir)*7/16, this.y + 6/16 + vecy(this.dir)*7/16)) {
this.x += vecx(this.dird) + (player.dir in {0, 2} ? this.spread/16 : 0);
this.y += vecy(this.dird) + (player.dir in {1, 3} ? this.spread/16 : 0);
setTimer(0.1);
}
triggeraction(this.x + 6/16 + vecx(this.dir)*8/16,this.y + 6/16 + vecy(this.dir)*8/16,"StarDamage",nil);
}
Well, it does not work at all anymore!
The projectile gets spawned in front of my player, yes, but it doesn't move anymore.
While debugging I figured out that "this.spread" and "this.dird" are both 0 now and won't get set to what I want them to get set oO
x_X
Anyone?