mob/var/tmp/roulette=0
mob/proc
Roulette()
if(roulette == 1)
roulette = 0
for(var/obj/Roulette/M in client.screen)
client.screen -= M
del M
return
roulette = 1
var/obj/Roulette/L=new()
client.screen += L
This is a small example I put together to get my point across.
The problem is, it's creating the roulette, with starting points at random frames. I need it to start on it's first frame every time, or the roulette time is off.
I want the roulette is stay there forever until it's used again to delete it.
Edit: Make it go through the animation only once makes it start at the beginning every time. But I need it to go indefinitely, while starting at the beginning every time
If the icon does not loop a fixed number of times, that is if it loops indefinitely, it will not take the creation time of the obj into account. But if it is a fixed-loop animation, and obviously the obj is new every time, I would expect the new creation time to apply each time. It's possible (though premature to say for sure) that a bug could be in play.
Incidentally, the ==0 and ==1 tests on vars that can only be true or false is bad form. Just use if(roulette), not if(roulette==1). Likewise you'd use if(!roulette) in place of if(roulette==0). It's a good habit to be in because it makes your code more robust.