ID:261876
 
ok, what i have is a icon called Timer.dmi it has 4 states with a picture for each = 1 2 3 and 0. What I am trying to do is simila to the game fast and the furious. i want to make it so that when im at the "Racing Place" i can see a timer(near the start) go 3(one second), 2(one second), 1(ect.), 0 with or without a loop, which ever is easier for u

I have started to try and do this and have failed this is my failing code:NOTE: the "tabs" aren't correct, they are fixed on my dream maker

Login()
..()
Age(src)
Stat()
stat("Age:",age)
stat("Age State:",icon_state)
mob
proc
Age(mob/M as mob)
for() //loop this action
M.age += 1 switch(M.age)
if(1) // if they are 1 to 5
icon = 'Timer.dmi'
icon_state = "3"
if(2)
icon = 'Timer.dmi'
icon_state = "2"

if(3)
icon = 'Timer.dmi'
icon_state = "1"
if(4)
icon = 'Timer.dmi'
icon_state = "0"

sleep(100)//wait for 3 seconds
you need to use something like this...
whatever you are using/proc/timer()
<tab>var/number=3
<tab>if(number==3)
<tab><tab>src.icon_state="3"
<tab>if(number==2)
<tab><tab>src.icon_state="2"
<tab>if(number==1)
<tab><tab>src.icon_state="1"
<tab>if(number==0)
<tab><tab>src.icon_state="0"
<tab>number-=1
<tab>if(!number==0)
<tab><tab>spawn(10)timer(src)

mob
Login()
spawn()
src.Age()
Stat()
stat("Age:",[src.age])
stat("Age State:",[src.icon_state])
proc
Age()
for(var/i=1,i<=4,i++)
src.age++
switch(src.age)
if(1)
src.icon='Timer.dmi'
src.icon_state="3"
if(2)
src.icon='Timer.dmi'
src.icon_state="2"
if(3)
src.icon='Timer.dmi'
src.icon_state="1"
if(4)
src.icon='Timer.dmi'
src.icon_state="0"
sleep(30)
In response to Goku72
GOKU THIS IS FOR AN ICON ON THE MAP!!!
In response to Xallius
I am noting that you are using src
what i am trying to do is make an little square that goes 3(one second)2(one second)1(one second)go
but what you are doing is making the character go 3 2 1 and keep going, i don't know if you are right or wrong but im fimiliar with src being for mobs or usrs not icons

i really don't know i kinda new to coding