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: "Until", the keyword

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 06:49 PM
Lost other thread qq

Anyways, can someone explain the blue keyword, "until" Like.. I was wondering if I could do this

game.Workspace.brick.Transparency = game.Worksapce.brick.Transparency + 0.1
until game.Workspace.brick.Transparency = 1
Report Abuse
janthran is not online. janthran
Joined: 15 May 2009
Total Posts: 17429
04 Nov 2013 06:50 PM
repeat code until bool
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 06:51 PM
repeat script until condition

i = 0

repeat

i = i + 1
print(i)
wait(0)

until

i > 500
Report Abuse
domorox17 is not online. domorox17
Joined: 06 Mar 2012
Total Posts: 1710
04 Nov 2013 06:52 PM
so its kinda like the opisate of a while loop?(ik im not the one who started this thread, but personally i didnt really know much about this)
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 06:52 PM
What?!
repeat?
Never heard of it.
Perhaps a loop?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 06:53 PM
No, they both work generally the same

repeat i = i + 1 until i == 5

could be written as

while i ~= 5 do
i = i + 1
end
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
04 Nov 2013 06:54 PM
It yields the code, and repeats the given code between repeat and until UNTIL the lines in front of until is true.

Ex.

number = 0
repeat number = number + 1 print(number)
until number == 5
Report Abuse
DevilDefeater is not online. DevilDefeater
Joined: 08 Jul 2013
Total Posts: 756
04 Nov 2013 06:54 PM
repeat code until conditionmet

ex:

repeat game.Workspace.Value = game.Workspace.Value + 1 until game.Workspace.Value = 5
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 06:56 PM
Workspace doesn't have a Value property

Unless you used some fenv, like:

setfenv(1, {game.Workspace.Value = 1})
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 06:58 PM
Uhh....
where you talking to teh guy who didnt start post, or were you talking to me?
Report Abuse
domorox17 is not online. domorox17
Joined: 06 Mar 2012
Total Posts: 1710
04 Nov 2013 06:59 PM
doesnt roblox often use stuf like
repeat wait(.1) until stuff ~= nil
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 07:03 PM
To devil

Though my code wouldn't work since I did it "psuedo style"
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 07:06 PM
puesedo? Wait.. nvm, please focus on my mouse.Hit.p post now :D thank you!
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 07:08 PM
This is the actual code

setfenv(1, {game = {Workspace = {Value = 1}}, print=print})
repeat
print(game.Workspace.Value)
game.Workspace.Value = game.Workspace.Value + 1
wait(0)
until false
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 07:17 PM
Can you go to my other post? Thanks!
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
04 Nov 2013 07:24 PM
Using "repeat-until" executes the body before checking the end condition. A "while" loop checks the conditions before executing the body.

repeat-until:

a = 1

repeat
a = a+1 -- executed
until a > 1 -- would have been false if the same argument was used for a while loop. Body is executed anyway.

print(a)

>2

while loop:

a = 1

while a > 1 do -- a is not equal to 0. Body is skipped.
a = a + 1 --skipped
end

print(a)

>1

If you know C++, a "repeat-until" is analogous to a "do-while" loop.
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
04 Nov 2013 07:25 PM
Whoops.

while a > 1 do -- a is not greater than 1. Body is skipped.

For the sake of correctness.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 08:19 PM
so....

game.Workspace.brick.Transparency = game.Workspace.brick.Transparency - 1
repeat

until game.Workspace.brick.Transparency = 1 -- or would I do >1
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 08:20 PM
repeat
game.Workspace.brick.Transparency = game.Workspace.brick.Transparency - 1
until game.Workspace.brick.Transparency = 1 -- or would I do >1



Like logic:

repeat TakeBiteOfFood until DinnerIsDone
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
04 Nov 2013 08:22 PM
wut.. lol
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 08:23 PM
repeat something until condition

repeat code until condition

repeat print("SPAM") Wait(1) until false --true will never be false, so this will keep printing spam ever 1 second until never
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
04 Nov 2013 08:23 PM
until forever*
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