So, i want X value (9.5 in my case) to drop down to 9 (x = x - 0.01) but when it reaches value of 9, to rise to 9.5 again (x = x + 0.01). That loop should repeat infinite times.
I've tried several thing but none of them worked. I really hope that some of you pro scripters can help :)
Are you using if statements such as if X >= 9.5 then
and if X <= 9 then
?
If not you should consider using it to check the value of X. Using what I just said I did something like this:
while wait(0.1) do -- In the wait, put the seconds you want to pause between each loop if X <= 9 then -- Check if X is less than or equal to 9 X = X + 0.01 -- Add 0.01 to X elseif X >= 9.5 then -- Check if X is more than or equal to 9.5 X = X - 0.01 -- Subtract 0.01 to X end end