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: Found a way to make a repeat loop == a while loop

Previous Thread :: Next Thread 
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 09:35 PM
Use the repeat with an if statement before it

if true then
repeat wait()
print("ok")
until not true
end

is the same as:

while wait() do
print("ok")
end
Report Abuse
Nyxis is not online. Nyxis
Joined: 15 Nov 2012
Total Posts: 3374
08 Oct 2014 09:36 PM
Give this man a pat on the back, a cookie, and a kick in the face.


a seal walked into a club
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 09:47 PM
You guys all know how much I love repeat loops and hate while loops. So I finally put in the seconds of thought to make it work.
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 09:48 PM
*2 seconds
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
08 Oct 2014 09:48 PM
i didn't know that and don't know why you feel that. lol


this is a signature: pcall(function() print([[apparently this is a string]]) end)
Report Abuse
ZippyCaitSith is not online. ZippyCaitSith
Joined: 30 Apr 2012
Total Posts: 38
08 Oct 2014 09:49 PM
well at least youre learning
most people here just beg
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 09:51 PM
^I already know how to script pretty advanced. I just thought of this today since I fell in love with repeat loops at like 2:00 this afternoon.
Report Abuse
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
08 Oct 2014 09:51 PM
^ Savor your next post, do it for Jordan.

-Vanilla
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
08 Oct 2014 09:51 PM
Track this thread and look back on it in a year from now.
Report Abuse
ZippyCaitSith is not online. ZippyCaitSith
Joined: 30 Apr 2012
Total Posts: 38
08 Oct 2014 09:51 PM
sounds like me and my brother falling in love with calculus around 2am as well
fun stuff
Report Abuse
ZippyArnold123456789 is not online. ZippyArnold123456789
Joined: 21 May 2008
Total Posts: 1294
08 Oct 2014 09:53 PM
*tracks thread*
*1 year later*
-[Content Deleted]-
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 09:55 PM
I vow to never use a while loop again.
Report Abuse
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
08 Oct 2014 09:57 PM
^ INEFFICIENT PRICK
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
08 Oct 2014 09:57 PM
but, icy. this is pretty inefficient compared to a while loop. they were created for a reason.


this is a signature: pcall(function() print([[apparently this is a string]]) end)
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 09:58 PM
I guess you could say I am a coding hipster.
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
08 Oct 2014 09:59 PM
the worst kind of hipster
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
08 Oct 2014 09:59 PM
'coding hipster'

ahhaaahhaahahahhaahaha. icy ur killing me. ahahahaahahahahhaha

*died*

rest in piece kotwarrior
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
08 Oct 2014 10:00 PM
KOT really did die... he forgot to put his signature
Report Abuse
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
08 Oct 2014 10:01 PM
You're just like instagram hipsters using filters to make their pictures look better, except a lot more intelligent.

Oh god. While loop filters aaaaaaah.

-Vanilla
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
08 Oct 2014 10:03 PM
It will be much harder to decode a error if someone else sees this loop and need to understand the reason behind this


And I don't believe you need the "if true then" part of the script
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 10:05 PM
Legend, yes you do. Repeat loops run the block of code before checking the condition, so you need to check it prior to you running the loop to get the same functionality as a while loop.
Report Abuse
KOTwarrior is not online. KOTwarrior
Joined: 13 Jun 2012
Total Posts: 4376
08 Oct 2014 10:07 PM
instead of that you could do:

repeat wait()
print(true and "ok" or '');
until not true;
Report Abuse
IcyFires is not online. IcyFires
Joined: 29 Jun 2013
Total Posts: 5046
08 Oct 2014 10:09 PM
You need an if statement though or else even if the until is true it will run once.
Report Abuse
cupcakescankill is not online. cupcakescankill
Joined: 24 Oct 2008
Total Posts: 13261
08 Oct 2014 11:26 PM
A repeat loop is just simply a do while loop, which is essentially a while loop that runs at least once.

repeat wait() until false

is also just fine
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
09 Oct 2014 12:00 AM
repeat
--code
until nil
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