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: Is there..

Previous Thread :: Next Thread 
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
13 Jun 2014 10:05 PM
Anything that does what 'repeat' does?

For example, after the repeat finishes, the rest of the code continues. Anything like that? I find repeat, buggy, glitchy, and game-breaking.

repeat wait() until blah
--Continue with code
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2014 10:06 PM
repeat isn't glitchy, and it's easy to replicate it:

while wait() and not blah do end
Report Abuse
PerpetualMovement is not online. PerpetualMovement
Joined: 04 Dec 2012
Total Posts: 1001
13 Jun 2014 10:07 PM
for i=1,10,1 do
print(i)
end
print'Done'
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
13 Jun 2014 10:08 PM
Though I do appreciate your reply, do you mind taking a look at my script seeing if it is one-line replaceable? Using repeat for it just destroys what I'm doing.
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
13 Jun 2014 10:09 PM
Wait nevermind. It's late anyways. I'll just experiment for a few days.
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
13 Jun 2014 10:14 PM
Okay. now I am really done. Can some one please look over this?! I am done. I tried almost everything! It's clear nothing I do will fix it.

-Coroutines
-Repeat
-While wait() do



>:|
Report Abuse
Convorus is not online. Convorus
Joined: 19 Jun 2013
Total Posts: 624
13 Jun 2014 10:15 PM
T = 1

for i = 1, T do
[SCRIPT HERE]
end


put your script in the blank spot. PM me if it worked :-)
Report Abuse
Convorus is not online. Convorus
Joined: 19 Jun 2013
Total Posts: 624
13 Jun 2014 10:16 PM
woops.

T = 1

for i = 1, T do
(Script actually here)
end
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
13 Jun 2014 10:17 PM
Thank you convorus, but I don't think that's what I need.
Report Abuse
Convorus is not online. Convorus
Joined: 19 Jun 2013
Total Posts: 624
13 Jun 2014 10:31 PM
k
Report Abuse
AMasterProgrammer is not online. AMasterProgrammer
Joined: 02 Apr 2013
Total Posts: 1608
13 Jun 2014 11:17 PM
event:wait()

Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
13 Jun 2014 11:36 PM
X = 1
repeat X = X + 1
print("Hi")
until X = 5

X = 1
while X ~= 5 do wait()
X = X + 1
print("Hi")
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2014 11:36 PM
War, no. They are different.

The second one would be

X = 1
X = X + 1
while X ~= 5 do
X = X + 1
print("Hi")
end
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
14 Jun 2014 09:48 AM
I tried 'while wait() do' --If statements.

And it still performs the same thing. It loops the 'Ended' value to true. Sick.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Jun 2014 09:54 AM
repeat wait() until blah

and

while not blah do wait() end



Should be the same
Report Abuse
WickedSiege is not online. WickedSiege
Joined: 03 Oct 2011
Total Posts: 3039
14 Jun 2014 10:00 AM
Do you want to see my script?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Jun 2014 04:44 PM
War, they are not.
If they were then repeat would not have been invented.

while = while-do
repeat = do-while
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Jun 2014 06:14 PM
That's my point

while not blah do--Will loop until blah (notice the "while NOT BLAH do" part)


repeat until blah--Will loop until blah




Those are the same. However

while blah do end

and

repeat until blah


Is not
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Jun 2014 06:16 PM
Wow do you not read the replies? You literally restate what I said.
And no. repeat x = x + 1 until blah is not the same as while not blah do x = x + 1 end

Learn what repeat and while loops are.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Jun 2014 06:17 PM
You literally reword* what I say
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Jun 2014 06:17 PM
I know what they are...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Jun 2014 06:18 PM
Then stop saying stuff that is wrong

repeat does code then checks "DO code WHILE condition"
while checks then does code "WHILE condition DO code"
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
14 Jun 2014 06:36 PM
I understand that but I tested this;

LoopType = "WhateverHereTestedBoth"
x = 0
blah = false

if LoopType:lower() == "loop" then
while not blah do
x = x + 1
print(x)
if x == 10 then
blah = true
end
wait()
end

elseif LoopType:lower() == "repeat" then
repeat
x = x + 1
print(x)
if x == 10 then
blah = true
end
wait()
until blah
end




I understand how it isn't doing the same thing, but it still outputs the same.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Jun 2014 06:43 PM
Yeah, but do this: x = 10
See what happens when you use repeat
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
14 Jun 2014 06:44 PM
No, your while just did the same as your repeat in that case.

Do this:

x = 10

repeat x = x + 1 print(x) until x >= 10
while x < 10 do x = x + 1 print(x) end

See why repeat is dangerous here?
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