ID:1660645
 
(See the best response by Kozuma3.)
Code:


Problem description:hey guys i dont work with movement but today im trying to do something like if blah is true then every step you take it takes off (random number) from blah var any pointers?

Best response
Something like this?

mob
var/BLAH = FALSE
var/blah = 100
Move()
if(BLAH)
blah--
..()
In response to Kozuma3
Changed Kozuma's code so it is a random number from blah
 mob
var/BLAH = FALSE
var/blah = 100
Move()
if(BLAH)
blah-=rand(1,10)//1 being the low number and 10 being high. will choose a random number in that range
..()


Built-in procs with default return values such as Move() and client.New() should return the proper value, usually ..(). Otherwise the other movement procs won't return anything.