Breaks & Continues - Roblox Beginners Scripting Tutorial #12 (2024)

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ม.ค. 2025

ความคิดเห็น • 399

  • @الخلبوصة
    @الخلبوصة 6 หลายเดือนก่อน +307

    "As long as you understand it I think it'll make sense."
    -BrawlDev

    • @الخلبوصة
      @الخلبوصة 6 หลายเดือนก่อน +27

      Yes I liked my own comment

    • @henriquebigolin2006
      @henriquebigolin2006 6 หลายเดือนก่อน +10

      Eu gosto é assim Amostradinho💀

    • @liutenant-blob_pond
      @liutenant-blob_pond 3 หลายเดือนก่อน +4

      @@henriquebigolin2006💀🙏

    • @MeowToonYT
      @MeowToonYT หลายเดือนก่อน +2

      @@الخلبوصةbro commented more on this channel, than I ever commented on youtube💀

    • @MeowToonYT
      @MeowToonYT หลายเดือนก่อน +3

      @@الخلبوصة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_ALF
    @Ahmad_ALF 5 หลายเดือนก่อน +59

    As a returning scripter, I find that there are barely any TH-camrs 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

  • @ToughLuck-o2b
    @ToughLuck-o2b 14 วันที่ผ่านมา +3

    I have watched from #1 to #12 in one day, filling my journal with notes and having so much fun! I can't wait until I can learn the more advanced and involved scripting. I am loving your series so far and plan on watching your other roblox studio playlists. Thank you so much for making such helpful content!!!! :D

  • @bazerduck1234
    @bazerduck1234 6 หลายเดือนก่อน +96

    instead of writing "counter = counter + 1" , you can write it shorter by saying "counter += 1" which basically means the same thing :) .

    • @arcticpandaros570
      @arcticpandaros570 5 หลายเดือนก่อน

      Ty brooda

    • @sammyawad4933
      @sammyawad4933 5 หลายเดือนก่อน +3

      good jo

    • @reaklaz
      @reaklaz 5 หลายเดือนก่อน +5

      thanks needed that

    • @SniffishBowl
      @SniffishBowl 4 หลายเดือนก่อน

      Ily

    • @Lol99410
      @Lol99410 3 หลายเดือนก่อน +1

      Thanks dude

  • @atotallylazyperson
    @atotallylazyperson 4 หลายเดือนก่อน +24

    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

    • @PHANTOMX775
      @PHANTOMX775 4 หลายเดือนก่อน +1

      Fr

    • @IHerDonuts
      @IHerDonuts 28 วันที่ผ่านมา +4

      Less competition I guess

    • @angolanchopsquad
      @angolanchopsquad 22 วันที่ผ่านมา +1

      people don't need to share the same interests as us they're not lazy.

  • @Zh1xy
    @Zh1xy 2 หลายเดือนก่อน +12

    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.

    • @ItsukiXi
      @ItsukiXi หลายเดือนก่อน

      well well well do you still script

    • @Zh1xy
      @Zh1xy หลายเดือนก่อน +1

      @@ItsukiXi Took a break after exams, so its been quite a while, i will def continue soon

    • @HyperClock0
      @HyperClock0 7 วันที่ผ่านมา

      @@Zh1xy how is it now

    • @jerryblades5022
      @jerryblades5022 ชั่วโมงที่ผ่านมา

      @@Zh1xy any games yet

  • @SolarSavvy-im-happy
    @SolarSavvy-im-happy 19 วันที่ผ่านมา +6

    sometimes BrawlDev explains a concept, and i wonder what the heck i'm going to use it for, for example, breaks, if you want your script to run 200 times, then set it to 200 why use breaks, but then i realised that if you pair this with variables it can be crucial for making levels and xp

  • @tntsuperslayer_10ttv
    @tntsuperslayer_10ttv 4 หลายเดือนก่อน +19

    -- 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
      @EnorMooseChannel 2 หลายเดือนก่อน +2

      i like how its just a script talking to itself, schizophrenic script lol

    • @SnubbsStudio
      @SnubbsStudio หลายเดือนก่อน

      i made a gold mining scriptamabob using the counter he taught us

  • @QuestsStudio
    @QuestsStudio หลายเดือนก่อน +2

    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.

  • @atotallylazyperson
    @atotallylazyperson 4 หลายเดือนก่อน +9

    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😢😢

  • @charliegogs
    @charliegogs 6 หลายเดือนก่อน +28

    Yeah, just tried the 100000 loops thing and my computer stopped responding lmaoo

    • @arcticpandaros570
      @arcticpandaros570 5 หลายเดือนก่อน

      I did it twice and on the last one before he changed to counter I put i already ;CCCC

    • @Hi_py
      @Hi_py 21 วันที่ผ่านมา

      I did it and it only did 5k ( i got a ryzen 5650

  • @sannin4569
    @sannin4569 5 หลายเดือนก่อน +7

    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

  • @Annidoesstuff
    @Annidoesstuff 2 หลายเดือนก่อน +11

    here's what I did!
    -- The brackets and dash things disables the code
    local food = 1
    while food

  • @osakadev
    @osakadev 6 หลายเดือนก่อน +56

    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.

    • @الخلبوصة
      @الخلبوصة 6 หลายเดือนก่อน +3

      thx

    • @vsivasathvik4558
      @vsivasathvik4558 6 หลายเดือนก่อน +1

      where is "8" in the last comment?

    • @osakadev
      @osakadev 6 หลายเดือนก่อน +1

      @@vsivasathvik4558 i skipped it by accident, mb, fixed

    • @sourov_
      @sourov_ 4 หลายเดือนก่อน

      Can we use continue in while loop?

    • @socalled-chickenman
      @socalled-chickenman 4 หลายเดือนก่อน

      wait i didnt understand continue and you just explained it perfectly tysm

  • @FallDoesStuff-1edf
    @FallDoesStuff-1edf 3 หลายเดือนก่อน

    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!

  • @Johnnyjones23
    @Johnnyjones23 หลายเดือนก่อน +1

    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)

  • @LordRedDoge
    @LordRedDoge 2 หลายเดือนก่อน +1

    Ive been watching these in order, I think you deserve another subscriber :) thanks for help

  • @egeerol1050
    @egeerol1050 6 หลายเดือนก่อน +2

    I finished watching all your old beginner guide videos and today I saw your new beginner tutorial

  • @MyUsersCool
    @MyUsersCool 3 หลายเดือนก่อน +1

    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

  • @pugaburger398
    @pugaburger398 5 หลายเดือนก่อน +2

    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

  • @SLAYBOT_9000
    @SLAYBOT_9000 5 หลายเดือนก่อน

    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

    • @Mystery00101
      @Mystery00101 5 หลายเดือนก่อน

      *explain

    • @SLAYBOT_9000
      @SLAYBOT_9000 5 หลายเดือนก่อน

      @@Mystery00101 i said what i said

  • @scratchystuff
    @scratchystuff หลายเดือนก่อน

    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

  • @MwinDev
    @MwinDev 17 วันที่ผ่านมา

    This helped me a LOT learning scripting!

  • @susguy_yk7430
    @susguy_yk7430 หลายเดือนก่อน +1

    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

  • @user-bu3eh4wl7d
    @user-bu3eh4wl7d 3 ชั่วโมงที่ผ่านมา +1

    --[[testing
    bracket]]
    for goo = 1,100,1 do
    print("counting currently")
    if goo ==10 then
    print("goo is now at 10")
    task.wait(5)
    --unanchors ball 1
    workspace.greenba.Anchored=false
    task.wait(1)
    end
    if goo ==30 then
    print("goo is now at 30")
    task.wait(5)
    --unanchors ball 2
    workspace.yellowba.Anchored=false
    task.wait(1)
    end
    if goo >=50 then
    -- im gonna make the ball fall slower on 50
    print("its over 50. time to stop.")
    task.wait(5)
    --unanchors ball 3
    workspace.Gravity = 20
    workspace.redba.Anchored=false
    print("wait 5 seconds for normal gravity")
    task.wait(5)
    workspace.Gravity= 196
    print("one seconds passed. now breaked")
    break
    end
    end

  • @SSide_Quest
    @SSide_Quest 20 วันที่ผ่านมา

    --My work

  • @boxblox1986
    @boxblox1986 5 หลายเดือนก่อน +2

    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

  • @MonsterPunishers
    @MonsterPunishers หลายเดือนก่อน

    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)

  • @DantePerozzi
    @DantePerozzi 5 หลายเดือนก่อน

    definitely best series out there. you are bringing me from tutorial hell to this master piece of tutorials

  • @sm3llyfritz58
    @sm3llyfritz58 6 หลายเดือนก่อน +3

    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

    • @baconheadhair6938
      @baconheadhair6938 6 หลายเดือนก่อน

      for “you” beginners?

    • @sm3llyfritz58
      @sm3llyfritz58 6 หลายเดือนก่อน +1

      @@baconheadhair6938 that was an auto but I meant it for everyone

    • @sm3llyfritz58
      @sm3llyfritz58 6 หลายเดือนก่อน

      @@baconheadhair6938 and this is a beginner tutorial so

    • @supper_tea7896
      @supper_tea7896 4 หลายเดือนก่อน

      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.

  • @3abier_spiel
    @3abier_spiel 13 ชั่วโมงที่ผ่านมา

    for conter = 2, 100, 2 do
    print("Hello")
    print("Hi")
    if conter == 9 then
    print("hello print me")
    end
    if conter == 10 then
    print("meow")
    end
    if conter == 13 then
    print("Helllloooooo")
    end
    if conter == 14 then
    print("don't skip me")
    end
    if conter == 16 then
    print("ok stop that")
    break
    end
    end
    local zconter = 1
    while zconter

  • @poyrazz._ozbentt
    @poyrazz._ozbentt 5 หลายเดือนก่อน

    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!

  • @sethkingsbury4067
    @sethkingsbury4067 10 วันที่ผ่านมา

    simple silly countdown
    for counter = 10, 1, -1 do
    if counter == 5 then
    print(" 5 seconds left????")
    task.wait(1)
    continue
    end
    print(counter)
    task.wait(1)
    end

  • @nahidwin-mn1ij
    @nahidwin-mn1ij 3 หลายเดือนก่อน +1

    8:25 jokes on you I alr know about comments >:)

  • @memebirbs
    @memebirbs 23 วันที่ผ่านมา

    - 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

  • @OsosAmin
    @OsosAmin 22 วันที่ผ่านมา +1

    Thanks bro for this amazing vidoes and tutorial and that my script and hope anyone use it!!
    --this is for loop goes through 100000 iterations until certain conditions are meet
    for i = 1, 10000 do
    if i == 10 then
    print(" i is equal to 10 so, skip this!!")
    continue
    end

    if i == 200 then
    break
    end

    print("this statement is printed")
    end
    local counter = 1
    while counter

  • @DoTheEdit
    @DoTheEdit 27 วันที่ผ่านมา +1

    do you know why task.wait is preferred over just wait?

  • @adammohamed-fx1cp
    @adammohamed-fx1cp 5 หลายเดือนก่อน +1

    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

  • @mostafaal-shafey916
    @mostafaal-shafey916 2 หลายเดือนก่อน

    btw you can type counter += 1,insted of counter = counter =4:57
    i know you know this but this is for the viewers:)

  • @IAmMuFufuLoveJesusChristYipee
    @IAmMuFufuLoveJesusChristYipee 6 หลายเดือนก่อน +1

    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

  • @PyjamaSeth
    @PyjamaSeth 2 หลายเดือนก่อน +3

    what is “i” anyways?

    • @Eccota
      @Eccota 23 วันที่ผ่านมา +1

      its just a variable commonly used for iteration

    • @cutesy2282
      @cutesy2282 21 วันที่ผ่านมา

      @@Eccotawhat’s an iteration

  • @nootnoot7370
    @nootnoot7370 หลายเดือนก่อน +1

    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

  • @MaidYu
    @MaidYu 14 วันที่ผ่านมา +1

    on the comments if you high light the code and do command question mark it'll make it a comment

  • @JustEvanC
    @JustEvanC 11 วันที่ผ่านมา

    Silly me forgot "counter = counter + 1" and crashed Roblox Studio😅

  • @SLick31
    @SLick31 27 วันที่ผ่านมา

    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

  • @hiovr430
    @hiovr430 2 หลายเดือนก่อน

    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

  • @re_heated
    @re_heated 3 หลายเดือนก่อน

    -- 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

  • @MrFancyfn
    @MrFancyfn 5 หลายเดือนก่อน +1

    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

  • @Joker-gh9jt
    @Joker-gh9jt 22 วันที่ผ่านมา +1

    why task.wait(1) and not wait(1).

  • @couldntbeme8687
    @couldntbeme8687 หลายเดือนก่อน +1

    -- 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

  • @cosmictony2671
    @cosmictony2671 หลายเดือนก่อน

    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

  • @anchor7549
    @anchor7549 3 หลายเดือนก่อน +4

    -- 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

  • @MalekStarZ
    @MalekStarZ 4 หลายเดือนก่อน +3

    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

  • @EEAASSEE
    @EEAASSEE หลายเดือนก่อน

    1:06 i thought his computer would crash (he didnt add wait to second fir loop)

  • @angiehernandez7140
    @angiehernandez7140 วันที่ผ่านมา

    I've always had a hard time learning loops- but this episode taught me so much, thanks! This is my code (don't be discouraged and don't give up! I nearly gave up myself, but always keep in mind of your ultimate goals!)
    local function yourLevel ()
    for i = 1,10,1 do
    local LevelPrinted = math.random(1,500)

    if LevelPrinted 100 and LevelPrinted 200 and LevelPrinted 300 and LevelPrinted 400 and LevelPrinted

  • @realxprogameryt9014
    @realxprogameryt9014 2 หลายเดือนก่อน

    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

  • @FinAnimations178
    @FinAnimations178 19 วันที่ผ่านมา +1

    local block = game.Workspace.Part
    local function RGBPART()
    print("RGBPART function started")
    for i = 1, 100, 1 do
    task.wait(0.25)
    block.BrickColor = BrickColor.new(255, 0, 0)
    task.wait(0.25)
    block.BrickColor = BrickColor.new(0, 255, 0)
    task.wait(0.25)
    block.BrickColor = BrickColor.new(0, 0, 255)
    if i == 10 then
    print("Color changed 30 times!")
    end
    end
    end
    RGBPART()

  • @itsrichie9410
    @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

  • @ushwush
    @ushwush 3 หลายเดือนก่อน

    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

  • @easyrblx
    @easyrblx 2 หลายเดือนก่อน

    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

  • @marcelotapia5685
    @marcelotapia5685 5 วันที่ผ่านมา

    5:22 forgot to put counter = counter + 1 and it crashed lol

  • @Monika-kn7ed
    @Monika-kn7ed วันที่ผ่านมา

    6:40 LMAO I TRIED TO DO THE EXAMPLE BY MYSELF AND I ALSO FORGOT TO BREAK THE SCRIPT LOLLLLL

  • @noobythenoobking
    @noobythenoobking 6 หลายเดือนก่อน

    YEES IVE BEEN WAITING

  • @MrPicklekvGygA
    @MrPicklekvGygA 2 หลายเดือนก่อน

    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

  • @fnumtxer
    @fnumtxer 8 วันที่ผ่านมา

    for i = 1, 100000 do

    if math.random(1, 10) == 10 then -- skips randomly (chances are high, I don't want it to just skip once)
    print("skip this iteration")
    continue
    end

    if math.random(1, 200) == 1 then -- breaks randomly
    print("the loop has stopped on loop", i)
    break
    end
    print("there has been", i, "printed loops") -- shows the loop you are on.
    end

  • @fournumm
    @fournumm 2 หลายเดือนก่อน

    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

  • @ServantSinister
    @ServantSinister 4 หลายเดือนก่อน

    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

  • @SigmaMailRealOhio
    @SigmaMailRealOhio หลายเดือนก่อน

    --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

  • @CrimsonDaFurryFromQuebec
    @CrimsonDaFurryFromQuebec 4 หลายเดือนก่อน

    -- 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

  • @blazerdoom6869
    @blazerdoom6869 หลายเดือนก่อน

    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

  • @t8tenz704
    @t8tenz704 2 หลายเดือนก่อน

    --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

  • @aslanundatesch
    @aslanundatesch 4 วันที่ผ่านมา

    --this is my sript for loops and breaks
    for a = 1, 10000 do
    if a == 10 then
    print("skip")
    continue --here is the continue
    end

    if a == 300 then
    print("stop")
    break --here is the break
    end
    end

  • @LightPlayzz
    @LightPlayzz 2 หลายเดือนก่อน

    Me printing 100,000 messages watching my computer meltdown:
    Me realizing it only managed to print 5,000:

  • @الخلبوصة
    @الخلبوصة 6 หลายเดือนก่อน

    To all beginners watching this tutorial
    break and continue may sound pointless, but you will realize how useful they are later

  • @건이-c9s
    @건이-c9s 3 หลายเดือนก่อน

    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

  • @KianRBX-g5i
    @KianRBX-g5i 2 หลายเดือนก่อน

    --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

  • @creeperplayzz
    @creeperplayzz 6 หลายเดือนก่อน

    Cool, now i know how break and continue works :)

  • @aaronbass8211
    @aaronbass8211 11 วันที่ผ่านมา

    heres what i did for a while loop example:
    --while loop example--
    local dog = 1
    while dog = 100 then
    print("No, it's a wolf!") --when dogVariable reaches
    break -->=100 it will print this once
    end --and break the code to end the
    -- whole while loop.
    end
    --output:
    --This is a dog. (x99)
    --No, it's a wolf!
    --[[ both 'if' statements run, but since the second reads back as false
    only the first 'if' stment
    will actually fire. bc it skips the second one, bc of it stating
    false, but when dogVariable reaches 100, it is true and runs:
    and breaks the code block after the 2nd 'if' statement code block is over. ]]

  • @awabanga
    @awabanga 2 หลายเดือนก่อน

    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

  • @ClavedEdits
    @ClavedEdits หลายเดือนก่อน

    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

  • @Sphereheadbozo
    @Sphereheadbozo หลายเดือนก่อน

    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

  • @enzojg2012-he7xi
    @enzojg2012-he7xi หลายเดือนก่อน

    -- its a loop
    for i = 1, 100000 do
    if i == 10 then
    print("i is equal to 10, so skip that iteration")
    continue
    end

    if i == 100 then
    print("is it working")
    end

    if i == 203 then
    break
    end

    print("this statement is printed")
    end
    -- this loop is off
    --[[local counter = 1
    while counter

  • @zaksscripts7269
    @zaksscripts7269 2 หลายเดือนก่อน

    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

  • @WildPlanetShorts1
    @WildPlanetShorts1 2 หลายเดือนก่อน

    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

  • @dabacon6263
    @dabacon6263 5 หลายเดือนก่อน

    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

  • @StepHela
    @StepHela วันที่ผ่านมา

    local mywhileloop = 1
    while mywhileloop

  • @PixelPenguin518
    @PixelPenguin518 7 วันที่ผ่านมา

    Here is a timer script using a while loop.
    local counter = 1
    while counter = 1 do
    script.Parent.Text = counter + 1
    task.wait(1)
    counter = counter + 1
    if counter == 10 then
    break
    end
    end
    The differences here is in the first once to not have to use a break loop I said while counter is =1 which means if I never added the break loop, it would go on forever.

  • @sahal6723
    @sahal6723 2 หลายเดือนก่อน

    I was expecting something like repeat or something. Like the baseplate color keeps changing repeatedly forever, until tell the script to stop it

  • @aidandoesanimations
    @aidandoesanimations 2 หลายเดือนก่อน

    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

  • @succ8215
    @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

  • @vmc-mal
    @vmc-mal 6 หลายเดือนก่อน

    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

  • @bobisbob1933
    @bobisbob1933 11 วันที่ผ่านมา

    uhh i didnt really know what to do so i just copied ur code but alternated it
    for i = 1, 100000 do
    if i == 15 then
    print("i is equal to 15 so skip")
    continue
    end
    if i == 1000 then
    break
    end

    print("This statement is printed")
    end

  • @TwigManGames
    @TwigManGames 6 หลายเดือนก่อน

    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

  • @Powascal
    @Powascal 2 หลายเดือนก่อน

    for t = 1, 61 do
    if t == 10 then
    print ("You've been here for 10 seconds!")
    continue
    end

    if t == 30 then
    print ("Half a minute! Almost there!")
    continue
    end

    if t == 60 then
    print ("You've done it! Good job!")
    break
    end

    task.wait(1)
    end
    --this is an amazing timer that rewards you for time

  • @SimplyTutuco
    @SimplyTutuco 3 หลายเดือนก่อน

    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

  • @MdkerMdxer
    @MdkerMdxer 4 หลายเดือนก่อน

    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")
    --]]

  • @GuruleGaming
    @GuruleGaming 5 วันที่ผ่านมา

    i already knew about comments lol i use them in almost every script

  • @Mark-ki5ki
    @Mark-ki5ki 2 หลายเดือนก่อน

    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

  • @nathanallred663
    @nathanallred663 4 หลายเดือนก่อน

    -- 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

  • @bobuxcartel4051
    @bobuxcartel4051 4 หลายเดือนก่อน

    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