Operators - Roblox Beginners Scripting Tutorial #10 (2024)

Поделиться
HTML-код
  • Опубликовано: 27 дек 2024

Комментарии • 513

  • @Cosmic99Gaming
    @Cosmic99Gaming 4 месяца назад +134

    you explain everything so well unlike other youtubers.
    Edit: not to be that guy but this is the most likes I’ve ever gotten on a comment 💀

  • @essence2176
    @essence2176 3 месяца назад +44

    you explain everything so good. Never understood better. in fact, you teach better than most of the teachers in my school.

  • @NotLostinbilling
    @NotLostinbilling 5 месяцев назад +44

    Here's the goofy script I made. I tried to combine most of the scripting tutorials so far. It checks to see if 2 * 2 = 6, (which it doesn't) Because it doesn't add up to the number it makes a bunch of changes to the baseplate. However, if I put 2 * 3 = 6 (which it does) That would cause a print in the output.
    local addition = 2 * 2 == 6
    if addition then
    print("3 + 3 is equal to 6!")
    else
    game.Workspace.Baseplate.Material = Enum.Material.Grass
    wait(5)
    game.Workspace.Baseplate.Material = Enum.Material.Plastic
    wait(3)
    game.Workspace.Baseplate.Transparency = 1
    game.Workspace.Baseplate.Anchored = false
    end

    • @Ducky14
      @Ducky14 5 месяцев назад +1

      nice

    • @Nox2000YT
      @Nox2000YT 4 месяца назад +1

      this guy is going places

    • @cookiesrb
      @cookiesrb 4 месяца назад +5

      remember variables to not have to write game.Workspace.Baseplate over and over, good job though!

    • @Klopaz111
      @Klopaz111 4 месяца назад +2

      you don't have to type game.Workspace.Baseplate you can just make your script a child of the baseplate then replace game.Workspace.Baseplate with script.parent (sorry if this was not so clear to read)

    • @atotallylazyperson
      @atotallylazyperson 4 месяца назад +2

      script got mad that 2 times 2 doesnt equal six and just made the baseplate fall into the void

  • @osakadev
    @osakadev 6 месяцев назад +71

    How can I hack a bank with LUAU to get infinite robux? Help me brawl
    Btw here's the list of all operators I know:
    Math operators
    + Addition or concatenation
    - substraction
    / Division
    ^ Power
    // Floor division
    % Modulus
    * Multiplication
    Other operators
    .. Strings concatenation
    Logical operators
    == Condition
    > Greater than
    < Less than
    >= Greater or equal

    • @Mah_guy
      @Mah_guy 5 месяцев назад +10

      i think you have to do that in assembler 💀

    • @stuningflamingo2558
      @stuningflamingo2558 3 месяца назад +8

      here's a free money machine with luau
      money = inf
      print(money)

    • @CrowCant
      @CrowCant 3 месяца назад +1

      @@stuningflamingo2558 now I’m going to be rich. Let’s gooo

    • @Kapruz
      @Kapruz 3 месяца назад

      ​@@stuningflamingo2558inf doesnt exist use math.huge

    • @ProChanPlayz
      @ProChanPlayz 3 месяца назад +2

      local money = "inf"
      print(money)

  • @KingDumpling2013
    @KingDumpling2013 19 дней назад +3

    it works MY CODE
    local me = 1 + 9
    local uwu = 1 + 11
    local dance = game.Workspace.Baseplate
    local function change()
    if me == 2 then
    print("yes it is two")
    elseif me == 10 then
    dance.Anchored = false
    print("time to dance")
    elseif me == 9 and uwu == 12 then
    print("give me that yessssssssssssssss")
    elseif uwu

  • @SolarSavvy-im-happy
    @SolarSavvy-im-happy 10 дней назад +3

    guys the greater than or equal to is important, this is how level requirements in games are made

  • @LucasJohnson-pb1xn
    @LucasJohnson-pb1xn 3 месяца назад +17

    Here is what i did
    if 2 + 2 == 4 then
    print("2 + 2 is equal to four!")
    end
    if 4 + 6 > 10 - 6 then
    print("4 + 6 is greater than 10 - 6")
    end
    if 2 + 5 == 2 or 4 + 6 >= 9 then
    print("Correct Number One")
    end
    if 2 + 8 >= 7 or 3 - 6 < 2 then
    print("Correct Number Two")
    end
    if 9 / 3 == 4 and 8 / 4 >= 2 then
    print("Correct Number Three")
    end

    • @Jurassic_Animator
      @Jurassic_Animator 14 дней назад

      Use elseif

    • @wabuymi
      @wabuymi 11 дней назад

      @@Jurassic_Animator why?

    • @memq1543
      @memq1543 11 дней назад

      @@Jurassic_Animator
      it wouldnt have worked in this situation
      if 2 + 2 == 4 then
      print("2 + 2 is equal to 4")

      elseif 5 + 5 == 10 then
      print("this wont print because the first if statement is correct")

      end
      if 2 + 2 == 8 then
      print("this wont print because its wrong lol")

      elseif 2 + 2 == 4 then
      print("this will print because its correct")

      end

  • @Qualet-h7m
    @Qualet-h7m 16 дней назад +1

    I found that writing all this on my giant wall whiteboard is a good way of remembering it, espeacially if its near the door so you always see it

  • @RosaTheRobloxian
    @RosaTheRobloxian 20 дней назад +1

    Brawl Dev , MY Saviour , Thank you so much for Releasing this Awsome playlist , this Is Litrally better then Any developing roblox games Playlist I've ever watched , You seriously Don't understand How Happy I was When I Created my first working script Cuz of ur videos .

  • @supergamio6493
    @supergamio6493 10 дней назад +3

    just wondering, does the 'a and b or c and d' line of code work like:
    [a and b] OR [c and d]
    or
    a AND [b or c] AND d

    • @arturorg0
      @arturorg0 3 дня назад

      a and b or c and d --> [a and b] OR [c and d]
      In case you had 'a and b or c' --> [a and b] or c
      In Lua all values are consired true except nil and false, even 0 is true.
      So for example:
      local a, b, c, d = 1, 3, 2, 2
      if a and b or c and d == 4 then
      print("Printing this cause A and B equals 4 or C and D equals 4.")
      end
      This code wouldn't work because it's saying:
      a and b :
      > a is 1 (truth), so a and b equals to b, which is 3.
      c and d == 4:
      > Due to operator precedence (==), this is equivalent to c and (d == 4).
      > d == 4 evaluates to false because d is 2.
      > c and false evaluates to false because c is truth but 'and' shortcircuits on false.
      So a and b or c and d == 4 would equals to:
      if 3 or false then:
      and 3 is truth, so the whole condition evaluates to true.
      So to make this stop working, we have to change the value of b to false (3 to false) and everything would stop working, so the whole condition evaluates to false.
      OR we can fix it by using () -->
      local a, b, c, d = 1, 3, 2, 2
      if (a + b == 4) or (c + d == 4) then
      print("Printing this cause A and B equals 4 or C and D equals 4.")
      end
      So in this case a + b doesn't equal 4, but c+d does equal 4, so the condition is met.

    • @karaokelad7335
      @karaokelad7335 3 дня назад +1

      a and b or c and d --> [a and b] OR [c and d]
      In case you had 'a and b or c' --> [a and b] or c
      In Lua all values are consired true except nil and false, even 0 is true.
      So for example:
      local a, b, c, d = 1, 3, 2, 2
      if a and b or c and d == 4 then
      print("Printing this cause A and B equals 4 or C and D equals 4.")
      end
      This code wouldn't work because it's saying:
      a and b :
      > a is 1 (truth), so a and b equals to b, which is 3.
      c and d == 4:
      > Due to operator precedence (==), this is equivalent to c and (d == 4).
      > d == 4 evaluates to false because d is 2.
      > c and false evaluates to false because c is truth but 'and' shortcircuits on false.
      So a and b or c and d == 4 would equals to:
      if 3 or false then:
      and 3 is truth, so the whole condition evaluates to true.
      So to make this stop working, we have to change the value of b to false (3 to false) and everything would stop working, so the whole condition evaluates to false.
      OR we can fix it by using () -->
      local a, b, c, d = 1, 3, 2, 2
      if (a + b == 4) or (c + d == 4) then
      print("Printing this cause A and B equals 4 or C and D equals 4.")
      end
      So in this case a + b doesn't equal 4, but c+d does equal 4, so the condition is met.

  • @HanditikRoblox
    @HanditikRoblox 5 дней назад +1

    if 100 + 100.01 >= 200 then
    print("gotta go sweep sweep sweep")
    end

  • @tsaroftheunion
    @tsaroftheunion 3 месяца назад +4

    8:45 It's called a tilde for anyone wondering.

    • @JupiterAngles
      @JupiterAngles Месяц назад +1

      And you can just copy it if you want to. "~"

  • @slayr5585
    @slayr5585 11 дней назад +1

    if 2+3>=4 and 5+5==10 then
    print("Right!")
    else
    print("Try next time")
    end

  • @Timuçinn1
    @Timuçinn1 4 месяца назад +2

    local function addition(n1, n2)
    if n1 + n2 == 10 then
    print("true")
    else
    print("false")
    end
    end
    addition(5, 5)

  • @MeowToonYT
    @MeowToonYT 26 дней назад +1

    I spent thousands of dollars on a scripting course, and still learn more from you.💀

  • @MiAep07
    @MiAep07 4 месяца назад +10

    I did not understood this properly. I learnt all the functions from the previous episodes. But, I don't know what functions/systems I can make.

    • @PeeaaNuutt
      @PeeaaNuutt 4 месяца назад +4

      This is kind of long, but I hope this helps a little bit...
      I would try practicing in Roblox Studio some random functions just for amounts of parts in your workspace or something... example, if you have 5 box parts, or sphere parts, or whatever else, then make a simple script similar to:
      local function numberOfBoxes() --This can be called anything you want, so even num, or numBoxes, etc...
      local number = 5 --There are 5 boxes total in my workspace, but you can change this to whatever number you want.

      if number == 5 then
      print("The number of boxes is equal to 5!") --This will be printed if the number is 5.
      elseif number > 5 then
      print("The number of boxes is greater than 5!") --This will be printed if the number is greater than 5.
      elseif number < 5 then
      print("The number of boxes is less than 5!") --This will be printed if the number is less than 5.
      else
      print("There must have been a mistake!") --This will be printed if none of the above is true.
      end
      return number --(Optional) returns the number value
      end
      local number = numberOfBoxes() -- You need to add this. Change "number" and "numberOfBoxes" to whatever you changed at the top, if you changed any of those.
      print("Number of boxes:", number) --(Optional) Prints "Number of boxes:" then the returned number
      print("Done...") -- (Optional) Just to say that the script ran and is done!
      You can mess with this script and change the original "local number = 5" to let's say 10, then the print will say, "The number of boxes is greater than 5!" and so on. You can also add more "elseif" if you want to for more practice...
      I would try practicing with some Transparency or BrickColor, or whatever else from the properties. Makes it more interesting and fun!
      You can also add:
      wait(number in seconds here)
      Example: wait(5)
      just so some of your script doesn't go as fast as lightning when running...like if you're making a part transparency change if true multiple times, it could cause lag... Just keep practicing and try making your scripts more complex as you follow the tutorials!

    • @abdulrahmanabdulaziz777
      @abdulrahmanabdulaziz777 4 месяца назад +1

      you can write comments and explain what the scripts do like I did. you can also see the comment section for each video and see what they did

    • @MiAep07
      @MiAep07 4 месяца назад +1

      @@PeeaaNuutt Thank you.

    • @MiAep07
      @MiAep07 4 месяца назад

      @@abdulrahmanabdulaziz777 Yeah, I've tried that. It's useful.

    • @aidandoesanimations
      @aidandoesanimations 2 месяца назад

      i suggest just following even more tutorials and script the best you know so far.

  • @TrygveJF
    @TrygveJF 6 месяцев назад +1

    6:58 I didn't know this, and I've had this error before and gave up. I can make it work now! Great video!

  • @JustARobloxPlayer1
    @JustARobloxPlayer1 2 месяца назад +1

    example if 2 + 2 > 5 then
    print("Correct")
    end
    if 11 + 5 >= 16 or 3 + 5 > 7 then
    print("Correct")
    end

  • @Daveistired
    @Daveistired 8 дней назад

    i like you and your vids , i watch like 1 or 2 each night so i can get lil bits here and there while balancing with voice acting and modelling

  • @Aswlujir
    @Aswlujir 23 дня назад

    if 2 * 3 ~= 6 then
    print('false')
    end
    if not (4 / 2 >= 8) or 12 / 2

  • @lorax6989
    @lorax6989 Месяц назад

    This is my L.O, decided to make the baseplate fall if the statement was true. I LOVE THESE VIDEOS! Soooo helpful but i also wish that instead of using number problems that you would implement more realistic problems that we would be doing in game.
    local result = false
    local basePlate = workspace.Baseplate
    -- Check the conditions
    if (2 + 3 ~= 4 and 2 + 2 >= 4) or not (5 + 2 == 10) then
    print("Congrats! Here's your prize ;)")
    result = true -- Set result to true if the condition is met
    end
    -- Only unanchor the baseplate if result is true
    if result then
    print("Check 1")
    wait(3)
    basePlate.Anchored = false -- Unanchor the baseplate
    print("Bye Bye!")
    else
    print("Yo dude result is not true you dingus")
    end

  • @aapple7993
    @aapple7993 5 месяцев назад +7

    -- Number checker, checks if a number is 4, or if it is greater than 4, or less than 4.
    local function numberChecker(number)
    if number == 4 then
    print('the number is 4')
    elseif number = 4 then
    print('number is greater than or equal to 4')
    else
    print('Unkown input')
    end
    end
    numberChecker(4)

    • @SniffishBowl
      @SniffishBowl 3 месяца назад

      I'm pretty sure you could have just used < and > since you already checked if the number is equal to 4 at the beginning

  • @Yur1Bee
    @Yur1Bee Месяц назад

    8:49 on uk keyboards (probably others too, but this is on mine) the ~ can be in 2 places: its either
    shift + #
    or
    shift + `
    (Second one is usually on apple keyboards)

  • @battlegroundcombos
    @battlegroundcombos Месяц назад +1

    if 5+5 == 10 and 5+4 == 10 then
    print ("its true")
    elseif 2+2 == 4 or 5+5 == 10 then
    print ("its half true")
    else print ("all of this is false")

    end

  • @rizzzzzlestudios5555
    @rizzzzzlestudios5555 2 месяца назад +6

    if (2 + 2 == 4) and (2 + 3 == 4) then
    print("this statement is true")
    elseif(2 + 2 == 4) or (2 + 3 == 4) then
    print("this statement is half true")
    else
    print("This statement is false")
    end

  • @ldceo8920
    @ldceo8920 3 месяца назад +1

    You’ve made learning how to script to be a fun experience! Thank you!!

  • @realmarcinn
    @realmarcinn 5 месяцев назад +2

    local b = game.Workspace.Baseplate
    local baseplate = game.Workspace.Baseplate
    local a = math.random(1,2)
    local msg = "that's true!"
    if 1 + 1 == 2 or 2+4 >= 6 then
    print(msg)
    baseplate.Name = "baseplate"
    end
    if baseplate.Name == "baseplate" then
    if a == 1 then
    b.BrickColor = BrickColor.Red()
    elseif a == 2 then
    b.BrickColor = BrickColor.Green()
    else print("nuh uh")
    end
    end

  • @Karaij1n
    @Karaij1n 5 дней назад

    for anyone wondering, the tilde key, (Squiggly line), on 60% keyboards or any keyboards that dont have the key specifically, for me i can use it by holding shift + function then pressing the escape key(shift + fn + esc == ~)

  • @valentimafonso8351
    @valentimafonso8351 Месяц назад +1

    6 minutes just recaping where i am not ot forget btw greate tutorials best ever im learning so much and this is great

  • @Darobloxplayer1
    @Darobloxplayer1 Месяц назад

    local function random(num1,num2)
    ran = num1 +num2
    print('ran is', ran)
    if ran 5 and ran

  • @haise1555
    @haise1555 Месяц назад

    My work :
    if not (5 >= 5) and 5 + 2 == 7 then
    print("aspergas")
    elseif 7= 10 and 5 + 2 == 7 then
    print("this statement is truee")
    end
    if not (5 + 10 >= 14) and 2 - 2 == 0 then
    print("this statement is true")
    end
    local egg = true
    if egg == true or 5 * 5 >= 23 then
    print("this statement is true")
    elseif not (egg == false) and 5 * 5 == 25 then
    print("this statement is true")
    else print("none of them is true")
    end
    --that one is second and more compicated try

  • @re_heated
    @re_heated 2 месяца назад +1

    if 2 + 2 >= 4 and 5 + 10 == 15 then
    print("This statement is true!")
    end
    if 5 + 5 == 10 and (10 + 10 ~= 20) or (4 + 4 < 8) and not (1 + 1 > 2) and (8 + 8 = 40) then
    print("Wow, this is somehow ALSO true!")
    end

  • @xastrovibzx587
    @xastrovibzx587 2 месяца назад +1

    --Last example and also my own code
    if 2 + 2 == 4 and 2 / 2 == 4 or 3 * 3 = 2 then
    print("This should print if 3 * 3 and 6 / 2 works")
    elseif not 2 + 2 == 4 then
    print("This should print if 2 / 2 equals to 1")
    else
    print("None of the equations work")
    end
    --Only thing that should print is "print("This should print if 3 * 3 and 6 / 2 works")"

  • @Sphereheadbozo
    @Sphereheadbozo 22 дня назад

    --Operations are neat
    if not (2 + 2 == 5) then -- Adding a not is more confusing then doing this next operation
    print("2 + 2 does not equal 5!")
    end
    if 2 + 2 ~= 6 then -- this is a much better meathod for using a "Not" in math
    print("2+2 does not eqaual 6!")
    end
    if 2 + 2 > 2 + 1 then
    print("2 + 2 is greater than 2 + 1")
    end
    if 2 + 2 == 4 and 2 + 3 == 4 then
    print("Both equations are true")
    else
    print("Atleast one equation is false")
    end
    if 2 + 5 == 4 or 2 + 6 == 8 then
    print("Atleast one equation is true")
    end

  • @TheF1shX
    @TheF1shX 4 месяца назад +3

    cool tutorial
    local ae = game.Workspace.Part
    ae.Material = Enum.Material.Neon
    if 5 * 5 >= 25 and 5 / 5 == 145884888 then
    ae.Color = Color3.fromRGB(57, 255, 12)
    print('this statement is true')


    else
    ae.Color = Color3.fromRGB(255, 0, 4)
    print('this statement is wrong')
    end

  • @RNoob_Bro
    @RNoob_Bro 4 месяца назад +1

    if not (2 + 2 == 4) then
    print("this statement is true!")
    end
    if 2 + 5 5) then
    print("Statement Success")
    end
    if 2 + 7 == 9 and 1 + 1 == 2 then

    myBaseplate.Material = "Concrete"

    end

  • @MR-VOXELATOR117
    @MR-VOXELATOR117 2 месяца назад

    pretty small script that i made :
    local function PlaySet()
    if 2 > 4 and 5 > 4 then
    print("above statements are alright")
    elseif
    2 + 2 == 4 then
    local cookies = game.Workspace.Baseplate
    cookies.Material = "Marble"
    end
    end

  • @ganaaSus
    @ganaaSus 13 дней назад +1

    mine===
    if game.Workspace.dingus.Anchored == false then
    print("this statement is true my guy")

    elseif 60 + 9 == 69 or 400 + 20 == 240 then
    print("ayooo?")
    else
    print("stoopidboi!")
    end

  • @MemeMasterPepe
    @MemeMasterPepe 2 месяца назад +1

    here is a small code that i wrote to practice operators and also something i wrote to tell about each one
    -- ~= This is the not equals Operator
    -- == this is of course the equals operator
    -- > greater than basically just compares if the number on the left side is greater than the number on the right like 2 > 1
    -- < this is just like the greater than but instead its less than so you can do 2 + 3 < 4 which will come back as false because 2+3 is equal to more than 4
    -- >= greater than or equal to so if you do 2+2 >= 4 it will come back as true because it is equal to 4
    -- = 60 then
    print("This is correct because 20 times 20 is alot more than 60!!")
    end
    if 100 / 10 == 20 then
    print("Correct 100 can be divided 10 times not 7!")
    else
    print("Sorry but you got it wrong try again!")
    end

  • @saikonick8312
    @saikonick8312 2 месяца назад

    this lesson is the easiest so far 🤣
    (you are crazy at explaining them, so good!!!)

  • @Skobeloff_Sky
    @Skobeloff_Sky 27 дней назад +2

    -- Operators
    if true then
    print("this statement is true")
    end
    --this is true because the boolean sets the statement to true
    if true and false then
    print("this statement is true!")
    end
    --This will not print because we need both requirments (true and false) to be met, and false is set to false making both values not met.
    if true or false then
    print("this statement is true or false!")
    end
    --the first boolean is checked, if its not correct, then the second is checked
    --this can be used with other things
    if 2 + 2 == 4 and 5 + 5 == 10 then --in an and statement, both must be true for it to work
    print ("this statement is true")
    end
    if 2 + 3 == 2 or 2 + 2 == 4 then -- in an or statement, only one must be true in order for it to work
    print ("atleast one of these statements is true")
    end
    -- theres also NOT
    if not false then --turns true because its not false
    print("This statement is not true")
    end
    if not (2 + 2 == 4) then --obviously 2 + 2 = 4 is true, but the not statement makes it false
    print("this statement is not true")
    end
    --IMPORTANT: You need to put "()" to let it know its the whole statement rather than just "If not 2"
    -- we can also use ~= to make not equals
    if 2 ~= 4 then
    print("2 is not equal to 4")
    end
    -- we can also use > and < to check if one number is greater or less than the other
    if 2 < 4 then
    print("2 is less than 4")
    end
    --finally, we can also use >= or

    • @RedditMaster-gq8tl
      @RedditMaster-gq8tl 26 дней назад

      W notes bro I save these so I can come back to later if I forget somethings

  • @thetipher
    @thetipher 18 дней назад

    yes.
    if 2 + 2 or 2 * 90 == 4 then
    local function goat(n1, n2)
    local result = n1 + n2
    return result
    end

    local activation =goat(7, 4)
    print(activation)
    end

  • @Darobloxplayer1
    @Darobloxplayer1 Месяц назад

    local function pemba(num1,num2)
    local na = num1 + num2



    if not (na == 4)then
    print("it not equal")
    else
    print("its true you got" , na)
    end
    end
    pemba(2,2)

  • @Tobongo
    @Tobongo 3 месяца назад +1

    Why does this script print the statement?
    if true or false and false and true then
    print("This statement is true")
    end
    There is one false in between the ands, why does it return a true?

    • @BetterGrass-g3o
      @BetterGrass-g3o 3 месяца назад +1

      I corrected it
      if (true or false) and (false and true) then
      print("This statement is true")
      end
      problem is or is check if one one these conditions are true then ignoring the rest of conditions thats why maybe I can be wrong but using () always good

    • @Tobongo
      @Tobongo 3 месяца назад

      @@BetterGrass-g3o I mean I know how to solve the issue, but why does it print it if one of the conditions is false

  • @Daveistired
    @Daveistired 8 дней назад

    if 2 + 2 >= 4 and 5 + 2 = 5 then
    print("true")
    else
    print("false")
    end
    [will print true]
    if 2 + 2 >= 4 and 5 + 2 = 9 then
    print("true")
    else
    print("false")
    end
    [will print false]

  • @DeathKing7897
    @DeathKing7897 26 дней назад

    for those who don't understand
    -- the and command tells that a specific command is to run if the TWO(2) conditions are met
    -- Example
    if 1 + 1 == 2 and 2 + 2 == 4 then
    print("test1")
    end
    -- the or command tells that a specific command is to run if ONE(1) of the conditions are met
    -- Example
    if 1 + 1 == 2 or 2 + 2 == 5 then
    print("test2")
    end
    -- for the or command it does not matter if the first condition is true or false or the second condition is true or false
    -- from one is true it will run the command
    -- now for the not command it is not placed in between two conditions but placed in front of one condition
    -- Example
    if not (1 + 1 == 2) then
    print("Test3")
    end
    -- if you try the TEST3 command it will not run because it will tell the opposite of what it means
    -- for EXAMPLE if it was not true then it will run the command
    -- eg: if one plus one equals to two the command will not run
    -- there are 6 relational operators in Lua
    -- they are
    -- == (equal to)
    -- ~= (not equal to)
    -- > (bigger than)
    -- < (smaller than)
    -- >= (bigger or equal to)
    -- = 2 or 1 + 1

  • @Ja22yo
    @Ja22yo 2 месяца назад

    insanely simple one here
    local function digitScanner(number)
    if number = 50 then
    print("number is between 50 and 100")
    else
    print("number is smaller than 50 or greater than 100")
    end
    end
    digitScanner(60)

  • @TwigManGames
    @TwigManGames 5 месяцев назад +1

    if (5 + 5 == 11) or (2 + 5 >= 9) then
    local falseStatement = "This statement is true."
    print(falseStatement)
    elseif (5 + 5 == 11) or (2 + 5 == 2) then
    local anotherSolution = "This statement has found another solution!!!"
    print(anotherSolution)
    else
    local errorStatement = "This statement has an error."
    print(errorStatement)
    end

  • @BeardedWaleed
    @BeardedWaleed 3 месяца назад

    great work man, keep going 🤩

  • @GDsergio13
    @GDsergio13 2 месяца назад +1

    My script thingy:
    local base = game.Workspace.Baseplate
    local blocky = game.Workspace.Azul
    local function aol(aola, oala)
    local result = aola + oala
    if result > 10 and result ~= 10 then
    base.Color = Color3.fromRGB(31, 136, 64)
    blocky.Size = Vector3.new(100, 100, 20)
    else
    base.Color = Color3.fromRGB(165, 37, 39)
    blocky.Size = Vector3.new(100, 100, 500)
    end
    end
    aol(12, 4) -- True
    aol(10, 0) -- False

  • @Chtto88
    @Chtto88 5 месяцев назад +1

    6:52 thanks for explaining that

  • @RexMarket
    @RexMarket 5 месяцев назад +2

    if 5+5 == 10 and 2+2 == 4 and 4+4 >= 7 then
    print("all conditionals meet requirment ")


    end
    if not (4+4 == 4) and 5+5 == 10 then
    print("all conditionals meet requirment2")

    end
    if not (50 >= 60 ) then
    print ("not stamene nt works ")
    end
    if 4 + 4 == 4 or 5+5 == 10 then
    print "amazing work or statement works "
    end

  • @pizzabean
    @pizzabean Месяц назад

    kind of basic, but works
    if 2+2

  • @NathanScott-zz5sc
    @NathanScott-zz5sc 5 месяцев назад +1

    local function testingOperators(num, num2)
    local lilacPlantPropertyChanger = game.Workspace["Lilac plank"]

    local operatorsTest = num + num2

    if operatorsTest >= 10 then
    if not (4 - 6 == -2) or 5 + 6 >= 12 or 7 + 8

  • @R3dX5118
    @R3dX5118 4 месяца назад

    well I made this little function that checks if a number is within a range of another number this function checks if by adding or subtracting the number from or to the range you get a result that is within the range of a model number... I know this sounds a bit weird but here is the example
    if we have a number 16 for example and a range of 5 and 20 as the model number, basically we are trying to check if the 16 is within the given range (5) from the number 20, and since the number 16 is 4 numbers away from 20, we can return true from the function, same thing with a number like 24, as it too is 4 numbers away from 20, so again it should return true, if it was 26 though the difference is that it is not within the 5 numbers range it is 6 numbers away from 20 so the function returns false
    code:
    local function checkWithinRangeOfModelNumber(number, range, model)
    if (number > model) then
    if (number - range = model) then
    return true
    else
    return false
    end
    else
    return true
    end
    end
    print(checkWithinRangeOfModelNumber(2.6, 0.5, 2))
    I am a full-stack developer so I am just trying to learn the syntax of Lua and generally how to deal with Roblox studio, so I am very happy I found this series.

  • @Theunstabledragon
    @Theunstabledragon 5 дней назад

    I decided I wanted to make a more indepth type of if then statement with operators.
    if 2 + 2 == 4 or 5 + 5 ~= 30 then
    print("This statement is half or fully true!")
    end

    if 2 + 2 == 4 and 5 + 5 ~= 30 then
    print("Part 1 and 2 are Correct!")
    end
    if 2 + 2 ~= 4 then
    print("Part 1 is incorrect!")
    end
    if 5 + 5 >= 30 then
    print("Part 2 Is incorrect!")
    end

  • @MxzyyFn
    @MxzyyFn 2 месяца назад +7

    Day 1 of learning lua as a python learner..
    Hour 1: I am at operators (seems rlly simple I already have enough knowledge about coding)

    • @jzmil1
      @jzmil1 2 месяца назад +1

      update

    • @MxzyyFn
      @MxzyyFn 2 месяца назад +2

      @@jzmil1 I finished the beginner now I’m at the advanced and I finished nearly half of it

  • @Joseph-ht4iw
    @Joseph-ht4iw 6 месяцев назад +3

    Awesome video!!

  • @NotAsphru
    @NotAsphru 21 день назад

    if 2 + 3 == 4 or 2 + 3 == 5 and 3+3 == 6 then
    print("This statement is true")
    else
    local gyat = true
    print(gyat)
    end
    if 4 + 2 ~= 7 then
    print("hello")
    end
    if 5 + 5 == 10 and 4 + 2 == 8 and 8 / 2 == 4 or 2 + 3 ~= 4 then
    print("I love myself")
    else
    print("I hate myself")
    end

  • @B0MSH1K
    @B0MSH1K Месяц назад

    Thank you so much for your amazing explanations! Any way here is my learning objective. :)
    local BrawlDev = "The G.O.A.T"
    if 2 + 2

  • @vsivasathvik4558
    @vsivasathvik4558 6 месяцев назад +2

    ur explanation is nice but i feel like every time i watch the vid i feel like i understood it but a few days later i dont remember 80% of what should i do to fix that?

  • @Mr_Idk_anything_
    @Mr_Idk_anything_ 2 месяца назад

    local function q(x,y)
    p = x+y

    if p>100 then
    print('greated than 100')
    elseif p==100 then
    print('equal')

    else
    print('less than 100')
    end
    end
    q(98,3)

  • @RowanMcCowan
    @RowanMcCowan 17 часов назад

    local function comp(num1, num2, num3)
    local result = num1 + num2 - num3
    if result > 6 then
    print("x is greater than 6")
    elseif result < 6 then
    print("x is less than 6")
    else
    print("x is 6")
    end
    end
    comp(2, 4, 0)
    comp(7, 5, 2)
    comp(2, 6, 9)
    ?

  • @FlakeYTB
    @FlakeYTB 3 месяца назад

    Tip for all of you: if you used to or still use scratch, you can find some identical codes which helps a lot

  • @banditbaws
    @banditbaws 2 месяца назад

    local basePlate = game.Workspace.Baseplate
    local function skibidiToilet(num1)
    if not (1+1 == 2) or num1 > 5 or num1 < 3 then
    print('Ermm what the sigma? (guess again)')
    basePlate.Transparency = 0.75
    basePlate.Anchored = false
    elseif num1 == 4 then
    print('Always bet on hakari')
    basePlate.Transparency = 0.25
    basePlate.Material = 'Brick'
    else print('Good luck trying to get this text to appear. (It's possible)')
    end
    end
    skibidiToilet(4)
    -- Result 'Always bet on hakari' and the floor doesnt fall
    -- if you pick (mostly) any other number, the baseplate would fall, and if you dont pick a number there would be an error.

  • @Chips123
    @Chips123 4 месяца назад

    local function numCheck(number1,number2)
    local result = number1 + number2

    if result == 10 or result == 5 then
    print("it is equal to 10 or 5")
    else
    print("it is not equal to 10 or 5")
    end
    end
    numCheck(2, 3)

  • @AliAhmed-tq7jk
    @AliAhmed-tq7jk 3 месяца назад

    is really undestanding good theres nothing to be wrong unless u did smth wrong i was stupid and dint't know print works and now i have made so much scripts bc of u tysm

  • @3NR123
    @3NR123 4 месяца назад +1

    if 2 + 2 == 4 then
    print("Your video's are awesome!")
    end

  • @Klopza
    @Klopza 5 месяцев назад

    if 4 + 4 == 8 and 2 + 5 == 9 then
    local correct1 = "this math stuff is correct"
    print(correct1)
    end
    local a = 2
    if a * 5 == 10 or a * a - 4 > 7 then
    local correct2 = "one of these equations are correct"
    print(correct2)
    end
    local a = 2 b = 5 c = 8 d = 4
    if a * b / c * d * a > 30 or b * d / c + a * b < 60 then
    local correct3 = "these are correct nice job"
    print(correct3)
    end

  • @amceyi3amce878
    @amceyi3amce878 22 дня назад

    local function substraction(number1, number2)
    local result = number1 - number2

    if result > 0 then
    print(result .. " is positive")
    elseif result < 0 then
    print(result .. " is negative")
    elseif result == 0 then
    print("Your result is 0")
    end
    end
    substraction(1, 1)

  • @CsDceu
    @CsDceu 2 месяца назад

    What I did is writing everything I've learnt in this episode:
    if 2 + 2 >= 4 and 5 + 10 == 15 then
    print("This statement is true.")
    else
    print("This statement is false.")
    end
    if true or false then
    print("This statement is either true or false.")
    end
    if true and false then
    print("This statement is both true and false.")
    end
    if not true then
    print("This statement is not true.")
    else
    print("This statement is not false.")
    end

  • @ghosthunterroblox2549
    @ghosthunterroblox2549 4 месяца назад

    i am now learning script after only 2 days seing you tutorials and practice

  • @reddeath-y6x
    @reddeath-y6x Месяц назад

    man this guy does very well work on explaining stuff

  • @t8tenz704
    @t8tenz704 2 месяца назад +1

    if 2 + 3

  • @paklex0211
    @paklex0211 Месяц назад

    if 6 * 5 = 22 then
    wait(1)
    baseplate.Material = "Mud"
    elseif n1 / n2 == 10 then
    wait(1)
    baseplate.Material = "Glass"

    end
    end
    test(2, 5, 4)
    test(8, 12, 5)
    test(20, 2, 8)
    end

  • @xblade_8919
    @xblade_8919 2 месяца назад

    if 2+2 == 4 and 3 + 3 == 6 then
    print("and operator worked")
    end
    if 6 + 8 == 14 or 10 + 12 == 2 then
    print("or operator worked")
    end
    if not (2 + 3 == 4) then
    print("not operator worked")
    end
    -- Comparison operators
    -- == Equal to
    -- ~= Not equal to (Alt + 1 2 6)
    -- = Greater than or equal to
    -- < Less than
    -- > Greater than

  • @blade6309
    @blade6309 5 месяцев назад

    -- and/or/not operators to flesh out conditions
    if 2 + 2 == 4 and 5 + 5 == 10 then
    print("This statement is true!")
    end
    if true or false then
    print("This statement is possibly true!")
    end
    if not 2 + 2 == 4 then
    print("This statement is false!")
    end
    -- ~= is not equal to
    if 2 + 2 ~= 4 then
    end
    -- < Greater than > Less than
    if 2 + 2 > 4 then
    end
    -- = 4 then
    end
    local Health = 20
    local Fuel = 60
    local Power = 20
    if Health > 25 and Fuel < 50 or Power < 80 then
    print("Oh no the vehicle exploded!")
    else print("The vehicle is fine!")
    end

  • @vmc-mal
    @vmc-mal 5 месяцев назад +1

    Most complex script yet, pretty fun video!
    -- Funny Number Detector 2.0 (Real)
    local function calculatorFunny(num1, num2)
    local result = num1 + num2
    return result
    end
    -- Input your 2 values here ! !
    local result = calculatorFunny(1,1)
    -- Narration below here
    if result == 69 then
    print("yoooo, it's 69!")
    else
    print(result)
    print("Nope, wayy too far! Try again!")
    end
    -- Anything past this point are redundant and are just used for experience.
    -- Also when using the "not" modifier make sure to use "()" after it or it won't work.
    if not (result == 100) then
    print("hey, at least it's not 100!")
    elseif result == 100 then
    print("also 100? really br-")
    elseif result == 69 then
    print(nil)
    end
    if result ~= 0 then
    print("hey! it's not 0!")
    end
    if result >= 100 then
    print("(Hint: The funni number is below 100!)")
    end

    • @aapple7993
      @aapple7993 5 месяцев назад

      this is corny af

    • @vmc-mal
      @vmc-mal 4 месяца назад

      @@aapple7993 lmao yeah

  • @Ceazar0
    @Ceazar0 Месяц назад

    local function Operator (nr1, nr2)
    local result = nr1 * nr2
    if result == 11 or 1444 then
    print("lolright")
    else print("gogoog")

    end

    end
    Operator(11, 1)

  • @sagiqiux
    @sagiqiux 3 месяца назад

    if 4 + 3 >= 7 and 5 + 5 == 10 then
    print("Correct")
    end
    if 9/9 >= 1 and 5+5 >= 9 then
    print("Correct")
    end
    if 10 * 2 > 4 or 4 * 4 < 9 then
    print("Incorrect")
    end

  • @ServantSinister
    @ServantSinister 3 месяца назад

    -- List of operators
    if true and false then -- "and" operator. Both conditions need to be met for the if-statement to call.
    print("Statement")
    end
    if true or false then -- "or" operator. One of the conditions needs to be met for the if-statement to call.
    print("Statement2")
    end
    if not true then -- "not" operator. The condition must not be met to fire.
    print("Statement3")
    end
    if 1 + 1 == 2 then
    print("Math1") -- equal relational operator. "true"
    end
    if 1 + 2 ~= 3 then
    print ("Math2") -- not equal relational operator. "false"
    end
    if 1 + 2 > 2 then
    print("math3") -- "bigger" relational operator.
    end
    if 1 + 1 < 3 then
    print("math4") -- "smaller" relational operator.
    end
    if 5 + 5 >= 9 then
    print("math5") -- "bigger or equal" relational operator.
    end
    if 5 + 5

  • @DarkFrog-b9e
    @DarkFrog-b9e 4 месяца назад

    i watch like 100 tutorials by now and leard nothing then i watch this guy and now i know so much more

  • @moyosorealuko4490
    @moyosorealuko4490 4 месяца назад

    local function numberChecker(n1)
    local num1 = n1
    if num1 < 2 then
    print("I'm small")
    elseif num1 > 2 and num1 ~= 3 then
    print("I`m big")
    else
    print("I`m in the middle")
    end
    end
    numberChecker(math.random(1,5))

  • @-witherified-1843
    @-witherified-1843 2 месяца назад

    local function addition(num1, num2, num3)
    local result = (num1 + num2) * num3
    if result >= 35 then
    print("The result is above or equal to 35!")
    elseif result < 35 then
    print("The result is below 35!")
    end
    end
    addition(5, 2, 5)
    addition(5, 9, 10)
    addition(-2, 5, 3)

  • @ParadoxFlameOfficial
    @ParadoxFlameOfficial 3 месяца назад +1

    I have made this script lol it works i checked lol i used all my scripting brain to make this lol i used whatever you told in the 1st tutorial till here.
    if game.Workspace.TestPart.Transparency == 0 and game.Workspace.TestPart.Anchored == true then
    wait(2)
    game.Workspace.TestPart.Transparency = 1
    end
    if 2 + 3 == 5 or 2 + 2 == 5 then
    local Statement if 2 + 3 == 5 then
    print("Hello")

    local Statement2 if 2 + 2 == 5 then
    print("HI")
    end
    end

    end
    if not (2 + 3 ~= 5) then
    print("Its Ture")
    end
    if not (10 + 101 == 20 ) then
    print ("False")
    end

    if 3 + 3 > 4 then
    print("LOL ITS TRUE BROOOOOOOOOOOOOOO AHJAHAHA")
    end
    if 100 + 1 < 102 then
    print(true)
    end
    if 9 + 1 >= 10 then -- make sure that this will be like 9 + 1 >= 10 only it wont work if its like => or like this =<
    print("lolololololololololololololollolloloollolo")
    end
    if 10 + 10

  • @BalintZsoldos
    @BalintZsoldos 4 месяца назад

    broo this is the second day and i good at the things
    ty:)

  • @krekt_cz5190
    @krekt_cz5190 Месяц назад +2

    local function calculator(num1, num2, mathcharacter)

    local vysledek = 0

    if mathcharacter == "+" then
    local vysledek = num1 + num2
    print(vysledek)

    elseif mathcharacter == "-" then
    local vysledek = num1 - num2
    print(vysledek)

    elseif mathcharacter == "*" then
    local vysledek = num1 * num2
    print(vysledek)

    elseif mathcharacter == "/" then
    local vysledek = num1 / num2
    print(vysledek)

    else
    print("math character is incorrect")
    end
    end
    calculator(10, 5, "+")
    calculator(10, 5, "-")
    calculator(10, 5, "*")
    calculator(10, 5, "/")
    local CalculaterResult = calculator(10, 5, "tvojemama")

  • @chlebektv
    @chlebektv 24 дня назад

    here is the code i made
    local function maths(num1, num2)
    local odp = num1 * num2

    if odp > 32 then
    print("this number is bigger than 32")
    elseif odp == 32 then
    print("this number is 32")
    else print("this number is smaller than 32")
    end
    end
    maths(3, 8)
    maths(8, 4)
    maths(8, 10)
    ------------------------------------
    this number is smaller than 32
    this number is 32
    this number is bigger than 32
    ------------------------------------
    i hope you liked it!

  • @Realplayer-tu7gy
    @Realplayer-tu7gy Месяц назад

    local function equality(a, b ,c ,d)
    if a + b == c and c - d 100) or (d / a < 100) then
    print('Puzzle 2 completed!')
    else
    print('Puzzle 2 not completed!')
    end
    end
    equality(1234, 2432, 724, 44564)

  • @snothemonke
    @snothemonke 2 месяца назад

    my script :)
    if 2 + 2 >= 4 and 4 + 2 == 5 or 7 + 9 == 16 and 7 + 9 > 100 then
    print(true)
    else
    print(false)
    end
    --should just print the word false in your output

  • @CutieFlynny
    @CutieFlynny 2 месяца назад

    if 2 + 2 == 4 and 5 + 5 == 10 and 3 + 4 > 4 and 1 + 1 < 4 and 2 + 3 >= 4 and 1 + 2 4 and 4 + 1 < 4 and 3 + 3 = 4) then
    print("These results aren't equal to each other")
    end

  • @08-nguyenphuochung98
    @08-nguyenphuochung98 3 месяца назад

    you make things to clear and the quality of the video is very nice
    local baseplate = game.Workspace.Baseplate
    if 3 + 4 >= 5 and 3 + 78 == 48 or 3 + 5 == 8 then
    print("if statement ran successfully")
    else
    print("if statement failed")
    end
    local function changeBaseplateColor(num1, num2)
    local result = num1 + num2
    if result 40 and result 80 then
    baseplate.Color = Color3.fromRGB(10, 70, 200)
    else
    print("error")
    end
    end
    changeBaseplateColor(21, 48)

  • @Omps_gt
    @Omps_gt 14 дней назад

    Pretty simple code
    local function math(n1, n2)
    local awn = n1 + n2
    if awn == 15 then
    print("correct!")
    elseif awn > 20 or awn < 10 then
    print("not even close bro")
    else
    print("so close")
    end
    end
    math(10, 5)
    math(10, 6)
    math(10, 11)

  • @doge4101
    @doge4101 Месяц назад

    lol i feel really proud of this script cuz it was the first one I debugged :
    local level = 5
    local function playerLevel (playerLevel)
    local playerLevel = playerLevel
    if playerLevel >= 5 and playerLevel < 10 then
    print("Player is a noob")
    elseif playerLevel >= 10 then
    print("Player is a pro")
    else
    print("Player started game")

    end
    end
    playerLevel(level)
    local function playerLevelXPNeeded()
    local playerXP = level
    playerXP = 2 * level + 2
    print(playerXP)
    end
    playerLevelXPNeeded()

  • @Eternalkeyy
    @Eternalkeyy 9 дней назад

    if 2 + 2 >= 4 and 5 - 1 == 4 then
    print("2 + 2 is greater or equal to 4")
    end
    if 2 + 2 or 4 + 4 == 8 then
    print("2 ´523523")
    end
    local messi = 15
    local riderequirement = 15
    if messi >= riderequirement then
    print("messi can go on the ride")
    else
    print("messi cant go on the ride")
    end

  • @senh0rsticko497
    @senh0rsticko497 2 месяца назад

    -- Calculadora bem básica
    local function calculadora(opcao)

    local function adicao(num1, num2)
    local resul = num1 + num2;
    if resul >= 10 and resul 10 then
    print("Menor que 10 ou Maior que 10")

    else
    print(resul)
    end
    end

    local function multi(num1, num2)
    local resul = num1 + num2;
    if resul ~= 100 then
    print("Não é igual a 100!")

    else
    print("É igual a 100!")
    end
    end

    local function divisi(num1, num2)
    if num2 == 0 then
    print("Não é possivel dividir por 0")

    else
    local resul = num1 / num2;
    if resul == 50 or resul

  • @FantaSYTheSecond
    @FantaSYTheSecond 5 месяцев назад

    I did everything through random
    local random = math.random(1, 2)
    local random2 = math.random(1, 2)
    local random3 = math.random(1, 11)
    if random == 1 and random2 == 2 then
    print("fun 2 script")
    end
    if random == 1 or random2 == 2 then
    print("scripting is nice")
    end
    if not (random2 == 1) then
    print("nooo")
    end
    if random3 > 5 then
    print("it is bigger")
    elseif random3 < 5 then
    print("it is smaller")
    elseif random3 == 5 then
    print("it is equal")
    end
    if 5 + 5 ~= 6 then
    print("yeah it is not")
    end

  • @TheLivingSentientBox
    @TheLivingSentientBox 29 дней назад

    Kinda short, but i was short on time:
    local rizz = true
    local skibidi = false
    if 2 + 6 >= 4 and 60 + 9 = 4) then
    print("This statement is the talk tuah podcast!")
    end

  • @fournumm
    @fournumm 2 месяца назад

    What I came up with.
    -- Not Statement
    if not (2 + 2 == 4) then -- Must put parenthesis after not.
    print("This statement is true!")
    end
    -- And Statement
    if 2 + 2 == 4 and 5 + 5 == 10 then
    print("Both statements are true!")
    end
    -- Or Statement
    if 2 + 2 == 4 or 5 + 6 == 10 then
    print("At least one of the statements is true!")
    end
    -- Greater Than, Less Than, Greater Than or Equal, Less Than or Equal, Equal, and Not Equal
    if 2 + 2 = 4 or 5 + 5 ~= 20 then
    local baseplate = workspace.Baseplate

    baseplate.Transparency = 1
    baseplate.CanCollide = false
    end
    if 2 + 2 > 3 and 1 + 1 < 3 then
    local spawn = workspace.SpawnLocation

    spawn.Color = Color3.fromRGB(170, 0, 0)
    end

  • @MrFancyfn
    @MrFancyfn 4 месяца назад

    if 4 + 4 = 7 then
    print("Brawldev is goated")
    end
    if 5 + 6 ~= 10 and 4 + 7 >=11 then
    print("Brawldev thank you so much i love your content!")
    end
    if not (4 + 5) == 10 or 6 + 3 == 9 then
    print("Yippee!")
    end