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 » Scripters
Home Search
 

Re: Restarting a while loop from the beginning

Previous Thread :: Next Thread 
mario50man is not online. mario50man
Joined: 28 Feb 2008
Total Posts: 6540
24 May 2015 01:27 PM
How would you make a while loop restart to the beginning without carrying out the rest of the script in the loop?
Report Abuse
Anticodist is not online. Anticodist
Joined: 05 Feb 2014
Total Posts: 1191
24 May 2015 01:28 PM
Use 'if' statements to compartmentalize the code.



-𝒩 | Anticodist, Scripter
Report Abuse
mario50man is not online. mario50man
Joined: 28 Feb 2008
Total Posts: 6540
24 May 2015 01:46 PM
nvm, it was a lot more simple than i thought.

if anyone else is wanting to do the same thing:

function loop()
--loop here
end

function restart()
loop()
end
Report Abuse
Anticodist is not online. Anticodist
Joined: 05 Feb 2014
Total Posts: 1191
24 May 2015 01:47 PM
You realize neither of those are loops, right?



-𝒩 | Anticodist, Scripter
Report Abuse
nQqzRYVpIKA5jLP is not online. nQqzRYVpIKA5jLP
Joined: 05 Mar 2015
Total Posts: 4135
24 May 2015 01:47 PM
Using restart() is literally the exact same thing as doing loop().
Report Abuse
pketny is not online. pketny
Joined: 27 Dec 2010
Total Posts: 1162
24 May 2015 01:49 PM
After calling restart() in the loop the loop will continue from that point.
Just use if statements.
If you are not sure how to use those properly, please follow these series of tutorials:
http://wiki.roblox.com/index.php?title=AllTutorials#Scripting
Report Abuse
Darkmist101 is not online. Darkmist101
Joined: 30 Jul 2010
Total Posts: 6208
24 May 2015 02:05 PM
You know your code, once that loop finishes; the rest would continue from where they left off.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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