Author Topic: Very odd, Will this work?  (Read 1079 times)

I'm just was making a a simple mod, and for some reason, it doesn't work, help?
Code: [Select]
function move()
{
moveForward(1);
  schedule(1000,0,"moveForward","0");
    moveBackward(1);
  schedule(1000,0,"moveBackward","0");
$looping=schedule(30000,0,"move","");
}
And, it won't work, anyone know why?

You're calling moveForward and moveBackward at the same time, which will cause the player to stay still.
Try this

Code: [Select]
function move()
{
     moveForward(1);
schedule(1000,0,moveForward,0);
     schedule(2000,0,moveBackward,1);
schedule(3000,0,moveBackward,0);
$looping=schedule(30000,0,move);
}

^

but I think badspot disabled moveforward/backward along with mouseclick a few versions ago

Nope.
Just tested all three of those, and they worked.

^

but I think badspot disabled moveforward/backward along with mouseclick a few versions ago
No he didn't, it still works when I do moveforward(1); and Movebackward(1);

Also Headcrab Zombie you're a life saver.
Thank you <3
Warning - while you were typing a new reply has been posted. You may wish to review your post.
Darnit

and it's not mouseclick, it is mousefire.


Wrong topic?
^

but I think badspot disabled moveforward/backward along with mouseclick a few versions ago
and it's not mouseclick, it is mousefire.

No, triple said mouseclick, not mousefire.


No, triple said mouseclick, not mousefire.


Im sure everyone knew what he ment

You're calling moveForward and moveBackward at the same time, which will cause the player to stay still.
Try this

Code: [Select]
function move()
{
     moveForward(1);
schedule(1000,0,moveForward,0);
     schedule(2000,0,moveBackward,1);
schedule(3000,0,moveBackward,0);
$looping=schedule(30000,0,move);
}

Code: [Select]
function move() {
if(!$moveDir || $moveDir == 0) {
moveForward(1);
$moveDir = 1;
}
else {
moveBackward(0);
$moveDir = 0;
}
$loopMove = schedule(3000, 0, move);
}

Faster, maybe? I dunno, mine is stupid.