ID:142958
 
Code:
var/moving


mob/Move()
if(usr.canmove==1)
if(!moving&&usr.gm<3)
moving=1
..()
spawn(2) moving=0


Problem description:

Well, I guess this is probably where my problems are coming from.

Anyway, the movement is very sketchy. You'll press an arrow and sometimes you'll move, sometimes you won't. Sometimes you'll stop while you have the arrow pressed down. Odd >_>.

Anyone see the problem?
hmm

mob/var/moving = 0 //heres is one of all the errorrs


mob/Move()
if(src.canmove)//neva use==1 check if its true or false
if(!src.moving&&src.gm<3)//y here u stopped using usr??
src.moving=1//why here isnt a src.moving ??
..()
spawn(2) src.moving=0//why here isnt a src.moving


hmm i think thats going to work


...:::Pirata Inmortal:::...
In response to Pirata Inmortal
For the millionth time, Move() needs to return a value: 1 if the move was successful, 0 if it wasn't. It's as simple as using .=..() instead of just ..(), really (also, returning 0 if the movement checks fail).

However, there's another very important error here: moving needs to be declared as mob/var/tmp/moving, so it doesn't get saved.
In response to Garthor
mob/var/tmp/moving = 0


mob/Move()
if(src.canmove)
if(!src.moving&&src.gm<3)
src.moving=1
.=..()
spawn(2) src.moving=0


Like that?
In response to GohanIdz
Actually, now I can't move at all o.0
In response to GohanIdz
UM, if ur looking just to move slower, someone has made a movement delay library, and his thing can be put directly into your thing, without using the actual library itself.

i think it may be kajika, or someone else, im not sure who it was now, but its some kind of movement delay library.
In response to Superbike32
I found one by Sven I think I'm going to use.
In response to GohanIdz
        if(!src.moving&&src.gm<3)


That's your problem.