Code:
int value = (int)(50 * abs(sinv(total_ticks * speed)));
is in c-script
Code:
var value;
value = int(50 * abs(sin(total_ticks * speed)));
you can achieve better and smoother results with
Code:
var value;
var speed = 4;
value = 50 + (50 * sin(total_ticks * speed));
This will cycle between 0 and 100. The above code cycles between 0 and 50. An even faster variant would be
Code:
var value;
value = 50 + (50 * sin(total_ticks << 2));
For a real linear change use the function cycle(var x, var a, var b);