ahhh so you use findimg per the sprite id. Didn't know you could do that.
So my last issue is it seems its doing both if commands in rollImg and it shouldn't be. I'm passing the player.dir through in PARAM3, and in echo before it sets the ani it's correct and only sends once, but when you are dir 2 or 3 it still does 0 and 1 for some reason. If you are 0 and 1 dir, then it only does dir 1 and 2. I can't figure out for the life of me why it's doing 0/1 when the dir is 2 or 3.
PHP Code:
SCRIPT
function onPlayerEnters()
{
play(params[1]);
this.moveway = params[2];
rollImg();
}
function rollImg() {
echo("made it");
if (this.moveway <= 1) {
echo("left up");
for (findImg(1).rotation = 0; findImg(1).rotation > (-(2 * pi)); findImg(1).rotation -= (pi / 4);)
sleep(0.05);
}
if (this.moveway >= 2) {
echo("down right1");
for (findImg(1).rotation = 0; findImg(1).rotation < (2 * pi); findImg(1).rotation += (pi / 4);)
sleep(0.05);
}
}
SCRIPTEND