PHP Code:
//#CLIENTSIDE
function onCreated() {
setTimer( 0.05 );
}
function onTimeOut() {
this.clonedir = ((player.dir + 2) % 4);
this.clonedx = player.x + vecx(this.clonedir) * 2;
this.clonedy = player.y + vecy(this.clonedir) * 2;
with (findimg(200)) {
layer = 0;
x = thiso.clonedx;
y = thiso.clonedy;
z = player.z;
ani = player.ani @ "[" @ player.anistep @ "]";
dir = player.dir;
playerlook = true;
actor.mode = 1;
zoom = 1;
}
setTimer(.05);
}
function onActionHit() {
//damage code
}
Something like this I guess