Beginner's Roblox Scripting Tutorial #8 - If Statements (Beginner to Pro 2019)

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ธ.ค. 2024

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

  • @TheDevKing
    @TheDevKing  5 ปีที่แล้ว +86

    Hey guys! Be sure to join the discord server if you have any questions or if you would like to meet me! discord.gg/FKcSyRh

    • @saidabdiche5890
      @saidabdiche5890 4 ปีที่แล้ว +2

      i was trying to hack to get free robux. now i am making a game so thx for your help

    • @EuphoricPlaceHolder
      @EuphoricPlaceHolder 4 ปีที่แล้ว

      so if i do this script it should give me the trancperacy of my baseplate?
      if Baseplate == 1
      print ("Yes")
      end
      would it work bcs imma try it

    • @jaketwix7636
      @jaketwix7636 4 ปีที่แล้ว

      lol ik you dont see this anymore but THAT WAS AWESOME

    • @jaketwix7636
      @jaketwix7636 4 ปีที่แล้ว

      @@saidabdiche5890 roblox mods I n t r e s t i n g ...

    • @jaketwix7636
      @jaketwix7636 4 ปีที่แล้ว

      @@EuphoricPlaceHolder im sorry it wouldent ik im not dev but you should type this i belive i could be wrong local Baseplate = game.Wokspace.Baseplate
      if Baseplate.Transparency == 0 then
      game.Workspace.Baseplate.Transpareny = 1 I belive this last part is wrong but hey im not an expert it may work

  • @vebvoroxe2317
    @vebvoroxe2317 4 ปีที่แล้ว +64

    1:00 for my people learning to script on roblox during quarantine, the simpler understanding is that == is asking "are they equal?" and = is saying "this is the value
    Example: 3 == 3 it's checking if the first value is equal to the second value
    x = 3 its saying that the value of x is 3

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

      What this means?
      if variable then
      --code
      end

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

      if variable what
      @@Astrolightation

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

      ​@@Astrolightation end is a function which is used in script ends and sometimes used in the middle of a script or anywhere they are a function which makes the script stop and
      Example : so when your script is got red line under for no reason the end is used if 2 are red lined it will be
      end
      end)

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

      ​@@Astrolightation Variables are a function which holdes all the data of the script
      Examples: if your script is in a part in workspace you need to write
      local (partname) = script.workspace
      If you want to make a script a child of the part or item you need to write
      local (where your inserting the script) = script.parent
      this makes the script a child of the item or part your inserting the script

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

      ​​@@Astrolightationthe word code dosent exist in lua...(Maybe)
      They are used in printing tho

  • @eggstatus5824
    @eggstatus5824 2 ปีที่แล้ว +206

    If statements are by far one of the most fun things to play around with in scripting. The amount of power an if statement gives you is just unmatched

    • @GoofySillyGuy
      @GoofySillyGuy ปีที่แล้ว +4

      ikr lmao

    • @fuzailgaming715
      @fuzailgaming715 ปีที่แล้ว

      @@GoofySillyGuy samee

    • @tkn1ght493
      @tkn1ght493 ปีที่แล้ว

      yes, then i wanna mess around with statements and random

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

      Are you allowed to use != < > and all those in lua aswell?

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

      @@col2650 yes, but the ! symbol is quite complex

  • @Morezplug
    @Morezplug 7 หลายเดือนก่อน +54

    Watching this in 2024, still the most easiest to understand tutorials out there

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

      AlvinBlox is a good option too! but this one def better

    • @Morezplug
      @Morezplug 4 หลายเดือนก่อน +7

      @@rowlzz idk Alvinblox is just confusing

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

      true

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

      I like this channel

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

      +1

  • @wuz6384
    @wuz6384 3 ปีที่แล้ว +89

    I was terrified to start scripting but once you get going you notice some patterns. Thanks for this series it's helped a lot

    • @trolo7511
      @trolo7511 2 ปีที่แล้ว +1

      True right?

  • @Mestrix
    @Mestrix 5 ปีที่แล้ว +122

    Your tutorials are so helpful and easy to follow, I love the content man! I haven’t found any others that have made it this fun and easy to do.

    • @TheDevKing
      @TheDevKing  5 ปีที่แล้ว +28

      Thanks man! Glad you enjoy :)

    • @nineveh17
      @nineveh17 4 ปีที่แล้ว +7

      couldn't have agreed more

    • @dev-d5600x
      @dev-d5600x 4 ปีที่แล้ว +4

      That is right

    • @eeradumidiot8439
      @eeradumidiot8439 3 ปีที่แล้ว +2

      so relatebele

    • @gayathris8007
      @gayathris8007 3 ปีที่แล้ว +1

      @@TheDevKing live long life

  • @irongriff12
    @irongriff12 9 หลายเดือนก่อน +11

    All though its been 5 years i am now a pro scripter cause of this guy and he does such a fantastic job of explaining scripting and all that stuff and without him idk if i would of been able to script lmao

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

      Im happy for you bro I just started 1 day ago and I hope to get better

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

      @@disneyplusmember samee. what are u rn?

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

      @@GameTime_Really Im still learning I restarted the playlist and I can understand much better than before

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

      @@disneyplusmember oh, ive already done this and gui playlist. Learning modeling now, to make a game

  • @loadingyourdata2131
    @loadingyourdata2131 5 ปีที่แล้ว +163

    This one is easy. Love it man keep it up!

    • @TheDevKing
      @TheDevKing  5 ปีที่แล้ว +30

      Thanks bro :))

    • @loadingyourdata2131
      @loadingyourdata2131 5 ปีที่แล้ว +11

      Please make more I really want to learn the full steps.

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

      ​@@TheDevKing hey bro do you have any successful games that you have made and hoe much robux have you made from them?

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

      @@Oiluptylervitelliorelse5 years ago he made this, I don’t think he is gonna still comment on a video from 5 years ago.

  • @sunthestupid8951
    @sunthestupid8951 2 ปีที่แล้ว +40

    The fact that you're tutorials are also kid friendly just makes it better so aspiring developers on the younger side can also learn

    • @Galaxcicity
      @Galaxcicity 2 ปีที่แล้ว

      Just like me lol

    • @Dontclickmypfp
      @Dontclickmypfp ปีที่แล้ว +1

      Yeh lol I’m 10

    • @Sejdkkk
      @Sejdkkk ปีที่แล้ว

      Why are there kids here now

    • @Galaxcicity
      @Galaxcicity ปีที่แล้ว +1

      @@Sejdkkk They want robux

    • @VicTenCrafty
      @VicTenCrafty ปีที่แล้ว +3

      POV: Me, who is 10, trying to learn scripting so that I can make games:

  • @attackerstoasdfa
    @attackerstoasdfa 3 ปีที่แล้ว +4

    he has managed to fit this topic into a 7-minute video while all those Roblox scripting "pros" make a whole 20-minute video and in the end, you barely understand a thing they said. Your content is very beginner-friendly, keep it up and never give up!

  • @Targetstrike
    @Targetstrike 3 ปีที่แล้ว +3

    Honestly, this is one of the most self explanatory tutorials here...aside from the having == instead of = to avoid confusion with the variable things

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

      == is used in every type of programming im sure

  • @lem3579
    @lem3579 4 ปีที่แล้ว +11

    I love how this man explains things, it's helping me learn the basics so quick

  • @Bloxtun
    @Bloxtun 5 ปีที่แล้ว +65

    Just now going through your tutorials and they're super helpful! I really like that you give a lot of examples when explaining it bc it makes it easier to understand :)

    • @TheDevKing
      @TheDevKing  5 ปีที่แล้ว +20

      Thats awesome! I'm glad It could help. You'll be at the advanced series in no time :)

    • @NotGwPrince
      @NotGwPrince 2 ปีที่แล้ว +1

      2nd Comment lol

  • @nickmoschos8476
    @nickmoschos8476 2 ปีที่แล้ว +17

    Thanks to this series i managed to make my first script !😁
    local Baseplate = game.Workspace.Baseplate
    local function Test()
    Baseplate.Anchored = false
    wait(2)
    if Baseplate.Anchored ==false then Baseplate.Anchored = true

    end
    end
    Test()

    • @noobsarebetterthanu5820
      @noobsarebetterthanu5820 2 ปีที่แล้ว +5

      local Baseplate = game.Workspace.Baseplate
      local function test()
      if Baseplate.Anchored == true then
      Baseplate.Anchored = false
      wait(2)
      Baseplate.Anchored = true
      end
      end
      test()
      It should be more like that

    • @ehtz
      @ehtz 2 ปีที่แล้ว +3

      i’m bad at scripting but you could make it even shorter maybe idk
      local base = game.Workspace.Baseplate
      base.Unanchored = true
      wait(2)
      base.Anchored = true
      keep in mind that i wrote this with only 20 minutes of tutorial watching experience, expect it to not work at all 👍

    • @noobsarebetterthanu5820
      @noobsarebetterthanu5820 2 ปีที่แล้ว

      @@ehtz It would work but only once but if you put it in a function you could call on it to do whatever you want just by putting as what he put Test() Which you can make repeat by doing,
      While true do
      Test()
      end
      Hope this helped!

    • @RangerIsAnIdiot
      @RangerIsAnIdiot 2 ปีที่แล้ว

      @@noobsarebetterthanu5820 well im a noob

    • @lelubilodeau7027
      @lelubilodeau7027 2 ปีที่แล้ว

      Nice

  • @dxrk8590
    @dxrk8590 4 ปีที่แล้ว +7

    All these years I knew you, I never knew you were so talented at stuff like this.
    Thank you for the tutorials, they help me a lot!
    Keep up the great work!

  • @vinjo26
    @vinjo26 ปีที่แล้ว +1

    Yo devking I was very confused with scripting and i thought i couldnt do it. But when I found you in TH-cam, it helped me learn alot! Thanks devking❤

  • @depressedgoat
    @depressedgoat 4 ปีที่แล้ว +9

    Using this tutorial I made an if statement to check if the baseplate was anchored, if it wasn’t it said “Anchoring the baseplate...” I then used code to anchor the base plate and then printed “The baseplate has been anchored”

    • @bearreyes1837
      @bearreyes1837 2 ปีที่แล้ว +1

      Cool! I made some code that makes the baseplate dissapear smoothly. Here's the code. [plez credit me waa]
      local PartTransparency -- The Baseplate's transparency, if it wasn't obvious enough
      local i = 0 -- For a loop
      local Baseplate = game.Workspace.Baseplate -- I know this isn't needed but it's to make my code shorter
      Baseplate.CanCollide = 1
      wait(10) -- Initialize collisions, just in case
      while i < 1.1 do -- Basically how this works is "while" a condition is true [or yes], it will do this action. Otherwise, it stops.
      i = i + 0.1
      PartTransparency = i
      Baseplate.Transparency = PartTransparency
      print(i) -- For debugging. I have no idea why the decimal points go from 0.2 to 0.399999999999999. Floating point is very smart
      if i > 1 then
      Baseplate.CanCollide = false
      print("Oh teh noes! Da baesplate haz DISSAPEARED!") -- For fun. Don't re-correct the message, otherwise you're a huge nerd.
      end
      wait(0.01) -- For any silly classic C++ bards, yes, they measure waiting time in seconds, not milliseconds.
      end

    • @its_hallux4581
      @its_hallux4581 2 ปีที่แล้ว

      @@bearreyes1837 You can use tweening, its good piece of code. Tweening is so smooth and very easy to learn

    • @bearreyes1837
      @bearreyes1837 2 ปีที่แล้ว

      @@its_hallux4581 I actually know already, I just didn’t discover it that time I made the code.

  • @Bradificus47
    @Bradificus47 4 ปีที่แล้ว +19

    I love this, you are the only tutorial i could find that is not hard to understand, definitely making a game by the end of this!!!! Love this series!

    • @pelzumi9600
      @pelzumi9600 4 ปีที่แล้ว +3

      Me too

    • @cosmicblox934
      @cosmicblox934 4 ปีที่แล้ว +3

      me too

    • @RealSpyduh
      @RealSpyduh 4 ปีที่แล้ว

      Cosmic Blox hey guys wanna share some ideas to each other and probably help each other out add me on discord Riryo#1652

    • @RealSpyduh
      @RealSpyduh 4 ปีที่แล้ว

      pelumi bello Cosmic Blox hey guys wanna share some ideas to each other and probably help each other out add me on discord Riryo#1652

    • @cosmicblox934
      @cosmicblox934 4 ปีที่แล้ว +1

      @@RealSpyduh can u build?

  • @sergkinder2382
    @sergkinder2382 5 ปีที่แล้ว +45

    I like if statements, and I'm excited to learn them! I've been wanting to learn them for a long time! Cool!

    • @Bradificus47
      @Bradificus47 4 ปีที่แล้ว +2

      Me too!

    • @firacita
      @firacita 4 ปีที่แล้ว +2

      the if statements have a big importance to me, i am very sure many other fellow developers think these statements are important and they can’t make their games without them.

    • @talha6998
      @talha6998 4 ปีที่แล้ว +1

      me too.

    • @boopbebop3406
      @boopbebop3406 4 ปีที่แล้ว +1

      @@firacita mhm! Like if you want to do:
      if - line of code right her then
      print(“”)
      If statements are really important.

    • @babaxman4237
      @babaxman4237 3 ปีที่แล้ว +1

      Uhhh... What us if statements really for?

  • @jpuck6221
    @jpuck6221 4 ปีที่แล้ว +34

    *first 25 sec* explains the concept I didn't understand for 2 days
    me: yeah this is the good tutorial

    • @MegaYarr
      @MegaYarr 4 ปีที่แล้ว +2

      Ikr

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

      if statements are actually so easy if u got experience

  • @mrjoestur5966
    @mrjoestur5966 2 ปีที่แล้ว +4

    Don’t know why but a year ago I struggled really hard with these, they were way too complex for some reason and my brain couldn’t learn it right. It almost led me to copying code, but I just decided to stop Roblox developing in case I did start to copy Roblox code. But a year later and I decide to look back into it, and I can understand this tutorial so well and I even took some notes that helps me even more. Thanks DevKing 👍! Not that prepared for advanced but I’m ready for anything 😃

    • @tkn1ght493
      @tkn1ght493 ปีที่แล้ว

      hve to take notes?

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

      @@tkn1ght493 i always take notes its fun

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

    Fun thing about lua and python is that even if you learn 1 you can also easily master and learn another
    I learnt puthon and because of that lua is every easy

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

      same

  • @zoesworld5347
    @zoesworld5347 4 ปีที่แล้ว +5

    These tutorials are very helpful! I've been doing scripting for a while and I am not fully advanced. These things help set me up for certain things. Thanks so much for making these series.

  • @scarefoe
    @scarefoe 4 ปีที่แล้ว +14

    I have watched so many coding tutorials and they all make it super complicated. Thank you so much for this series. I am confident I will be able to make a game by the end :)

    • @artv7291
      @artv7291 3 ปีที่แล้ว

      He doesnt explain best practices. Variable names need to be descriptive.

  • @gamerdude422
    @gamerdude422 4 ปีที่แล้ว +89

    Don’t worry, I usually say “equals equals”

  • @Lanistes
    @Lanistes 2 ปีที่แล้ว +1

    4:51 the most satisfacing sound in this vid

  • @kombuchamushroomppl
    @kombuchamushroomppl 3 ปีที่แล้ว +5

    i had a little fun and did this,
    local x = 1
    local y = 3
    print (x+y)
    if x+y==4 then
    print ("yes")
    end
    i made it so it says "yes" when 1+3=4
    which it is so the output is
    4
    yes

    • @ItsLeeeroy
      @ItsLeeeroy 3 ปีที่แล้ว +1

      Yeah I taught myself some scripting basics

    • @KenzieAleron
      @KenzieAleron 3 ปีที่แล้ว

      just wait until you learn about elif, you can make it say "no" if 1+3 is not 4!

  • @mikasa1047
    @mikasa1047 4 ปีที่แล้ว +2

    Gotta love the like to dislike ratio, 1.1k likes and only 9 dislikes. Proves how good your tutorials are.

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

    man ur the best i still cant belive that i understand this now instaid of thinking those are random words and "what the heck do they even do" i dont have that feeling after watching ur playlist

  • @magma2726
    @magma2726 4 ปีที่แล้ว +1

    im kinda late to your beginners roblox scripting series but 3 mins into the video i already knew what if statements are so thankyou and ill be sure to be a pro soon from your videos :)

  • @meatball7701
    @meatball7701 4 ปีที่แล้ว +3

    Thanks for these tutorials man, really nice and well explained. I'll be sure to like these videos, and re-watch them.

  • @pootisgaming5078
    @pootisgaming5078 2 ปีที่แล้ว +1

    2022 and this guy is still giving the most usefull lessons, tysm gonna see the entire thing again so i can understand

  • @ItsLeeeroy
    @ItsLeeeroy 3 ปีที่แล้ว +25

    Local x = “Dababy”
    If x == “Dababy” then
    Print(“Less go”)
    end

    • @jesusbarajas9220
      @jesusbarajas9220 3 ปีที่แล้ว +1

      @@roguenogue local x = Dababy
      if x == Dababy then
      print("less gooo")
      end

    • @unsimplehumain116
      @unsimplehumain116 3 ปีที่แล้ว

      local x = "less go"
      if x == "Dababy" then
      print("converteble")
      elif x == " crewmate " then
      print("susbro")
      else
      print("joemama"
      end

    • @ItsLeeeroy
      @ItsLeeeroy 3 ปีที่แล้ว

      @@unsimplehumain116 elif - elseif ?
      print(“joemama” = print(“joemama”) ?

    • @unsimplehumain116
      @unsimplehumain116 3 ปีที่แล้ว

      @@ItsLeeeroy ya im typing fast but elif is a real thing

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

      mobile user detected initiating femur breaker

  • @DashGamerCool
    @DashGamerCool 21 วันที่ผ่านมา +1

    Ok so I tried this out on a Part, but then whenever I climbed the part, I just slipped and was flinged out of the part

  • @iamb0
    @iamb0 4 ปีที่แล้ว +1

    3:04 so this is just a script to check if the scripts work or not

  • @Someone-qp3om
    @Someone-qp3om 3 ปีที่แล้ว +1

    really good i took a break and i started watching over again it was so good that i remember almost everything!

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

    Im a few months into scripting. Watching through the playlist for beginners to refresh! This one caught my attention pretty awesome if statement tutorial!

  • @xrotator8986
    @xrotator8986 4 ปีที่แล้ว +1

    Hey, thank you so much! I know it's not much, but I must thank you for teaching me! I was able to write a function that made a part become red, Neon and then into a ball after your if statement video. Keep it up! Also, I think I saw a huge bost in confidence her!

  • @randomtrooper7069
    @randomtrooper7069 2 ปีที่แล้ว +1

    if you want to make it even more complex then you can do
    local a = game.Workspace.Baseplate
    if a.Anchored == true then
    a.Anchored = false
    end
    wait(2)
    if a.Anchored == false then
    a.Anchored = true
    end

  • @somu1605
    @somu1605 3 ปีที่แล้ว +1

    What i learned for if statements:
    local part = game.workspace.Part
    if part.Anchored == true then
    part.Anchored = false
    wait(1)
    part.Anchored = true
    then can be done with numbers too:
    local x = 3
    if x == 3 then
    print("Yeah boy")
    This will print ("Yeah Boy") because x = 3.

  • @MwSama
    @MwSama 4 ปีที่แล้ว +1

    these tutorials are actually so good lol :) and it feels entertaining lol

  • @BRISKYFN
    @BRISKYFN ปีที่แล้ว

    hey man. ive never scripted but im here on the 7th tutorial and i really understand and im starting to script alone. i used to think how people just make the scripts out of their mind. now i do it! thanks for these videos.

  • @certifiedhoodclassic638
    @certifiedhoodclassic638 4 ปีที่แล้ว +3

    This is an AMAZING tutorial series

  • @rusheyes07
    @rusheyes07 3 ปีที่แล้ว +1

    7:10 --> it did not work for me. I wrote exactly what you did, I checked it so many times and it still doesn't work! Could you help me?

    • @Voided2
      @Voided2 3 ปีที่แล้ว

      show me thr script

    • @rusheyes07
      @rusheyes07 3 ปีที่แล้ว

      @@Voided2 local Baseplate = game.Workspace.Baseplate
      if Baseplate.Anchored == true then
      Baseplate.Anchored = false
      wait(2)
      Baseplate.Anchored = true
      end

  • @gamingfizz1803
    @gamingfizz1803 ปีที่แล้ว

    i dont like how he explains one thing for too long
    but i like how he goes straight to the point

  • @Lyn_405
    @Lyn_405 2 ปีที่แล้ว +1

    i made a discovery if you put local x = 7
    local y = 2
    if x or y == 9 then
    print ("YES")
    it will print YES because it adds up and idk if he covers it later in the playlist but this is for people who didnt know

  • @burntbrownie
    @burntbrownie 4 ปีที่แล้ว +1

    For anyone watching, you could use If statements to fix bugs in your game. For example, you could have it detects if a player has glitched into a area they shouldn't have, if they have then it teleports them out of there.

    • @AriusWight
      @AriusWight 3 ปีที่แล้ว

      How? I mean I understand this. But how do you type it?

    • @burntbrownie
      @burntbrownie 3 ปีที่แล้ว

      @@AriusWight man I typed this 9 months ago I’m onto. Better things lmao.
      you can ask this on the dev forum though

    • @gabrielc7861
      @gabrielc7861 2 ปีที่แล้ว

      @@AriusWight were not in advanced so I don't exactly know but I bet it's like: you need a part, name it "OutOfBounds" and make it transparent and to have collideable false but cantouch on, then make it so when you touch "OutOfBounds" it teleports you to a in bounds coordinate and boom.

  • @sm0kxy
    @sm0kxy 3 ปีที่แล้ว +3

    Alright so i tried to do the script and i got this
    local Baseplate = game.Workspace.Baseplate
    if Baseplate.Anchored == true then
    Baseplate.Anchored = false
    wait(2)
    Baseplate.Anchored = true
    end
    And my baseplate won't fall, what did I do wrong?

    • @rainyway3661
      @rainyway3661 3 ปีที่แล้ว

      local Baseplate = game.Workspace.Baseplate
      if Baseplate.Anchored == true then
      Baseplate.Anchored = true
      wait(2)
      Baseplate.Anchored = false
      end
      If it's true it wont fall and if it's false it will.

    • @PolarKunai
      @PolarKunai 3 ปีที่แล้ว

      @@rainyway3661 i did what he did in the video and my baseplate didnt fall for 2 seconds, it didnt fall at all

  • @voidblock4700
    @voidblock4700 2 ปีที่แล้ว +1

    only 7 minutes? im subscribing

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

    Watching this 6 years later still best scripting tutorials out there

  • @prof7601
    @prof7601 3 ปีที่แล้ว

    This one is one of my favourite. Your tutorials are very nice and fun. Keep it up!

  • @pepe.2505
    @pepe.2505 4 ปีที่แล้ว +11

    When you move on to if statements it feels like you finish a subject in history class.

  • @MoreAnimationStudios
    @MoreAnimationStudios 3 ปีที่แล้ว

    this video is the best tutorial I have ever seen because I now know how to make a "if" statement and "if" statements are so important in scripting. thank you TheDevKing

  • @obease_kitten_4552
    @obease_kitten_4552 2 ปีที่แล้ว +4

    i see a cat on someones window rn

  • @OlekGD-u8i
    @OlekGD-u8i 11 หลายเดือนก่อน

    THATS THE MOST EXPLAINED AND BASIC THING YOU EXPLAINED ME, here is a script that makes the baseplate invincible after 3 seconds:
    local Cheese = true
    if Cheese == true then
    wait(3)
    game.Workspace.Baseplate.Transparency = 1
    end

  • @zenkenshiki3182
    @zenkenshiki3182 2 ปีที่แล้ว

    If statements
    Local x = 3
    If x == 3 then
    Print (“yes”)
    end
    - When making an if statement two equal signs are needed to check if it's equal.
    We use if statements to find things out so if a player has 1000 dollars then they can buy this item
    Local x = 3
    Local x = 4
    If x == 3 and y = 4 then
    Print (“yes”)
    end
    --The and lets you add more things so let's imagine a player needs 1000 dollars and 2000 exp to get this item
    Obviously if you don't have one or the other you can't get the item
    P.S thank you devking for these tutorials they are very helpful

  • @iceskuiis6180
    @iceskuiis6180 3 ปีที่แล้ว +1

    1:23, I don't understand what equal to equal means.

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

      yea i have the same problem idk what that means

  • @kingnugget8779
    @kingnugget8779 4 ปีที่แล้ว

    You ain’t joking about being the dev king being a good king, helping your people!

  • @xclamationn
    @xclamationn ปีที่แล้ว

    THANK YOU SO MUCH! ive been trying to learn lua but i really didnt know where to starts from. I watched Up to this video at the time of this comment and i managed to make a colorchanging part!

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

    bro that makes me have an idea for a generator from a horror game, im so excited for learning more!!!

  • @l3g3nd59
    @l3g3nd59 6 ปีที่แล้ว +2

    this has nothing to do with if statements but what is the point of putting local in front of a variable because I noticed that this code still works
    a = 5
    if a == 5 then
    print("sup")
    end
    I also noticed that u dont need local for functions either
    function hi()
    print("sup")
    end
    hi()
    So why do i need to put local?
    thank you!

    • @justguy7290
      @justguy7290 5 ปีที่แล้ว

      When I was watching a video the person said local just makes it execute a little faster

    • @justguy7290
      @justguy7290 5 ปีที่แล้ว

      But then again not sure that's why I am here learning xd

    • @hoyabobai1115
      @hoyabobai1115 5 ปีที่แล้ว

      Because there local makes it so that only local functions and such use local variables!

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

      This is the first comment

  • @justfyox6869
    @justfyox6869 3 ปีที่แล้ว

    While watching this I got kind of a grasp on elseif statements, so thank you again TDK :D

  • @Rip-soul
    @Rip-soul 4 หลายเดือนก่อน

    5:22 u can also replace
    If Baseplase.anchored
    By using the variable:
    If Baseplate == true
    BUT you will have edit the variable to this:
    Local Baseplate = game.workspace.Baseplate.Anchored

  • @averagehello1018
    @averagehello1018 4 ปีที่แล้ว +1

    this helps me alot thanks devking

  • @Star-eb5zg
    @Star-eb5zg 2 ปีที่แล้ว +2

    “==“ means “the same as”😊

  • @Ritsoku
    @Ritsoku 3 ปีที่แล้ว +2

    just found out something, if you higlight some text in RBX studio and do a parenthesis it will do a parenthesis around the text :0

  • @ynn9173
    @ynn9173 3 ปีที่แล้ว +1

    Can someone tell me why 7:00 did not work for me

  • @enemyblox
    @enemyblox ปีที่แล้ว

    For who still doesent get it it's simple it's just like if this block is anchored then play that music or something, and for who doesent understand wait you just put wait(any number) and the number you put next to wait is how many seconds it will wait and after the seconds finishing you have to put a script after the wait and it will play the script after waiting

  • @paravalent7974
    @paravalent7974 4 ปีที่แล้ว +1

    my parents put me in a course to learn coding. out of all my 5 months(I think), I have learned more from here

    • @arunmoses2197
      @arunmoses2197 3 ปีที่แล้ว +1

      I learn from here only because I really want to make Roblox games :)

  • @KrunkleGT
    @KrunkleGT 2 ปีที่แล้ว

    I love the way you explane the scripting and now my best script is
    local Transparency = 0.5
    local Anchored = true
    if Transparency == 0.5 and Anchored == true then
    game.Workspace.Baseplate.Transparency = 0.5
    game.Workspace.Part.Anchored = false
    end
    print ("it worked!!!")

  • @isaiah4tone
    @isaiah4tone 4 ปีที่แล้ว

    Yay! I was excited for this one, always wanted to learn about if statements.

  • @wspitswinston8866
    @wspitswinston8866 4 ปีที่แล้ว +1

    thank you so much dude. these tutorials have helped me so much, and i'm doing a lot better at scripting

  • @praneshbalaji8047
    @praneshbalaji8047 3 ปีที่แล้ว +2

    i made this scrip but the baseplate did'nt fall local Baseplate = game.Workspace.Baseplate
    if Baseplate==true then
    Baseplate.Anchored=false
    wait(4)
    Baseplate.Anchored=true
    end

    • @rainyway3661
      @rainyway3661 3 ปีที่แล้ว

      local Baseplate = game.Workspace.Baseplate
      if Baseplate.Anchored == true then
      Baseplate.Anchored = true
      wait(4)
      Baseplate.Anchored = false
      end
      If it's true it wont fall and if it's false it will.

    • @praneshbalaji8047
      @praneshbalaji8047 3 ปีที่แล้ว +1

      @@rainyway3661 Thank you very much. it worked

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

    one of the commons examples of If statements will be Players Health:
    local playerHealth = 50
    if playerHealth

  • @Raef_-vc3en
    @Raef_-vc3en 2 ปีที่แล้ว

    Thank you I really appreciate your hard work to teach us all scripting and I did learn scripting from you and I'm really great at it now, so I started teaching other people how to script, thanks man we all really appreciate your teaching and hard work :)

  • @jacksonminglin5684
    @jacksonminglin5684 4 ปีที่แล้ว

    im learning stuff already 1:15 into the video because i already understand it because its like a function, im learning stuff and im proud. i put this code into the script:
    local function hi()
    print("Hotdog")
    end
    local x = 3
    if 3 == 3 then
    hi()
    end
    and it worked!!!

  • @cheef9504
    @cheef9504 4 ปีที่แล้ว +1

    Thank, you dude!! I’ve learned a lot about scripting bc of you!

  • @chqrltxn
    @chqrltxn 2 ปีที่แล้ว

    your really helpful, got a new sub! thank you sooo much for your scripting tutorials!

  • @nattoro5365
    @nattoro5365 3 ปีที่แล้ว +1

    "SO it's very simple"
    Beginner : Have courtesy with me.

  • @user-fl9rz9ke9g
    @user-fl9rz9ke9g 5 ปีที่แล้ว +1

    Dude, you just got the Oscar for being so epic.
    Love the vids so far, i really can come along pretty good.
    Thank you.
    - Drago

  • @HammoudiSh
    @HammoudiSh 3 ปีที่แล้ว +1

    Before i learned python i was trying to learn lua and found it hard, but when i learned it i found that learing lua is too easy specially with you

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

    His short chuckles makes the tutorial more lively tbh

  • @xdl4129
    @xdl4129 4 ปีที่แล้ว +1

    hey! quick question. how do i zoom in when scripting so the code is bigger?

    • @beetos
      @beetos 4 ปีที่แล้ว

      Ctrl + mouse wheel up

  • @MrEduX13
    @MrEduX13 3 ปีที่แล้ว

    3:59 and how i will know in the output who is true or false:?

  • @connor8703
    @connor8703 3 ปีที่แล้ว +1

    Can you please help me, I am trying to figure out how to combine two if statements so that it will only activate if two separate things apply

    • @3man3
      @3man3 2 ปีที่แล้ว

      Put if statement 1 then put and then put if statement 2

  • @yeetus9191
    @yeetus9191 4 ปีที่แล้ว +1

    Quick question - why, instead of a little line (|), is an ENTIRE KEY OUTLINED IN BLACK and when I type it types OVER WHATS THERE

    • @yeetus9191
      @yeetus9191 4 ปีที่แล้ว +1

      Nvm I fixed it

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

    this is soooo coool most coolest scripting tutorial i have ever seen

  • @tanner6477
    @tanner6477 4 ปีที่แล้ว +1

    Question could you make a if statement for colors

  • @aespathix3149
    @aespathix3149 4 ปีที่แล้ว +16

    local x = 6
    if 6 == 6 then
    print("YouJustGainedANewSubscriber")
    end

    • @zenoctis196
      @zenoctis196 4 ปีที่แล้ว +5

      wouldn't produce a value as in the code you wrote 'if 6 == 6' however the variable defines x = 6 so you should have written if x == 6 then it'd print the string

    • @alesonbrjk
      @alesonbrjk 4 ปีที่แล้ว +1

      @@zenoctis196 you are saying 6 isnt 6? you should only correct people when they are not right.

    • @memelord9965
      @memelord9965 3 ปีที่แล้ว

      @@zenoctis196 idiot

  • @seepingloop1268
    @seepingloop1268 3 ปีที่แล้ว +1

    Would the statement still work in a folder?

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

    1:00
    basically, == means IS IT? and = means IT IS.

  • @Ikmauki
    @Ikmauki ปีที่แล้ว

    I am subscribing. This is the best youtube channel

  • @thejetblackwings5802
    @thejetblackwings5802 3 ปีที่แล้ว

    Im watching much after the vid was made but tbh this guy is literally one of the best teachers

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

    For those who don’t know, “Wait()” is an outdated version. Yes, it still works but to ensure smoother code execution do “task.wait()”
    Keep up the great work, you taught me 98% of the scripting I know

  • @Tyler-jd3ex
    @Tyler-jd3ex 4 ปีที่แล้ว +1

    Knowing python definitely helps! Thanks for the videos!

    • @milan_beyenech
      @milan_beyenech 2 ปีที่แล้ว

      I totally agree I recently started learning Python and Java and I realized lua is like both those languages

  • @Reversals
    @Reversals 4 ปีที่แล้ว +1

    I know the basics of c# and i can say Lua is really similar, it kinda feels like if c# and python had a baby to me

  • @holtfoster283
    @holtfoster283 ปีที่แล้ว

    This guy is an absolute legend

  • @henree9245
    @henree9245 2 ปีที่แล้ว +2

    is this good?
    local b = game.Workspace.Baseplate
    local function weeee()
    b.Transparency = 1
    wait(10)
    b.Transparency = 0
    end
    local function yoink()
    b.Anchored = false
    wait(1)
    b.Anchored = true
    end
    weeee()
    wait(2)
    yoink()

    • @Leedler
      @Leedler 2 ปีที่แล้ว

      Yea, that's good. It works.

  • @mohammedpropro51
    @mohammedpropro51 3 ปีที่แล้ว

    In 1 day ican see 8 videos and it’s very good and thanks for learning

  • @littlebloxycola5185
    @littlebloxycola5185 3 ปีที่แล้ว +1

    how do you make it so if you touch something something happends