ID:155891
 
so lets just say that your figure is walking through water and you want his to go slow, How?
mob/var/inwater = 0
mob/var/canwalk = 1
client/Move()
if(mob.inwater && canwalk)
..()
canwalk = 0
spawn(4)
canwalk = 1


obviously thats not a fully working code and you should re do it for your needs but thats a general idea for you.

http://www.byond.com/docs/guide/


In response to Midgetbuster
Rather than a variable, just see src.mob.loc is of a water type turf.
client
var
move_delay = 2 //normally
next_move = 0
Move()
if(src.next_move < world.time)
. = ..()
if(.) //if movement was successful
if(istype(src.mob.loc,/turf/water))
src.next_move = world.time+src.move_delay+2 //add more move_delay
else
src.next_move = world.time+src.move_delay
In response to Spunky_Girl
Even simpler way of doing it is to just have water hold its own variable. This will also let you add more movement impairing terrain later, if you choose to do so:
mob
var
delay = 4
canmove = 0
Move()
if(src.canmove>world.timeofday)
return 0
.=..()
if(.)
src.canmove = world.timeofday + src.delay

impairing_turf
parent_type = /turf
var/slowdown = 0
Entered(mob/M)
M.delay += src.slowdown
Exited(mob/M)
M.delay -= src.slowdown
water
var
slowdown = 2

I kind of built this off the top of my head, so please tell me if this doesn't work.