generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Rotating loop

Previous Thread :: Next Thread 
IntellectualBeing is not online. IntellectualBeing
Joined: 29 Sep 2013
Total Posts: 701
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
IntellectualBeing is not online. IntellectualBeing
Joined: 29 Sep 2013
Total Posts: 701
19 Jul 2014 12:37 PM
Bump.
Report Abuse
deathknight306 is not online. deathknight306
Joined: 15 Jan 2008
Total Posts: 183
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
ninja900500 is online. ninja900500
Joined: 27 Sep 2008
Total Posts: 2324
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image