|
| 19 Jul 2014 12:32 PM |
while true do wait(0.1) script.Parent.Rotation = script.Parent.Rotation + 5 end
I know there is a better way to do this, I'm trying to make a Gui spin really fast for 1-2 seconds and have it stop. But doing a while true do will just make it go on forever.
I heard there is something called a for loop but I can't remember.. |
|
|
| Report Abuse |
|
|
| |
|
|
| 19 Jul 2014 12:39 PM |
The for loop would be something like this for I = 1, 10 do --do stuff here end
The 1 is the starting number, the 10 is the number you would end at. With that exact code it will increment by 1 each time it loops through.
for I = 10, 1, -1 do --stuff here end
This code here had a third number in the actual for part. The third number is by how much you want to increment/decrement each loop. If you don't specify a number it just simply goes up by 1 each time. This one here will start at 10 and go down by 1 each loop until it reaches 1. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2014 12:40 PM |
time = 0
for i = 1, 2 do time = time + 1 wait(1) end
while wait() do if time ~= 2 then script.Parent.Rotation = script.Parent.Rotation + 5 end end |
|
|
| Report Abuse |
|
|