client
East()
if(usr.canmove == 0)
return
return 1
West()
if(usr.canmove == 0)
return
return 1
North()
if(usr.canmove == 0)
return
return 1
South()
if(usr.canmove == 0)
return
return 1
Northeast()
return
Southwest()
return
Northwest()
return
Southeast()
return
Problem description:
The mobs can't move, even when usr.canmove = 1
What am I doing wrong?
The way you have it, attempting to move in a direction returns either 1 or 0... it never actually moves anything.
Basically what you want is something like this:
Now isn't that a lot simpler?
Additionally, you want to avoid using 'usr' 99.9993% of the time, unless its in object verbs or Click() calls, in which case there's no other way to refer to the person who did it. But typically, you ALWAYS, ALWAYS, ALWAYS want to use 'src' to refer to the source object, the owner of the function you're working with. Avoid using 'usr' at all costs if you can help it.
And furthermore, if a value is a boolean value (that means 0 = false and 1 = true), then use if(value) to check if its true, and if(!value) to check if its false. Your code will be much more error-resistant that way.