Imagine i have a variable
var infinite increase ;

So, having a variablev that is showing a value from 0 to infinite number.. each time frame. lets call it infinite increase


and i want to make id = infinite increase
(That id will then be show on the screen- not very important)

but when the id is 50, i want it to be zero, and start counting from there according to the infinite increase .. so that id, will range from zero to 50, and each time it gets 50 , it starts from zero again.

i tryed to do somethink lke this:

var id = infinite increase ;

if(id=50){id-=50;} but this works for once only
if(id=100){id-=100;} but this works for once only
(...) i need a formula.

thanks.