proc/timeloop()
while(src)
src.seconds++
var/text
if(!text) text=seconds //this is just for the first iteration of the loop
//however it keeps getting turned back into seconds
var/minutes
if(seconds==60)
minutes++
seconds=0
seconds=time2text(seconds, ":ss")
text="[minutes][seconds]" //rewrite text to read as 1:00 (for example)
//but that only happens for one iteration of the loop, why?
world<<"Timer: [text]"
else world<<"Timer: [text]"
sleep(10)
Problem description:
It should only change text to equal timer if text is null... why is it doing that each time?
To explain, each time 1:00 appears, the loop immediate goes back to outputting 1, 2, etc. Why?
You need to change the scope of the text variable so that it exists outside of the loop. Just define it before the while(src).
There are also some other problems, where you keep switching seconds between being a number and text.
Try this:
I assume you have seconds defined elsewhere? Any particular reason for that?