Beginner's Roblox Scripting Tutorial #7 - Parameters (Beginner to Pro 2019)

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

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

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

    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

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

      Why there no replys?

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

      @Builderman cool

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

      The invite do be expired

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

      Yeah

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

      Im so confused tbh WHY in the world is this whole output thing even neccesary

  • @TofuTuesdays
    @TofuTuesdays ปีที่แล้ว +400

    If anyone wants an example of how this can be used, review this code:
    local part = game.Workspace.Baseplate
    local function transformfunc (mat, trans)
    part.Material = mat
    part.Transparency = trans
    end
    transformfunc("Sand", 0.5 )
    wait(10)
    transformfunc("LeafyGrass", 0)
    Its quite simple, the moment you start the game the baseplate will become sandy and half transparent, then after waiting 10 seconds the code will run the function again, except with different parameters. It can be a huge help when you want an item or value to go through different states after a certain requirement has been met. Parameters are used here simply to save time and simplify code.

    • @unsolved1376
      @unsolved1376 ปีที่แล้ว +12

      good example thx

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

      great example

    • @NotSoGreatPerson841
      @NotSoGreatPerson841 ปีที่แล้ว +8

      OOOH i get it now. Thanks!

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

      Thank you so bro, you helped me understand parameters on a whole another level. Thanks!

    • @Azure546
      @Azure546 ปีที่แล้ว +8

      This was short easy and simple great explanation yk, not only that, after finishing 10 tutorials, I’d recommend testing yourself by using all of them without any help, and note the ones that you struggle with and rewatch those vids. Getting practice in can help you remember those.

  • @enlasted5320
    @enlasted5320 6 ปีที่แล้ว +301

    Holy. Thank you sir, you're the only individual who has explained parameters in a way so that I could understand them.

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

      Was just gonna comment this.

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

      Watch peasfactory

    • @MarioMario-yb3iz
      @MarioMario-yb3iz 4 ปีที่แล้ว +2

      @@tentix9022 thx man 😄

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

      @@MarioMario-yb3iz lol no probs

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

      Neoory doesn’t matter how long it is as long as it helps

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

    For those who don’t understand or still confused, parameters are like variables. Just think of them as variables, as in function(x, y). If you call function(1, 2), then x = 1 and y = 2.
    Since quite a decent amount of people see this, I’ll just add some more information, don’t read further if you’re easily confused. The variables that are passed into the parameters are actually copies. I’ll show you what I mean (and I haven’t touched Lua in a long time so I’ll be doing this with “pseudocode” mixed with C++):
    Let’s say we have a function called add that takes two integer variables…
    func int add(int x, int y) {
    return x + y;
    }
    And we have two variables called num1 and num2 outside, declared like so:
    int num1 = 0;
    int num2 = 1;
    Then passing that into the function - add(num1, num2) - should return 1 alright.
    Now let’s say we want to edit the parameters, adding 2x of each number (ex: x*2 + y*2).
    func int add(int x, int y) {
    x = x*2;
    y = y*2;
    return x + y;
    }
    So what do you think will happen if we run add(num1, num2) now? It should return 2 because 0*2 + 1*2 = 2. But here’s a question that comes up a lot with amateurs: are num1 and num2 multiplied too? No, the variables num1 and num2 are not changed AT ALL. This is because they’re passed in as parameters so int x and int y are simply variables that exist inside the function and the function only. Knowing some of you curious dedicated hardworking learners, you may ask, “Then how would I reference variables outside with my parameters?”
    Don’t worry, there’s a way. I’ll update this later because I’m on a phone.
    Alright here's the next part :)
    So in a language called C++, you can do so easily with something called "pass by reference". It works by defining the function as:
    function int changeNum(&num)
    Where the symbol & means "reference". However, this is (as far as I know) pretty much a C/C++ thing. We can work around it, however, in other languages like Lua. This requires a decent understanding of classes and objects. Just know that, classes are the templates to making objects, and they are basically "custom" data types programmers can write on their own. So we can have a "Person" class, with attributes like name and age (which has data types of String and int respectively), then we can mass produce people by making a ton of objects from that template. Weird analogy but I think it works (?). Moving on, primitive types are the basic building blocks of code. You've been using them already - int, double, boolean (true/false), char, etc. (Strings are objects btw because they are an array of char). What this basically means is that a String "references" where in the memory the first char is stored, and how many chars are after it, because we can only allocate so many data in a "block" (think binary 1s and 0s). We can't possibly have a whole chunk representing a string when they're just chars put together. If you see where I'm going with this, you're on track.
    Yes, we CANNOT pass by reference by doing function changeNum(num) because we're in Lua. But it's a different story if the parameter we're inputting is an object. Just make the primitive type into an object in any miraculous way possible. Store it in a table for example, idk lol.
    P/S: I haven't tested any of this second part but my guess should be right lmao you can test it on your own if it doesn't work uhh complain about it to me and I'll work on it.
    And some supporting evidence for my "shower thoughts": stackoverflow.com/questions/6128152/function-variable-scope-pass-by-value-or-reference

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

      aye i appreciate your help

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

      thank you OH MY GOSH

    • @josh-ug3qw
      @josh-ug3qw 2 ปีที่แล้ว +3

      i understand it now but what would be the point of them if u could just print x,y or whatever u put

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

      @@josh-ug3qw I don't know but it'll probably be more useful later on

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

      mate thanks for that

  • @emmettnredblue1857
    @emmettnredblue1857 5 ปีที่แล้ว +565

    I am so confused
    But I’m never giving up! I will watch this series over and over if I have tooo!

    • @ayanokouji5784
      @ayanokouji5784 5 ปีที่แล้ว +68

      same, i think this is my 3rd time rewatching the beginners series

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

      What are you confused about? These are pretty simple for the most part. I cam answer your question about this. If you still have questions.

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

      @@NewsOnQueue I don't understand how to do functions

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

      @@gabe1351 honestly just keep researching and practice writing the ones in tutorials and one day itll just click. What is it that you dont get about them?

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

      @@gabe1351 you type "local ("here the name of your function") and then ()
      the () are there for the parameters as you saw in the video
      after that you gonna type in your lines of codes and execute them with ("the name of your function") and then ()

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

    what is with this man and hotdogs

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

      hotdogs r cool

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

      Let's just say that he is always hungry and he loves eating hotdogs...

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

      ik i was gonna comment that lol

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

      He is spending 1000$/month on hotdogs.

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

      Plot twist his side job is a hotdog stand

  • @kemonogane
    @kemonogane 5 ปีที่แล้ว +64

    Helllo, U Helped me Alot Im Nomrallly an Animator for stickman figures then i learned how to Animate on roblox But then i said to my self, "I cant ony animate cause i dont even know how to put it in a key or how to make moves and Justu, punching,Magic etc Im so happy, i learned alot from you and u desserve more subs!

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

      Thanks man :)

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

      @@TheDevKing hi devking

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

      @@TheDevKing hey Dev King can I add you on roblox?

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

      @@TheDevKingI don’t understand the function part in part 5,6,7 I just wanted to tell u it is ok if u ignore me :(

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

    Guys, if his explanation of parameters was confusing, I'll provide the explanation that worked for me.
    Basically, in his first example function, he writes:
    local function add(hotdog, ham)
    print (hotdog + ham)
    end
    Then the next line he types add(2, 3), and running the script puts 5 into the output.
    Basically, the function add() was defined as adding the two values in the parenthesis. In the first block of code, which acted like a definition of the function, the values are hotdog and ham. In the next line of code, which says print (hotdog + ham), it means that because hotdog and ham are in the parenthesis, it's gonna add the values hotdog and ham and print the result into the output. The function basically says, "If I have two values in my parenthesis, I will be adding those values and printing whatever I get after I added those values."
    So basically he used the parameters to help define what he wants his function to do and make it more useful in terms of what it can do. I like to think of parameters as parts of the definition of a function.
    Hopefully this was a helpful explanation.

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

      Nice! Very simple and helpful. Thank you, man.

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

      Thank you this made me understand it better

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

      Tysm

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

      @@theroomateisamuffin9524 K-K-K-K-KAKYOIN!

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

      @@IX_4 everytime i comment someone says that lmao, you have a nice short name btw

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

    Hotdogs are the student that always gets picked, if he calls in sick the teacher will just call him on the phone.

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

    TheDevKing: i need a name
    hotdog: :I
    TheDevKing: ok, i'll use you

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

      Even a 8 year old could become a scripter after watching this. I should know(:

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

      @@blinkxero6756 are you saying you're an 8 year old?

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

      No I'm not

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

      @@imdurpy4145 i am around that age LOL
      i am learning script

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

      @@sushi7910 did you learn it yet

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

    others tutorials: 20 minutes
    TheDevKing tutorials: 5 minutes
    thx god!

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

      lol

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

      Not even 5 min there like 3 minutes

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

      Other channels usually explain everything and try to miss nothing.

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

      @EpicGreenYoda true

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

      alvin blox tought parameters while in his function video and i got so confused. but this is much better! plus alvin makes 20 min vids to explain and this is like 5

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

    hi i am litterilly watching this hole series all night he sun is just coming up

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

      @@MrMr-oj7hl Best way to learn scripting is to do everything he does on the video whilst on RBX Studio, also once he does something key, try and copy what he just did but without looking at the video, until you remember it, so if you do that to everything, you will remember EVERYTHING.

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

      @@MrMr-oj7hl Your welcome :)

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

      Tysm for the tip

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

      ​@@ClassyGamesTMtysm for the tip

  • @thyst7014
    @thyst7014 5 ปีที่แล้ว +88

    here before 7,000,000,000 subscribers! dude your the best

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

      lol

    • @zeptitan6037
      @zeptitan6037 5 ปีที่แล้ว +6

      To be honest I think it should be 7.7 billion though

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

      To be honest I think it should be 6.9 bilion though

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

      @@pranavmoolan8524 lol true

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

      this comment was a year ago and you still replied just now lol

  • @overk1lls755
    @overk1lls755 5 ปีที่แล้ว +15

    great man, i watched your videos a long time ago but got caught up in some work so i forgot a lot, but its good to see that i had still subbed to your channel and now i can re learn it all! :)

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

    For anyone that's confused, parameter is basically a function variable.
    E.g local function add(x,y)
    if I call this function by doing:
    add(num1, num2)
    it's basically saying:
    x = num1
    y = num2
    This is assuming you already have variables outside of the function named num1 and num2
    It might sound redundant at first, but you can do a lot with it, you just don't know enough to implement it.

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

      @PubxKitty911 for this you dont have to add " on Sweet unless it is used at the bottom called argument

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

      THANK YOU SO MUCH I UNDERSTAND NOW!!!! Many hugs and *hotdogs* for you 😊

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

    Throughout the whole series I noticed something
    DevKing likes hot dogs

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

    this series of 4-12 minutes long videos have been more useful than a complete 48 minute long video
    ty so much(sorry for bad english)

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

    the more i watch these tutorials and the more devking uses functions and variables, the better i feel. This truly is a beginners tutorial, thank you devking

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

    Example 1. (using return from the last video)
    function Addition(a,b)
    local c = a+b
    return c
    end
    print(Addition(5,8))
    -- The computer sees that we assigned 5 and 8 inside A and B.
    -- From that you can just think of it as like a math equation 5+8
    -- Then we return the c which is 13 since we calculated how much 5+8 is we get 13.
    -- So just think of the things inside the () the same as you'd do when doing a variable
    -- It's just the same as this
    local a = 5
    local b = 8
    local c = a+b
    print(c)
    Here is the copy paste for the script shown in the video.
    function add(Hotdog, Ham)
    print(Hotdog)
    end
    add("Sweet", 2)

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

      so is there really any purpose to them? Do they like, make your game less laggy or something?

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

      @@sandpaper1711 I think they are used like this. Lets say you have a input field where players can enter their names. So you just get the information from the input and put it in a parameter. This is what I think it is used

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

      Also they do help in the long run of coding since it's easier to just edit the part in the () than changing every single mention of them in the function individually

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

    Somehow this is quite better than any guide i've seen, i'm already an amateur, i've coded a few simple games in roblox. yet this already started explaining in the most understandable ways thing i never understood even after 1 year of programming. sweet.

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

      i jsut going through taking notes as i go, usually one page per video but im trying my bestg

  • @lacasadepapel4356
    @lacasadepapel4356 5 ปีที่แล้ว +13

    Here before 6969 subs, I love your tutorials. I always wanted to learn lua, but all tutorials SUCKED, but yours is actually helpful. I will make the best games I can with all this when I reach the end of these tutorials

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

      Omggg 69 FUNNInnumMABERRR RR R R R

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

    I do recommend this tutorial to someone who's never learned a coding language before because if you already know a coding language you know like 80% of this course. It would be nice if there was a tutorial explaining their differences because the difference between most coding languages are small.

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

    if any are still confused after reading all these comments, this is the basic example. at 1:42 he states that he can put a value in and then he does, and at 2:42 he should've said "you're probably wondering, how does 3 and 2 make 5 out of hotdog and ham?" its because it added them in order. this is what i was confused with, hope others find this helpful.

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

    so if you guys came to it yet, parameters are just like substituting values in a math equation. you set the formula (or in this case, the parameters), and then u substitute the values to get the final answer. just a helpful guide if anyone found this confusing (pretty unlikely btw, he explained it great)

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

    I have watched up to now and so far, you have been so extremely helpful! The only thing I wish you would do is use the scripts in a way you would normally use it instead of printing Hotdog.

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

      that would make it confusing for people who get lost easily. It's a lot more to take in instead of just the topic of the video.

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

      @@practicalcucumber1395 maybe but for me its more confusing cuz i dont know how its supposed to be used it would make things less confising if he could like make a example with a script he normally uses this on so we know how its supposed/can be used

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

      @@justarandomguywholovesanim726 for real

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

      he's trying to express his likings for hotdogs

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

    this guy exists yet people still dont know how to script this guy is a GIFT

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

    Alternate title: print but more complex

    • @HiBye-rq2mr
      @HiBye-rq2mr 3 ปีที่แล้ว +6

      nope

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

      @@HiBye-rq2mr 17h ago ok

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

      more like local but more complex

    • @HiBye-rq2mr
      @HiBye-rq2mr 3 ปีที่แล้ว +3

      fucking asked?

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

      no its not print but more complex sorry if im being rude im not trying to be

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

    Okay if you don't know, here's the conclusion, hope you'll like it :). :
    Basically we're like making values like Hotdog, Ham in the video. then we call the function and add those two values together.
    Hotdog, Ham = 3,2 and the "strings" are like words even tho they're numbers like "3" "79" "Test" Integers are numbers.

  • @user-do8jq4kd5z
    @user-do8jq4kd5z 3 ปีที่แล้ว +11

    Example:
    local function multiply(arg1, arg2)
    return arg1*arg2
    end
    local Variable = multiply(6, 2)
    print(Variable)
    it will print 12 because 6x2=12

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

      This comment made me understand the video, thanks man

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

      I was understanding the video but now I see your comment and it just ruined everything

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

      Can u. Make it simpler

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

    Thank you TheDevKing, With all your videos till now, this is my Script :
    local function myFunction1()
    local MakeFunction = 76
    print(MakeFunction*2)
    end
    myFunction1()
    local a = 5
    local function myFunction2(e, s)
    local MyFavouriteNumber = 5
    print (MyFavouriteNumber+a)
    end
    myFunction2(5, 19)
    local function ReturnCommand()
    print("This is my Whole script that I made")
    -- Script
    return("Wow, this is Advanced!")
    end
    local ReturnC = ReturnCommand()
    print (ReturnC)

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

    Your videos are so easy to understand and you actually explain everything you do,than just write some code and dont explain anything about it.Ty TheDevKing for your videos,they are truly brilliant.

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

    i've been scripting for 1 year and i never learned i just watched others and im really starting to grasp this

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

    When you said functions might be getting a little boring now but I am actually enjoying learning how they work and how you give body to your function :)
    local function Me(Name, Year)
    print("My name is ", Name, ", it is the year ", Year, ".")
    end
    Me("Patt", 2021)
    I like to mess around and see what I can do with the functions, Hopefully I become a professional programmer in no time

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

    Bro, I watched TONS of tutorials and none of them made me understand but u did. I will sub to you

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

      local function amongus(imposter, crewmate)
      print(imposter+crewmate)
      end
      amongus(10,1)

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

    My school : takes 2 years to get to function
    TheDevKing : your wish have came true

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

    After attempting to educate myself on LUA Scripting, and many fails I've finally found a way. You truly made it easier for me to figure out the basics for scripting and taking notes on the logic and all the possibilities was amazing and very useful. Bravo.

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

    You are so underrated. You’re tutorials are amazing and you deserve more subscribers and viewers! You are so friendly and id much prefer to watch your tutorials than anyone else’s because you explain them so much easier and you’re very understanding. ❤️

  • @Youtuber-sq2fj
    @Youtuber-sq2fj 5 ปีที่แล้ว +6

    I am learning so much! I could not thank you enough! :D

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

    omg brooo for the last few months i had a problem with understating parameters and arguments, now i finally got it!! thank you so much

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

    This guy really love hotdogs... xD

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

    i swear this dude will unknowingly teach someone that will become a popular roblox dev in the future

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

      probably what happened with the creator of get a snack at 4 am. she mentioned thedevking in the credits page for his tutorials

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

    local function add(Number1, Number2, Text)
    print(Number1+Number2..Text)
    end
    add(1,3," yas")

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

    The Most Helpful Person I Ever Watched, Continue Bro

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

    Hello! I know I am late since this video is 4 years ago but, may i ask what print(Hotdogs) does in the code?

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

      Print(Hotdogs) tells the script to say "Hotdogs" in the output, the output is that thing on the bottom where all the numbers and letters are printed.

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

      @@Gorillix2024 and hotdogs = 3,2 so it prints 5

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

      Print(Hotdogs) basically tells the output section to say "Hotdogs" when you run the game, printing is mainly used to fix bugs, other than that it doesn't really have a use. Hope this helps!

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

    bro u deserve way more views ur tutorials are great

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

    You explain it the best but I just don't know what to use any of these stuff for
    Can I please have a reply and tell me what to use functions for and other stuff!

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

      Wow I use functions so much now, I am also making a game. The game is a car game. Instead of using he car chassis tune, I made my own, thanks to thedevking I can makes games now.

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

    Your tutorials are so simple and I love your jokes
    If I were to pick any TH-cam tutorial i would choose yours :D

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

    Are you hungry watching these? 😂
    Thank you so much tho!

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

    local function car(firstpart, secondpart, thirdpart)
    print("car contains", firstpart, "and", secondpart, "and", thirdpart)
    end
    car("engine", "windows", "frame")
    an example :)

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

    But couldn't I just add a variable. Why is there no "2" when called with a string?

    • @EB-db1us
      @EB-db1us 4 ปีที่แล้ว +1

      Because he calling "First "parameter with print its Hotdog .Look at top paramaters (hotdog"Firtstparameter",Ham"Second Parameter"). if he call print(ham) output will give 3x "2" because print calling "Second" parameter (sorry for my english)

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

      @@EB-db1us Oh that's makes more sense.

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

    parameters is just variables inside brackets and you can change their values anytime when you call (type the function) but its a bit specific in placement.

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

    You make everything so easy to understand, I tried PeasFactory AlvinBlox and many other channels and this is the only one that actually makes me engaged and I learn from it. You explain it well and short. So you don’t waste time for 8 minutes you get straight into it and you actually explain extremely well. Thanks man.

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

    You can also add variables when you define the parameter for example:
    local Number4 = 4
    local function add(FirstNumber)
    print(FirstNumber + 2)
    end
    add(Number4)

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

    If parameters are essentially variables, why not just define a variable (or local variable) for it? Why use parameters, that is what I am confused about.

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

      Watch alvin bloxx his tutorial also explains about parameters check it out.

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

    Damn, this is probably the only concept outside of printing that I learned without having to practice after, thank you!

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

    i'm eleven and im trying to learn as more as i can so it can help in future btw i want to be a game dev.

    • @TeamTrapMike
      @TeamTrapMike 5 ปีที่แล้ว +10

      I'm in an entry level college computer science course and all of this is stuff we've been learning. If you can learn this stuff when you're 11 you'll be way ahead of most people, keep it up!

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

      I wish I had have learned this stuff when I was 11 lol. this is a hobby for me but I just finished my first year of college so I have lots of time to practice now

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

      very happy to hear but just don't expect it to be useful and take it as an hobby or POTENTIALLY useful because I have seen a lot of kids do it...just helping ;)

    • @Splash滴
      @Splash滴 4 ปีที่แล้ว

      @@TeamTrapMike Yeah he's right all of this will forever be needed in order to get into the complicated stuff.

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

      @Mike C I’m actually 10 and almost in the advanced series. (:

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

    for those who dont understand basically, lets say u type a parameter in the brackets ok? then u type print(name of parameter) u type both of the parameters. then u call the function at the end and then add the value u want inside the bracket. basically the parameters u first made dont have any value but after u call the function u add a value to the parameter and then it prints the value u gave to the parameter(s) to the output. hope this helped.

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

    For ppl who are confused, basically parameters are like variables for example local function Stuff() In these () i want to find stuff. To save our time finding it using a function instead of using an variable to find it we use PARAMETERS so, to write an parameter we put the thing we want to find inside of the functions () and now the code would be local function stuff(stuff) Now, since we found it, I can use the parameter how much I want to use it (for me) now I would (for me) I would return "stuff" if successful. for example local function stuff(stuff) return true print(" returned"..tostring(stuff)) And as you see, I use stuff again cuz I was looking for stuff using an function. And yeah! Hope you understand.. and if you don't understand to tostring method.. I will create an video about tostring

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

      thanks man this really helped a lot

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

    Protect this man at all cost!!!!

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

    For some reason I think returning is the easiest.

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

    Wow easy understanding
    Every one should teach like you

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

    What I learned for Parameters:
    local function bruh(No, Yes)
    Print(No)
    end
    bruh(Lol, Yes)
    When runned, it should print "Lol" in the output
    You can do the same with numbers:
    local function add(12, 31)
    print(12)
    end
    add(25, 90)
    When runned, it should print "25" in output.

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

      This if true actually helped me understand it a lot better thank you tons mate

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

      @@malt_y7280 Just try think of it a changing Variable eg.
      function Help(69,420)
      print(69)
      end
      Help(21,9999)
      should print 21 cuz we want to print 69 but we decided wanted to change it

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

      @@mrnormalrobloxian5060 i know this is 2 years ago but i love you for this comment

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

    local function ThankYou(TheDevKing)
    print(TheDevKing)
    end
    ThankYou("Thanks for these amazing tutorials!")

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

    I watched the vid without sound and with subtitles and when he says 'the dev king' the subtitles say 'the deaf king" LOL nice vids BTW

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

    TheDevKing: **tries to think of an example for variables**
    TheDevKing: h o t d o g

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

    Alvinblox: hamburger
    Devking: hotdog

  • @1Name8R
    @1Name8R ปีที่แล้ว

    for those who are confused an easier way to do this is by doing
    local hotdog = 3
    local ham = 2
    now you've set the values into these variables/parameter's as you can see this is a bit easier
    and you don't have to do add(3,2) -- this is a bit confusing
    now you can do print(3,2) for those who are still having a problem this is how you do it
    function add(hotdog, ham)
    local hotdog = 3 -- btw this is what they mean by saying parameters' are just like variables because they are
    local ham = 2
    -- telling the function what to do
    print(hotdog + ham)
    end)
    now do --
    add() -- as you can see this is a bit easier then doing add(3,2)

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

    I never thought I would enjoy learning

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

      What can we use these scripts for? I’m trying to make a anime game and this isn’t helping very much

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

    If you guys still don't understand parameters, go watch alvin blox's tutorial about it on episode 3 on his beginner scripting tutorial guide on the timestamp: 5:02 as it is quite helpful.

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

    His tutorials are so good that I instantly understood what parameters are at 1:30

  • @MrGuy-mw3pl
    @MrGuy-mw3pl ปีที่แล้ว +2

    Ok i might be to late but at 4:29 when he is wrtiing sweet cool awesome and others why doesnt it print 2?

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

      In the parameter it says Hotdog, Ham but he only printed Hotdog in the function which when he called the function the parameter only recognized the Hotdog which equals Sweet. This is probably a bad explanation so you have any questions just ask.

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

      Ham is 2, but it si not printed because he did not print ham, he printed hotdog

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

      You cannot print 2 with the string for example you cannot print sauce with a number after and that’s why he only put print hotdog if you look closely if he put hotdog + ham it would cause an error hope this was helpful

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

    He seems so sweet and optimistic and i LOVE IT he also tends to put hotdog in the scripts a lot lmao.

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

    You can also return the sum of the two numbers by adding local sum before the equation. (Delete the print part if you do this)

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

    This is what I think parameters are:
    Parameters are variables that can only be used by functions.
    Parameters are also a place holder. - Example ⬇
    1 - local function add(HotDog)
    2 - print(HotDog)
    3 - end
    4 - add("Sweet") ----> it's gonna print Sweet because HotDog is like a place holder in this case it's for a Sweet, so if you type 1 - local function add(HotDog)
    2 - print(HotDog)
    3 - end
    4 - add("Sweet") it will print Sweet
    This is only my thinking on what parameters are so if people who know what they are can they comment to help me?
    Thank you

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

      Thank you

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

      @@imrantube747 no problem

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

      what does the , 2 mean?

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

    The way you explain is so easy! I have liked and subbed with notifications on!

  • @rx7.teykhan683
    @rx7.teykhan683 4 ปีที่แล้ว +1

    God give this man some hotdogs...

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

    For people who dont understand the parameters. Say you have a box, and in the front of the box you can insert two numbers to add together:
    local function add(Number1, Number2)
    print (Number1+Number2)

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

      wait can you make it so like it is 3? like local function add(Number1,Number2,Number3) ??

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

      @@GarNomadT yup

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

      @@Aizu_YT oh okay thanks

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

    some other youtubers take 30 minutes to explain something
    this man takes 5 minutes to explain the same thing and 10x easier

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

    You're my best teacher!

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

    Manifesting that your tutorials will help me make a successful game from scratch

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

    if youre wondering how it was able to print the function even though the print was AFTER calling the function, its because the print is part of the function. the function IS printing, so when you call the function, youre just printing it. (i was pretty confused on this for a while so i hope this helps anyone else)

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

    You sure does love hotdogs xD btw nice tutorials i'm learning so much

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

    :O!
    Hotdog is evolving! Hotdog involved into.. a... HotHamDog?
    2:27

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

    I am not sure I will ever know how hard it is to learn parameters without DevKing. I learned from your video and it was SO easy to understand

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

    Still useful to this day!!

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

    as a person who doesn't know scripting, i can confirm that i understand everything from this guy, other can't explain as simple as this guy

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

    No way the king will respond after 4 years

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

    im getting back into roblox scripting i already know a decent amount of lua so im skimming through some of your videos to refresh my memory while getting ready for topics like events raycasting and who knows what because i sure as hell dont

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

    It’s like my 5th time watching it but I finally get it!

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

    This this, is amazing I have learned so much after watching your other tutorials.

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

    this man and his hotdogs teach me a lot.

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

    bro istg i was so confused what parameters are and this just made it so clear

  • @Code-002
    @Code-002 2 ปีที่แล้ว

    My man mentioning his bros Hotdog and Hamburger in each episode👍
    Pure dedication to his homies👌

  • @17halilibo17
    @17halilibo17 7 หลายเดือนก่อน +2

    İngilizcem az ben bile anladım güzel video

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

    I think he was hungry when he was making this and he cant stop thinking about food.

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

    In this case, hotdog was the variable that was holding the value "sweet" and the 2 next to sweet was used to give the variable hamburgers a value. So hotdog = "sweet" and hamburgers = 2

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

      thank you

  • @Titan-qi9mv
    @Titan-qi9mv 4 ปีที่แล้ว +1

    I like you more than alvinblox, i often have to replay alvinblox's coding videos multiple times to even know what he's talkin about. But i just have to watch your vids once and i know how stuff works.

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

    I learn Roblox scripting from this guy faster than from Roblox's Forum itself. It's insane

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

    ive learned so much from this series on my first couple videos

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

    here before 50k thx dude u helped me so much