I want to rotate my image label to 360 and keep rotating around here is the script i put:
while true do script.Parent.Rotation = script.Parent.Rotation +360 end
Well, there's 2 ways to do it. (That I know of)
You can use a For Loop
OR While Loop
For Loop
for i = 1,2000000000,10 do script.Parent.Rotation = i wait() end
This is how it works.
The first number (1), is where it starts off at, the goal (2000000000), is where it wants to reach, and the third number (10), is how much it increments by.
So, every 0.03 seconds the frame will rotate by 10 until it reaches 2000000000, this will generate a smooth looking rotating label.
While Loop
while wait() do script.Parent.Rotation = script.Parent.Rotation + 10 end
This is how this one works.
This will wait 0.03 seconds and it will add 10 degrees to the current rotation of the label indefinitely.
So, however way you want to do it. Both of these methods work either way.
Hope this helped! If this worked, don't forget to select this as the answer!
You instantly set the label's rotation to 360, that won't be smooth nor allow you to notice it at all.
Second thing, you didn't add a wait() in your while loop, this will cause the script to crash.
If you want to make the image infinitely rotate I'd recommend you doing
while true do script.Parent.Rotation = script.Parent.Rotation + 1 wait() end
Even if it reaches 360, it will keep on rotating.
First of all, you should have a wait in a loop or the game will freeze since it is too fast using "while wait() do" should fix this.
if you want the image label to rotate faster then increase the number. Just make sure it is less than 360 since that is a full rotation and won't appear as it rotating.
Here is the code:
while wait() do script.Parent.Rotation = script.Parent.Rotation + 1 -- the higher the number the faster it should rotate end