Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is there a way to infinitely increase a number value?

I'm trying to do something like this:

script.Parent.Parent.Rotation = script.Parent.Value

while true do
    script.Parent.Value + 1
    if script.Parent.Value = 360 then
        script.Parent.Value = 0
    end
end)

Anyone got any ideas on how I can do this?

2 answers

✓ Accepted answer

yes there is a way

script.Parent.Parent.Rotation = script.Parent.Value
while true do
wait()
    script.Parent.Value = script.Parent.Value + 1
    if script.Parent.Value == 360 then
        script.Parent.Value = 0
    end
end)

Your script was right.

Maybe I dont understand the question cuz my english is kinda bad

You didn't add a wait().


script.Parent.Parent.Rotation = script.Parent.Value

while true do
    script.Parent.Value + 1
    if script.Parent.Value == 360 then
        script.Parent.Value = 0
    end
wait()
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.