ID:163561
 
How would I go about creating a countdown timer?
[bump]
In response to GohanIdz
You're not suppose to bump a post if it hasn't been 24 hours since your original one. Just use the Search bar at the top, more people need to learn how to do things on their own instead of always asking.
GohanIdz wrote:
How would I go about creating a countdown timer?

Put this inside the countdown proc/verb/whatever...
var/timer=10 //10 seconds.
while(timer>=0)
world<<"[timer]"
timer-=1
sleep(10)
countdown
var/timer
New(t=5,step=10)
spawn
for(var/i=t,i>0,i--)
timer=i
sleep(step)
del src

proc/countdown() return new/countdown( arglist(args) )

mob
Stat()
if(countdown) stat("Countdown:",countdown.timer/10)
var
tmp/countdown/countdown
verb
ten_second_countdown()
var/countdown/C=countdown(10)
countdown=C


Something like that.

-- Data