"As long as you understand it I think it'll make sense." -BrawlDev
@الخلبوصة5 ай бұрын
Yes I liked my own comment
@henriquebigolin20065 ай бұрын
Eu gosto é assim Amostradinho💀
@liutenant-blob_pond2 ай бұрын
@@henriquebigolin2006💀🙏
@MeowToonYT22 күн бұрын
@@الخلبوصةbro commented more on this channel, than I ever commented on youtube💀
@MeowToonYT22 күн бұрын
@@الخلبوصةwhy is your handle from right to left, is it because your language reads from right to left, just some random comment from me to distract my self from the stress of scripting
@Ahmad_ALF4 ай бұрын
As a returning scripter, I find that there are barely any KZbinrs making tutorials on scripting, and the fact that this one is up-to-date with the current state of roblox studio, is just amazing. I definitely find episodes 10 and higher good for re-learning, the previous ones are easy to learn and never forget :D
@tntsuperslayer_10ttv3 ай бұрын
-- Loop through numbers from 1 to 100000 for i = 1, 100000 do -- Check if the current value of i is equal to 10 if i == 10 then print("i is equal to 10, so we'll skip this iteration") -- Instead of using continue, we'll use a workaround to skip the current iteration -- by simply not executing the following print statement else -- Print a message for each iteration that is not skipped or stopped print("Iteration number " .. i .. ": I'm still going strong!") end -- Check if the current value of i is equal to 200 if i == 200 then print("i has reached 200, breaking out of the loop") break -- Exit the loop entirely when i equals 200 end end --[[ print("Exited the for loop") -- A second loop that uses a while loop to demonstrate longer iteration control local counter = 1 -- Initialize a counter variable -- Continue looping as long as the counter is less than or equal to 10000000 while counter
@EnorMooseChannelАй бұрын
i like how its just a script talking to itself, schizophrenic script lol
@SnubbsStudio12 күн бұрын
i made a gold mining scriptamabob using the counter he taught us
@Zh1xyАй бұрын
Honestly, This has helped me out alot, Before, I tried 4 TIMES to get into scripting but could not find the right tutorials and they were to difficult for beginners as they would jump straight to advanced stuff. So, I thought to give this a try and now im HOOKED to this, I can confidently say, I have learnt alot from this series up till now and I hope to finish the advanced series as well.
@ItsukiXi23 күн бұрын
well well well do you still script
@Zh1xy23 күн бұрын
@@ItsukiXi Took a break after exams, so its been quite a while, i will def continue soon
@bazerduck12345 ай бұрын
instead of writing "counter = counter + 1" , you can write it shorter by saying "counter += 1" which basically means the same thing :) .
@arcticpandaros5705 ай бұрын
Ty brooda
@sammyawad49335 ай бұрын
good jo
@reaklaz4 ай бұрын
thanks needed that
@SniffishBowl3 ай бұрын
Ily
@Lol994102 ай бұрын
Thanks dude
@atotallylazyperson4 ай бұрын
bruh ppl are so lazy, there was 70k+ on ur 1st beginner vid now its legit less than a 10th of ur previous views like whats the point of watching when ur not even gonna finish the playlist bru or maybe they just watched ur first guide and never seen the playlist
@PHANTOMX7753 ай бұрын
Fr
@IHerDonuts5 күн бұрын
Less competition I guess
@AnnidoesstuffАй бұрын
here's what I did! -- The brackets and dash things disables the code local food = 1 while food
@self-aware.npc.Ай бұрын
Food aweeee
@manuelbur96248 күн бұрын
i rly fw this
@osakadev5 ай бұрын
Did you know that at least 9 million people have the same birthday as you? Summary of the video: Differences between break & continue: continue: Used in any loop to skip the current iteration of the loop (think an iteration as the total execution count of the loop, so the first time the loop runs, its iteration count will be 1, and then 2, and then 3, ect. So, if we are in the iteration 4, and we skip the 5th iteration, it would go from 4 to 6) Example: for i = 1, 10 do if i == 5 then continue end print(i) end -- This would print: 1, 2, 3, 4, 6, 7, 8, 9, 10 (5 is skipped) break: used to stop TOTALLY a loop, so it doesnt execute anymore and continue to the code below it.
@الخلبوصة5 ай бұрын
thx
@vsivasathvik45585 ай бұрын
where is "8" in the last comment?
@osakadev5 ай бұрын
@@vsivasathvik4558 i skipped it by accident, mb, fixed
@sourov_3 ай бұрын
Can we use continue in while loop?
@suprisedbeeiscute3 ай бұрын
wait i didnt understand continue and you just explained it perfectly tysm
@QuestsStudioАй бұрын
I finished this long ago but its always a good think to be back to basics! it gets overwhelming to remember simple stuff when things start to get complex.
@atotallylazyperson4 ай бұрын
Bro i was legit stuck on this specific problem with the loop and not running the other line and an hour later i solved it myself just to realize i couldve continued the plalist and watch your vid😢😢
@sannin45694 ай бұрын
for i = 1, 42000 do -- third value of i statement is default as 1 if i == 10 then print('index is currently at 10, skip this iteration') continue end print("another DEAD to gang violence") if i == 500 then break end end for i = 1, 15, 1 do -- prints after the break statement above print("you want this to print") end local count = 1 while count
@charliegogs5 ай бұрын
Yeah, just tried the 100000 loops thing and my computer stopped responding lmaoo
@arcticpandaros5705 ай бұрын
I did it twice and on the last one before he changed to counter I put i already ;CCCC
@JesseMinecraftXD4 ай бұрын
I did it on accident. Never doing that again XD
@LordRedDogeАй бұрын
Ive been watching these in order, I think you deserve another subscriber :) thanks for help
@egeerol10505 ай бұрын
I finished watching all your old beginner guide videos and today I saw your new beginner tutorial
@user-xx9jk6wm3v4 ай бұрын
here is what i did!! --[[for i = 1,100000 do if i ==10 then print('i is equal to 10 so skip this iteration. ') continue end if i== 200 then break end print('this statement is printed') end local counter=1 while counter
@scratchystuff11 күн бұрын
man this is the only playlist that actually help me memorize/learn, one time i saw a full video abt it and i forgot abt the code
@FallDoesStuff-1edf2 ай бұрын
Hey i have been binge watching your playlist, your tutorials are the best and i like how you make it slow paced on the editing unlike others!
@MonsterPunishers28 күн бұрын
I went back to the math tutorial and added some comments because I had a bit of trouble understanding. -- For addition, it takes these 2 numbers as an example and moves on to the result variable. as you can see, its adding those 2 numbers together (example numbers) -- Then it returns the result and ends the function. It creates a new variable and uses the addition function with 2 diffrent numbers. Thanks to the result variable, your able to add it because its taking those 2 example numbers and adding them. -- After that its just printing the print result. local function addition(number1, number2) local result = number1 + number2 return result end local printresult = addition(8,2) print(printresult) local function subtraction(number1, number2) local result = number1 - number2 return result end local printresult = subtraction(2, 2) print(printresult) local function division(number1, number2) local result = number1 / number2 return result end local printresult = division(8,2) print(printresult) local function multiplication(number1, number2) local result = number1 * number2 return result end local printresult = multiplication(2, 2) print(printresult)
@Johnnyjones2325 күн бұрын
6:42 brawl when you forgot to add the break i run the script and Roblox studio stoped working for on minute and then when I checked the output it said (this while statement is printed x4994 times)
@MyUsersCool2 ай бұрын
You can use the Spawn() function, it basically isolates the loop so it runs with the rest of the script without waiting for the loop to finish. This can come in handy in some situations
@re_heated2 ай бұрын
-- This for loop goes through 100000 iterations until certain conditions are met for i = 1, 100000 do if i == 10 then print("i is equal to 10, so skip this iteration") continue end if i == 200 then break end print("this statement is printed") end --[[local counter = 1 while counter
@ilamnotking2 ай бұрын
This is what I did for the Objective, a simple 1-100 number rolling system which has rarities and stops once you get a legendary for i = 1, 100 do task.wait(1) local z = math.random(1,100) if z >= 1 and z = 51 and z = 76 and z = 91 and z
@SLAYBOT_90004 ай бұрын
i just want to say so far this is 1 of the best tutorial series ive seen so far. im not that far into it yet but you xplain things really well
@Mystery001014 ай бұрын
*explain
@SLAYBOT_90004 ай бұрын
@@Mystery00101 i said what i said
@hiovr430Ай бұрын
For a lot of the scripts we have done i have been adding comments as notes for myCounter2 = 1, 5, 1 do print("statement B") end end -- For loops need 3 numbers 1. Start 2. End 3. Increment --Nested loops lets you place loops inside loops for i = 1, 100000 do print("statement printed") if i == 200 then break end end local counter = 1 while counter
@noobythenoobking5 ай бұрын
YEES IVE BEEN WAITING
@nahidwin-mn1ij2 ай бұрын
8:25 jokes on you I alr know about comments >:)
@DoTheEdit4 күн бұрын
do you know why task.wait is preferred over just wait?
@memebirbs8 сағат бұрын
- loops for s = 1, 1000000 do - if s is 9, print if s == 9 then print(“this is also a string”) continue end - if s is 500, stop the loop if s == 500 then break end - if none of those are met, print. print(“this is a string”) end
@danthon12672 күн бұрын
8:00 it didn't print 200, but 199... why?
@mostafaal-shafey916Ай бұрын
btw you can type counter += 1,insted of counter = counter =4:57 i know you know this but this is for the viewers:)
@anchor75493 ай бұрын
-- this for loop prints 'this is for my episode #12 learning objective' once when I -- is equal to 10 and 'keep printing me 20 times' for i = 1, 1000 do if i == 10 then print("This is for my episode #12 learning objective") continue end if i > 21 then break end print("keep printing me") end
@EEAASSEE27 күн бұрын
1:06 i thought his computer would crash (he didnt add wait to second fir loop)
@nootnoot737022 күн бұрын
for i = 0, 100 do if i % 2 == 0 then continue end print("iteration number: " .. i) end --this while loop print only even numbers local i = 0 while i
@ServantSinister3 ай бұрын
for i = 1, 100 do if i == 10 then print("skip this iteration") continue -- skip the rest of the code and go back up end print("Statement") end local counter = 0 while counter
@boxblox19864 ай бұрын
i crashed while trying to do while continue loops myself without finishing this vid :3 i found out that i forgot to make the while loops add loops so it ran inf
@MalekStarZ4 ай бұрын
for learning objective i made that : for i = 1,5 do local part66 = game.Workspace.part66 wait(0.1) part66.BrickColor = BrickColor.new("Really red") wait(0.1) part66.BrickColor = BrickColor.new("Gold") if i == 2 then part66.Transparency = 1 end if i == 2 then break end end -------------------------------------------------------------- for u = 1,10 do if u == 6 then print("skip this iteration") continue -- it will not write ("hi guys") for 6 times because I wrote continue end if u == 7 then -- if u reaches 7 times it will stop due to using break break end print("hi guys") --it will print hi guys for 5 times end --------------------------- for o = 1, 100 do if o == 50 then print("Nice Day") continue end if o == 70 then break end print("hello guys") end
@SLick313 күн бұрын
for k = 1,19 do if k == 50 then -- check if current value of k is 50 print("k is equal to 19, skipping the iteration") continue end print("this statement will be printed ") end local counter = 1 while counter
@DantePerozzi4 ай бұрын
definitely best series out there. you are bringing me from tutorial hell to this master piece of tutorials
@itsrichie9410Ай бұрын
for i = 1, 100 do if i == 10 then print("i is equal to 10, so skip this iteration") continue end if i == 50 then break end print("this statement is printed") end -- comments added for future uses, or describing something. this wont run inside scripts. local counter = 1 while counter
@CrimsonDaFurryFromQuebec4 ай бұрын
-- Counts up from 1 to 100 for Counter = 1, 100, 1 do -- Mentions in an external print statement that the counter is at 25 if Counter == 25 then print("Counter is at 25") continue end -- Mentions that the counter is at 50 and breaks loop if Counter == 50 then print("Counter is at 50") break end -- Prints the amount the counter is at (From 1 to 100 excepting 25 and 50 (stopped at 50 (I love parentheses))) print("Counter is at "..(Counter)) end
@cosmictony267120 күн бұрын
I love these tutorials they explain the concepts very well but I’m always stuck asking “why would I need to know/do this” because what game needs something printed 100 times or what game needs a function to add numbers together. I love these tutorials but I wish there were more actual use application examples
@ushwush2 ай бұрын
Short and simple this time: for number = 1, 50 do if number % 2 == 0 then print(number) continue end if number >= 20 then print("Love even numbers") break end end
@t8tenz704Ай бұрын
--This for loop goes through 100000 iterations until certain conditions are met for i = 1, 100000 do if i == 10 then print("i is equal to 10 so skip this iteration") continue end if i == 200 then break end print("This statement is printed") end -- print("hello") --[[ add aejh dfj zxh gff ]] --[[local counter = 1 while counter
@awabanga2 ай бұрын
local function testcounter() g = 0 for o = 1, 1000 do if o == 10 then print("O is now equal to ten") end if o == 400 then break end if g == 100 then g = o print('The value of G is now equal to O = 100') end print('O is now equal to' ..o.."") g = g + 1 end for i = 1, 100000 do if i ==10 then print("i is equal to" .. i .. ", so skip this iteration") end if i == 200 then break end print("This statement is printed. I =" .. i .."") end end testcounter() --ik that this is long as hell but i just want to make something that looks fancy lol
@SigmaMailRealOhio22 күн бұрын
--Conditions met to break a loop in code for i = 1, 100000 do if i == 10 then print("i is equal to 10, so thy code shall skip this iteration") continue end if i == 200 then break end end local counter = 1 while counter
@IAmMuFufuLoveJesusChristYipee5 ай бұрын
I feel like you noticed in the last vid in the comments where my script wouldn't together and this video you kinda included my comment in it XD
@easyrblxАй бұрын
i made this cool loading screen in the output u guys can try it if u want:) for myloop = 1, 10 do if myloop == 5 then print("Loading assets") task.wait(1) continue end if myloop == 10 then print("Starting") wait(5) print("Lets go") break end end
@trujer1931Ай бұрын
Here's what I put. -- Example 1 for i = 1, 100000 do if i == 10 then print("i is equal to 10, so skip this iteration") -- Tells me when it reaches 10. continue end if i == 50 then break -- If it reaches 50, stop. end print("end of for loop") end -- Example 2 for i = 1, 100000 do -- This for loop goes through 100000 iterations until certain conditions are met. if i == 10 then print("i is equal to 10, so skip this iteration") continue end if i == 20 then break end print("this statement is printed") end -- Example 3 local counter = 1 while counter
@Sphereheadbozo17 күн бұрын
local a = 1 while a < 20 do -- This will repeat until a is greater than 20 print("I really like cheese") if a == 10 then -- This will stop the loop and print something different than skip past number 11 print("I also like to eat cheese") a = a + 2 continue end if a == 11 then -- if this happens then there was an error in the code and it will stop the loop print("This was not supposed to happen....") break end a = a + 1 end
@Jackcosby_melonguy9000Ай бұрын
some of it don't work but i added it anyways (i didn't add any breaks because to the added one because yfge) -- this for loop goes through 100000 iterations until certain conditions for i = 1, 100000 do if i == 10 then print("i is equal to 10, so skip this iteration") continue end if i == 200 then break end -- print("hello") --[[ world ]] end print("printsuccesful") --[local zwei = 2] --[local i = 200] if not 2 - 200 == 5 then print("this equation is wrong (donald trump's way)") end --[[local counter = 1 while counter
@blade63095 ай бұрын
--You don't need a value to add each loop if the value would be 1 --[[for i = 1, 100000 do print("This statement is printed") if i == 200 then break end end ]] --[[local counter = 1 while counter = 900 then print("Time is up!") break --Checking if Raiders or Defenders have won elseif Def or Raid >= 500 then print("The round is over!") break --If no one has control else print("Time keeps ticking on...") end end --Simple timer for a single control point, Can't seem to detect what color the brick is and always instantly says the round is over
@MrPicklekvGygAАй бұрын
I don't think the purposes of break and continue were really articulated in this tutorial, but I guess I'll understand when the scripts get more sophisticated. My HW: --The following code of a for loop prints 100 times, skipping the 50th iteration and stopping at the 75th for i = 1, 100 do if i == 50 then print("Skip the 50th iteration") end if i == 75 then print("Stop at the 75th iteration") break end print("This is an iteration") end
@Clark-c3uАй бұрын
-- this script is a counter but it resets to 01 idk why -- local seconds = 0 local minutes = 0 local hours = 0 local part = game.Workspace.part while hours < 999 do while minutes < 59 do for i = 1, 60 do if i > 59 then seconds = 0 i = 0 part.SurfaceGui.TextLabel.Text = "00:00:00" else seconds += 1 part.SurfaceGui.TextLabel.Text = string.format("%02d:%02d:%02d", hours, minutes, seconds) task.wait(1) end end minutes += 1 end hours += 1 end
@poyrazz._ozbentt4 ай бұрын
Bro you are my favorite youtuber at this point you just look at my brain and answer my questions bro i finally found a tutorial that explains good and understandbly keep going your the best!
@thearchangeluniverse4 ай бұрын
i don't get the continue thing! pls help or explain a little futher! but here's my script local coco = game.Workspace.Coco for x = 1, 10 do print(x) if x == 3 then task.wait(2) coco.BrickColor = BrickColor.new("Really red") print("x was equal to 3, so the color changed to red") print("coco is red") coco.Transparency = 0.5 end if x == 4 then print("x was equal to 4, so we are moving on") continue end if x == 8 then print("x was equal to 8, so the script stopped") break end end
@TwigMan_15 ай бұрын
for i = 1, 1000 do print("incremental continue to go up") if i == 100 then print("this incremental is set too 100") continue end if i == 500 then print("this incremental is halfway to max") break end end --[[ local counter = 1 while counter
@LithuanianPresidency5 ай бұрын
local function loop() -- function executing the code for i = 1, 5000 do -- running the loops if i == 10 then print("i has runned 10 times") continue end if i == 217 then break end print("i") end end loop()
@realxprogameryt9014Ай бұрын
for i = 1, 20 do -- Check if the number is even if i % 2 == 0 then continue -- Skip to the next iteration if the number is even end -- Print the odd number print("Number:", i) -- Check if the number is greater than 15 if i > 15 then print("Breaking the loop at:", i) break -- Stop the loop if the number is greater than 15 end end
@Iplay_PCCАй бұрын
--This loop goes through 10000 iteratiions unyil certain conditions are met. for i = 1, 10000 do if i == 10 then print("i is equal to 10, so skip this iteration") continue end if i == 500 then break end print("This statement is printed") if i == 200 then break end end --[[local counter = 1 while counter
@건이-c9s2 ай бұрын
for congcong = 1, 500 do print("congcong") if congcong == 30 then print("congcong have 30") continue end if congcong == 100 then print("congcong is too many") break end end local abc = 1 while abc
@bobuxcartel40513 ай бұрын
for number = 1, 100 do if number % 2 ~= 0 then continue else print("This is an even number.") end end while true do if true then break end end
@vmc-mal5 ай бұрын
For some reason I was quite confused but in the end I understood, pretty cool stuff! --[[ Yo this is cool, so this is a comment with multiple lines! ]] --Continue for i = 1, 69 do if i == 10 then print("this is 10") continue end print("cool") end --Break for i = 1, 200 do print("ay, 69 times?") if i == 69 then break end end
@LightPlayzzАй бұрын
Me printing 100,000 messages watching my computer meltdown: Me realizing it only managed to print 5,000:
@benedekM2 ай бұрын
my basic work: local baseplate = game.Workspace.Baseplate for terulet = 1, 10000 do if terulet == 20 then print("terulet egyenlo 20") continue end if terulet == 30 then print("terulet egyenlo 30") continue end if terulet == 40 then baseplate.BrickColor = BrickColor.new("Really red") task.wait(2) continue end if terulet == 200 then baseplate.Transparency = 10 task.wait(2) continue end if terulet == 1000 then task.wait(5) baseplate.Transparency = 0 break end end
@z1ngetsuuАй бұрын
local i = 0 while i < 200 do i = i + 1 task.wait(0.2) if i == 51 then -- 51 becuase it stops 1 number before hitting the number it supposed to hit before breaking (someone explain to me why that happens) break -- skip the rest of this iteration and move on to the next iteration end print(i) end
@ClavedEdits19 күн бұрын
im basically writing a random script here its is: -- using for loops for i = 1, 1000000000000000000, 1 do if i == 666 then print("Skip this number, this number is horrid") continue end if i == 1000 then break end print("iam being printed out") end -- the same but using while loops local i = 1 while i < 1000000000000000000 do if i == 666 then print("Skip this number, this number is horrid") continue end if i == 1000 then break end print("iam being printed out using while loops") end
@blazerdoom686912 күн бұрын
for i = 1, 100000 do print("this statement is printed") if i == 10 then print("this statement is also printed") continue end if i == 200 then break end end
@MdkerMdxer3 ай бұрын
for Counter = 1, 10000 ,1 do if Counter == 10 then print("number1") continue end if Counter ==50 then print("number2") end print("helloooooooor") if Counter == 500 then break end end --[[ print("hello world") print("test41") --]]
@Mark-ki5kiАй бұрын
for a = 1, 100 do --[[This will check to see if a = 10, if it does than it will say its equal to 10, it will also check if its equal to 20 if it is than it will say its equal to 20. If not it will continue print ]] if a == 10 then print("a is equal to 10!") elseif a == 20 then print("a is equal to 20!") continue end -- This will break the print("a") loop if a == 50 then break end print("a") end
@space.1331114 күн бұрын
i have a question, if we dont want to execute THAT many numbers, then why put that number in the first place? Why not just go for for i = 1, 200, 1 do end instead of for i = 1, 100000, 1 do if i == 200 then break end end
@sm3llyfritz585 ай бұрын
I don’t recommend nested loops for you beginners because nested loops can cause a confusion for your coding so try not to nest your coding and be one of the never nesters but do use what brawl dev shows
@baconheadhair69385 ай бұрын
for “you” beginners?
@sm3llyfritz585 ай бұрын
@@baconheadhair6938 that was an auto but I meant it for everyone
@sm3llyfritz585 ай бұрын
@@baconheadhair6938 and this is a beginner tutorial so
@supper_tea78964 ай бұрын
I tried to make a nested loop, and I don't recommend doing one even if my code actually worked. It takes too long, and you need to be very careful in how you are organizing the different loops. If I hadn't known if statements, it would have been simply impossible, and I still had to use break and continue with the if statements, since something in the loops went wrong and I had to use other alternatives to end one and start the other.
@MrFancyfn4 ай бұрын
This is what i did: --This for lopp will print Brawldev 299 times for a = 1, 100000 do if a == 100 then print("a = 100,skip") continue end if a == 300 then break end print("Brawldev is goated") end
@P0k0c44 ай бұрын
I made working traffic lights with 3 Parts! I used if loop, variables, properties, task.wait() and Color3.fromRGB().
@nathanallred6634 ай бұрын
-- This for loop goes through 100000 interations until certain condeitionps are met for i = 1, 100000 do if i == 1000 then print("IT HAS PASSED ONE THOUSAND") end if i == 1100 then break end end thx man i love ya better then all the other videos
@PyjamaSethАй бұрын
what is “i” anyways?
@rodneysot4 ай бұрын
at this point i'm failing to understand what im making for players = 1, 10 do print("there are 10 players!") if players == 11 then print("it didn't work skipping this iteration") continue end print("the server is gonna crash") end local player = 7 while player >= 7 do print(" in paris") break end
@xans786921 күн бұрын
for i = 1, 100000 do if i == 10 then print("The value is 10 skip iteration") continue end print("Hello Babby") if i == 300 then break end end local ihelp = 1 while ihelp
@الخلبوصة5 ай бұрын
To all beginners watching this tutorial break and continue may sound pointless, but you will realize how useful they are later
@DevZammy2 ай бұрын
for hello = 1, 50 do if hello == 14 then print("this statement is cool") continue end end for bye = 1, 403 do if bye == 12 then print("this statement is good") break end end
@succ8215Ай бұрын
i truly do not understand the concept of continue statements. i get they skip an iteration but why would i want to do that? if my break hits 200 it ends but if i have it so when it hits 20 it continues it just skips 20 in the count. like whats the point i truly dont get it
@aidandoesanimations2 ай бұрын
here is da script if you wanna try it for urself you can: for i = 1, 100000 do if i == 10 then print("i is equal to 10, so skip this iteration!") continue end if i == 200 then break end end local counter = 1 while counter
@that-original-channel2 ай бұрын
My learning objective code! --[[ for i = 1, 100000 do if i == 10 then print("i equal to 10") continue end if i == 200 then break end print("Printed Statement") end ]] -- Basic Variables local bux = 0 local buxPersecond = 1 local buxBagSize = 10 -- While loop it checks for how much bux and add bux while true do if bux == 5 then print("Your bag is halfway full!") bux += buxPersecond print("$"..bux) continue end if bux == buxBagSize then -- Check if bag size has reached max print("Increase your bag size to get more Bux") else bux += buxPersecond print("$"..bux) end task.wait(1) -- Wait 1 second then redo loop end
@zaksscripts7269Ай бұрын
I combined the previous few episodes to come up with this. Also learnt a new concept with the help of gbt Man AI is making our life easier and is letting us learn anything way faster and efficient. Imagine how hard it would be back in the 2016 days to learn how to script local firstbreak = false for i = 1, 1000 do if not firstbreak and i == 100 then print("It is 100") firstbreak = true end if firstbreak and i
@BTalonH3 ай бұрын
-- Nested While Loop That Self Resets local count1 = 1 while count1
@dandewsirbelloАй бұрын
for i = 1,100 do local z = math.random(1,100) print(z) task.wait(1) if (z >= 1 and z = 50 and z = 76 and z = 91 and z
@creeperplayzz5 ай бұрын
Cool, now i know how break and continue works :)
@RexMarket5 ай бұрын
idk if this would help but here's something i cooked up for I = 1 , 500 do if I == 50 then print ("W BrawlDev") continue end if I == 200 then break end print("code has been broken") end local counter = 1 while counter
@dweezie802Ай бұрын
for L1 = 1, 6969 do-- loop 69k times print("loop") if L1 == 69 then-- if reached 69 print a word print("nice") continue end if L1 == 500 then-- if reached 500 print a word print("wow") break end end
@lolghost50412 ай бұрын
-- There's a 0.003% chance the loop stops local baseplate = game.Workspace.Baseplate while true do local color = math.random(1, 1032) for i = 1, 1032 do local color = math.random(1, 1032) baseplate.BrickColor = BrickColor.new(color) print("colors changed") task.wait(0.05) end if color >= 1000 then print("The color value is over 1000") break end task.wait(0.05) end
@-witherified-18432 ай бұрын
-- Defining what the part and the milestone is local part = game.Workspace.Part local milestone = 0 -- Function that picks a random value from 0 to 255 in each RGB value and picks the part's color to that random value local function randomizeColor() local red = math.random(0, 255) local green = math.random(0, 255) local blue = math.random(0, 255) part.Color = Color3.fromRGB(red, green, blue) milestone = milestone + 1 -- Printing out the milestone every 100th time it's reached if milestone % 100 == 0 then print("Milestone reached!") elseif milestone == 50 then print("Halfway there!") end end -- Loops the color randomization while true do randomizeColor() print("Randomizing your color!") wait(0.1) if milestone == 250 then break end end
@SimplyTutuco2 ай бұрын
Here's what I did for the learning objective! for airplaneCount = 1, 419 do if airplaneCount == 100 then print("100 airplane jackpot!!!") continue end print(airplaneCount) end theCoolestVariable = 1 while theCoolestVariable
@dabacon62634 ай бұрын
Here is what i did! for loop = 1, 10 do if loop == 10 then print("loop is equal to 10, so skip this iteration!") continue end print("i like eating burgers") end local chicken = 1 while chicken
@adammohamed-fx1cp4 ай бұрын
Also for pepole who dont know u can coment a whole code u can select it and do ctrl / and it will coment all the script or the pice you slected
@Reaces29 күн бұрын
I tried to complicate it a bit by adding breaks and continues in the same script, here's my code local ignoreIteration = math.random(1, 100) local endLoop = math.random(1,100) for N = 1, 100 do if N == ignoreIteration then print("skippedIteration") continue end if N == endLoop then if endLoop > ignoreIteration then print("endLoop") break else print("iteration unable to be ended") end end print(N) end
@couldntbeme8687Ай бұрын
-- ill attempt to make this change the colour of the baseplate til certain conditions are met local baseplate = game.Workspace.Baseplate for myCounter = 1, 100000 do baseplate.BrickColor = BrickColor.Random() wait(0.1) if baseplate.BrickColor == BrickColor.new("Toothpaste") then print("this") continue end if baseplate.BrickColor == BrickColor.new("Really red") then break end end --[[ local counter = 1 while counter
@Mrdrown36029 күн бұрын
local test = 0 while test
@one_grassАй бұрын
I don’t get how to use continue and break. I also don’t know what for loop and while loop are!!
@malaki3890Ай бұрын
Tried to make a short story line. print("I need to escape the matrix, but in order to do so I have to reach 100000...") task.wait(1) print("lets get started") for num=1,100000 do --first we are going to make it check if the value is equal to 10 if num==10 then print("we are currently at ten, still a ways to go.") task.wait(2) --here we are going to utilize the if else from the other videos to continue the sequence through the numbers elseif num==500 then print("we are currently at 500, still a long ways to go, but we can do it!") task.wait(2) -- keep adding values for each iteration, also wait times are in effect so its not instant. elseif num==10000 then print("we are almost there, we gotta get out of this matrix..") task.wait(2) -- just continuing with the story line elseif num==11500 then local baseplate=game.Workspace.Baseplate baseplate.BrickColor=BrickColor.Random() task.wait(1) baseplate.BrickColor=BrickColor.Random() task.wait(1) baseplate.BrickColor=BrickColor.Random() task.wait(1) print("whats happening?? the floor is changing color.. I must be close.") task.wait(5) --added a slight twist chaning the color of the floor to random colors on top of lines with dialogue. elseif num==100000 then print("Yayyy Freedom!!") task.wait(1) break --escaped the matrix! end end
@susguy_yk74307 күн бұрын
for i = 1, 5 do print("Hello..") if i == 3 then print("skip hello and print Hi! 5 times. then continue with the last 2 Hello's") for i = 1, 5 do print("hi!") end continue end end
@soyyoluca52483 ай бұрын
hello! I wrote this loop yet it didn't print anything. could you help me please? local mySecondCounter = -1 while mySecondCounter
@EmilBliksby2 ай бұрын
if you can tell me what you were trying to script i can maybe help you out