How to add this simple script an infinite action instead of just adjusting endless numbers to it?

So I made a texture scroller script, I made it use the offset thing.
I want to make it so I don’t need to spam like “9999999” and all that because that will end in some point.
I want to make it so it will continue for ever without doing that thing.
That is the only way that I know of how to do that.

 local offset = script.Parent

    for scroll = 0, 999999999999999999999999999, .1 do

    offset.OffsetStudsV = scroll

    wait()

    end

Any help would be appreciated!
I’m also a beginner

1 Like

You should look at while loops, repeats, and RunService.Hearbeat for ways to loop infinitely.

This script should work:

while wait() do
    offset.OffsetStudsV = scroll
end
1 Like

yeah, was about to say that. Just add a loop and you will be set.

1 Like

but I have the “for” thing It prevents Me from doing that…
for sideways = 0, 23432423423, .1 do

You should be able to use the while loop instead of the for loop.

I’m a beginner at scripting, can you please add that to the code For Me Please? I don’t understand much of it

he did essentially, this should be all you need:

while wait() do
offset.OffsetStudsV = offset.OffsetStudsV + .1
end
2 Likes

Thank you!1!!!

1 Like