Functions - Roblox Scripting Tutorial

Поделиться
HTML-код
  • Опубликовано: 5 окт 2024
  • This tutorial will teach you how to use functions in Roblox Studio scripting, including parameters and arguments. This topic is crucial to understand Events which are coming next!
    Join membership for EXCLUSIVE perks:
    / @alvinblox
    SUBSCRIBE to learn how to master Roblox scripting:
    www.youtube.co...
    Watch my full beginner scripting series:
    goo.gl/k3erz2
    Roblox username: Alvin_Blox

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

  • @AlvinBlox
    @AlvinBlox  3 года назад +521

    Thanks for the support on this series so far everyone :)

    • @SiddharthKSampada
      @SiddharthKSampada 3 года назад +5

      First!

    • @SiddharthKSampada
      @SiddharthKSampada 3 года назад +12

      And also Alvin your tutorials help me soo much
      Keep making great tutorials like this which helps me and my fellow scripters a lot.
      TY

    • @windindustries4486
      @windindustries4486 3 года назад +1

      :)

    • @zerodevsz5505
      @zerodevsz5505 3 года назад

      First

    • @I_am_thing
      @I_am_thing 3 года назад +1

      Can u friend me on discord Alvin I have a question I_Am_thing#2266

  • @nicolaifeldthaus4649
    @nicolaifeldthaus4649 3 года назад +670

    Yo Alvin, have you ever stopped to think how many people you’ve helped? Thanks alot

    • @priz6751
      @priz6751 3 года назад +2

      First

    • @be8090
      @be8090 3 года назад +2

      Yes

    • @Djjskd
      @Djjskd 3 года назад +16

      Im making a game for my friend birthday and I used free models but I thought what If. I made my own script so I'm starting

    • @thompie6877
      @thompie6877 3 года назад +1

      First reply

    • @godlygamer2466
      @godlygamer2466 3 года назад +2

      @@thompie6877 no u aint

  • @darien-
    @darien- 3 года назад +197

    I love this guy so much, He's been doing the same series for 3 times now. From the time his voice was so small to a full grown teenager. I have to admit, I'm not an OG fan but I'm still glad I found his channel. Because of him, I made almost 3k robux from 3 seperate games that I made with a help from Alvin's videos.
    I pretty much quitted being a developer and forgotten all the scripting stuff. But this guy burst in with the tutorials. This can help me on making robux again. If you haven't subscribed, what are you doing in your life man.
    Alvin movin mad with the tutorials fam 🔥🔥

  • @saadusmani78
    @saadusmani78 3 года назад +96

    I want to say thanks to you. I have an interest in working at a space company in the future. And honestly, even though i am not coding much on roblox nowadays, i still have interest in roblox studio, and without it, i probably wouldnt have gotten interested in software engineering. And since u were my 90% source for learning roblox scripting basics, i really want to say thanks.
    Edit: You have literally affected many people's future, just by making videos.

    • @kestrells
      @kestrells 2 года назад +1

      @Salxs Roblox scripting is considered 'easy' and is a good introductory way to get into scripting a step up from scratch

    • @spoopygmd
      @spoopygmd 2 года назад +1

      @@kestrells it depends what you are making

    • @hieu216tdq8
      @hieu216tdq8 2 года назад

      @@kestrells yep

  • @eronkarlvictorino7401
    @eronkarlvictorino7401 3 года назад +34

    i love this series it gets better everytime

  • @thedripduck8688
    @thedripduck8688 3 года назад +19

    i love seeing him progress from a kid and still being so helpful

  • @ultra3806
    @ultra3806 3 года назад +17

    thanks for these honestly, I have a year of lua experience now because of your 2020 series

  • @reolizations5331
    @reolizations5331 3 года назад +107

    Ahh yes that time of year :)
    Could we also possibly get an advanced animation video in the future too? Like custom rigs, making a spell appear out of nowhere, those kind of fundamentals?

  • @detrimentaldoge5464
    @detrimentaldoge5464 3 года назад +5

    I’ve grown an interest in making a roblox game, and this is getting me really excited. The function part looks really cool, and I already understand it thanks to some experimenting in scratch.

  • @duckyslay346
    @duckyslay346 3 года назад +7

    this is so helpful!! i am an "old" roblox dev and moved to JavaScript and forgot how to script with roblox.... This series is so helpful!! Thank you bro

  • @adventureboy444
    @adventureboy444 3 года назад +94

    Yay another tutorial. I am looking forward for it.

  • @namesroger2120
    @namesroger2120 3 года назад +8

    These tutorials help me so much, because Alvin explains them so well, and explains the way the code behaves, meanwhile I just resume the stuff on my book, which helps a ton, thank you Alvin. And don't stop making these, you make for a great teacher.

  • @meimark4879
    @meimark4879 3 года назад +5

    Hey Alvin, I was just passing by and saw this video, even though I know lua, i still wanted to check it out, its so nice you help others achieve their dreams

  • @bloxquiiity3861
    @bloxquiiity3861 3 года назад +55

    I would like to add one somewhat helpful tip to this tutorial! You can simplify the script even more rather than leaving the argument every time with changeTransparency(game.Workspace.AlvinBlox, 0.5) or whatever.
    We can shorten it using Local and naming the part something simple as it follows :
    local Subject = game.Workspace.AlvinBlox
    function changeTransparency(part, newTransparency)
    part.Transparency = newTransparency
    end
    changeTransparency(Subject, 0.5)
    wait(2)
    changeTransparency(Subject, 0.75)
    Hope someone finds this useful! I just thought of it while also trying to pick on learning scripting again watching these awesome tutorials!

    • @wimpyoul4623
      @wimpyoul4623 2 года назад

      Thanks a lot! 😀

    • @elomelosky
      @elomelosky 2 года назад

      TY

    • @seeroktic
      @seeroktic 2 года назад +2

      Yes, it's simpler, but he most likely didn't do this as he hasn't touched on variables in this series yet.

    • @shikiraunderworld6762
      @shikiraunderworld6762 2 года назад

      Thanks, when i did alvins way it didnt work.........

    • @sahedulhasan8453
      @sahedulhasan8453 2 года назад

      ​@Varil Celan Worked for me though, you should probably check thoroughly for any mistakes. Something like this happened to me once, I overlooked the mistake and then finally after 10 minutes I noticed it.

  • @ClassyMen1919
    @ClassyMen1919 3 года назад +5

    This is the only tutorial series where I actually can learn and understand what's happening.

  • @anxryy2469
    @anxryy2469 3 года назад +4

    You explain everything very smoothly and make sure it’s easy to understand. Thank you, I am learning how to script at a fast rate.

  • @Typhooone
    @Typhooone 2 года назад +4

    Hello Alvin! using your coding and the stuff ive learned i made a simple command to say "hello World!" then make a blocks texture pebble, wait 5 seconds then make it clear! thank you for posting these videos!

  • @OptimalCaptain12344
    @OptimalCaptain12344 Год назад +1

    You're helping so much people with these videos on scripting including me. I would not be where I am without you.

  • @ArmiRoblox
    @ArmiRoblox 3 года назад

    I've wanted to make my own game since 2015 and I keep giving up and trying again but the videos all are hard to understand 6 years later I started watching you and you've helped a lot thank you so much AlvinBlox! you're the best.

  • @smallsynth
    @smallsynth 2 года назад +1

    these are suprisingly easy to follow, yet so useful. im not an easy learner at all, sometimes it takes me months to learn stuff in school, but this? thank you so much.

  • @yes_people7139
    @yes_people7139 3 года назад +1

    Thank you so much, honestly, I have had game ideas for years and just never understood what to do, but, now I'm getting there little by little because of these videos!

  • @bloxify9833
    @bloxify9833 3 года назад +2

    I LOVE THIS CHANNEL! THANK'S FOR TEACHING ME WHAT I LOVE!!!!!!!!!!!!!(Even tho I don't know much yet!)

  • @melonsmusicstudio5698
    @melonsmusicstudio5698 3 года назад

    Alvin blox, you basicly inspired me to watch ur vids and learn scripting in roblox, which ya’ helped me with along the way. Thank you.

  • @mrbriggs390
    @mrbriggs390 3 года назад +1

    The vids in this series are literally the only scripting lesson vids I actually understand 😅 so yah Tysm for the awesome vids keep it up ☺️

  • @DatToxicGuy
    @DatToxicGuy 3 года назад +2

    Thanks! :D
    It was painful at first, but now, I have got it! :D
    KEEP IT UP! :DDDDDDDDDDDDDDD

  • @xcale4310
    @xcale4310 2 года назад

    Yet again, helped so much! This is the script i came up with (the part is Xcale)
    print("Script began")
    function changeTransparency(part,newTransparency)
    part.Transparency = newTransparency
    end
    print("Lines 2-4 executed")
    changeTransparency(game.Workspace.Xcale,0.5)
    print("Executed line 6")
    wait(2)
    print("Executed line 8")
    changeTransparency(game.Workspace.Xcale,0)
    print("Executed line 10")
    wait(2)
    print("Executed line 12")
    changeTransparency(game.Workspace.Xcale,1)
    print("Script ran successfully")

  • @orangebiscuit9560
    @orangebiscuit9560 2 года назад

    I didnt know how parameters worked this cleared all my doubts Thank you so muuch

  • @robloxian4life445
    @robloxian4life445 2 года назад +1

    thank you so much i wanna be a game dev when i become older and im working really hard to learn how to script and your videos help me alot thanks :)

  • @lav_fico
    @lav_fico 3 года назад +1

    Thank you a lot, I was trying all things to develop: Animations, UGC, GFX, Building, Modelling. And I never saw this good Script Tutorials.

  • @mvpbluesky9820
    @mvpbluesky9820 3 года назад +12

    YAY A TUTORIAL AGAIN IM SUBS AND LIKEEEE LIKE IT SO MUCHHH!!!!!

  • @nic-guy-7
    @nic-guy-7 2 года назад

    thank you dude i had forgotten how to make functions but now i remember how to because i watched 30% of the video

  • @hopeitworked2974
    @hopeitworked2974 3 года назад +1

    Thanks soooo much for this series it helped SOOO MUCH ur the best person ever in scripting AND you know how to explain VERYYY WELL

  • @KameronGT
    @KameronGT Год назад

    Alvin your the goat man. I didn't understand any of this until I watched you. Thank you so much

  • @Rafter101
    @Rafter101 Год назад

    this is the best tutorial ever ive always put off learning to code later since i thought it was going to be hard but this proves otherwise

  • @shyam8197
    @shyam8197 3 года назад

    i have watched millions of scripting tutorial but never understood
    but i understand only u
    u are the best

  • @akiraum9782
    @akiraum9782 3 года назад +1

    Just learned what debugging was. Thank you Alvin.

  • @JeramayaGaming
    @JeramayaGaming Год назад

    I did some other tutorials and this one is the one that explains everything the best.

  • @cookiethedog1436
    @cookiethedog1436 2 года назад

    I sometimes have good ideas for games but i have no experience you are saving my life

  • @RainyPlaysRoblox
    @RainyPlaysRoblox 2 года назад +1

    Hi I’m a python developer and I didn’t know roblox Studio and python code is so similar they are both easy for beginners thanks man I really enjoy watching ur videos and in the same time I learn it’s a win win dude appreciate it

  • @DatOneGamerOfficial
    @DatOneGamerOfficial 2 года назад

    watching your series is the only way i learned how to script
    thanks man

  • @thatonegalazy2350
    @thatonegalazy2350 3 года назад +1

    Alvin your the best I haven’t fully found out how to script but your the only youtuber who’s actually teached me for once

  • @beerusfn671
    @beerusfn671 3 года назад +1

    i get so excited whenever u come out with a new tutorial

  • @cattowrr
    @cattowrr 3 года назад

    i like how this is a series that is probably gonna keep on going for years on years

  • @seespotbyte9920
    @seespotbyte9920 2 года назад +1

    Thanks a million! Could never wrap my head around functions.

    • @AlvinBlox
      @AlvinBlox  2 года назад +1

      You're very welcome! All the best to you my friend. Alvin

  • @dauniverseitself7517
    @dauniverseitself7517 3 года назад +6

    The moment I understood what he was talking about made me extremely happy.

  • @ThatGuyOnTheInternet1
    @ThatGuyOnTheInternet1 2 года назад

    Alvin, without you in our world, roblox studio wouldn't be a thing

  • @therandomnova
    @therandomnova 2 года назад

    Thank you for making these tutorials. I’ve come a long way in scripting on Roblox. My first scripting tutorials were these. They really helped me out.

  • @LAT3R
    @LAT3R 3 года назад +2

    Loved this! You make scripting somewhat fun while educational

  • @xcsdownfallrin6845
    @xcsdownfallrin6845 3 года назад

    I like how he doesn't just bunch all yhe videos into one because when i see one hour plus tutorials i kinda feel overwhelmed

  • @Corvus_the_wyvern
    @Corvus_the_wyvern 3 года назад +2

    i finally understand parameters.

  • @Crazy-wu8oj
    @Crazy-wu8oj 2 года назад

    these series are going to help a ton because im trying to work on a game alone not knowing how to code or build things, but now im learning how to code and im taking notes on a note book to make sure i remember it. thank you for this! :)

  • @CodeWithAbed
    @CodeWithAbed 3 года назад +1

    i was confused in the first 2 minutes but then i understand thanks bro this was helpful too :)

  • @Apollo1428
    @Apollo1428 3 года назад +1

    I am so happy about the fact that I've had to do little to no debugging so far.

  • @greedoyt1138
    @greedoyt1138 2 года назад

    OMG I JUST REALISED HOW HELPFUL THIS IS, THANK YOU SOOOOM MUCHH

  • @jamesisnotabeast8122
    @jamesisnotabeast8122 3 года назад +1

    These scripting tutorials helped me alot! Thank you so much!

    • @TigerMC2
      @TigerMC2 2 года назад

      You learnt scripting yet?

  • @yeectc
    @yeectc 2 года назад

    I really love how you put so much information into 10 minute videos!

  • @darichdoge256
    @darichdoge256 2 года назад +1

    We always put the fun in functions!

  • @mreddie4014
    @mreddie4014 2 года назад +1

    I was doubting me being able to make a game with this series but by looking at the comments, I'm hopefull! :D

  • @whybibble8957
    @whybibble8957 Год назад

    This is a big progression! now i can make stuff change transparency in front of my eyes in the game!

  • @kilord5486
    @kilord5486 3 года назад +4

    me after learning functions: starts scripting functions on a pointlight Me: does Run * script successful * MY BRAIN: goes in galaxy mode

    • @hey248
      @hey248 3 года назад +1

      LMAO

  • @kingjulienmonke9929
    @kingjulienmonke9929 3 года назад +1

    Thank you so much for this series I’m working on my first game and it’s pretty big but I have zero knowledge keep up this series for people like me I learn a lot from you more people should be like you tysm

    • @wubbysalmon2072
      @wubbysalmon2072 3 года назад

      Don't go for a big project first, start small and work your way up.

  • @PersonallyGone
    @PersonallyGone Год назад

    I learned a lot from you and understand the most of things, learning functions are the most useful things if your a really bad typer or your hands hurt while doing typing. I really liked this video and I hope this comment gives you motivation

  • @valkryxdoesdesign
    @valkryxdoesdesign 3 года назад

    Really nice to have an updated version of the beginner scripting tutorial and it's nice your back!

  • @weenfle7256
    @weenfle7256 3 года назад

    I tried to learn how to script sinxe last year but a lot of tutorials went straight to the point and it confused me- this one help me a lot 👌

  • @SupaThanos
    @SupaThanos 2 года назад

    bro alvin your tutorial is so good learned so much in so little time

  • @cuppajoe2
    @cuppajoe2 3 года назад

    I took a year of computer science in high school and hated it.
    So far I have learned way more from these videos then I did in that year (And I enjoy following along with my own game :)

  • @planerunner4020
    @planerunner4020 2 года назад +1

    Please Continue this series!

  • @wokennABC
    @wokennABC 2 года назад

    i am loving how much theses videos help im taking notes on some things in a little book u gained a sub and a like:)

  • @IMVEL0
    @IMVEL0 3 года назад +1

    i was trying to figure out the arg one for so long, tysm

  • @hoanghanguyen1410
    @hoanghanguyen1410 3 года назад

    You are young but a great teacher. Kudos

  • @yassinsamir4508
    @yassinsamir4508 3 года назад

    Alvin,u helped me alot thanks u so much I was gonna quit roblox studio but.you changed my mind I see your future being the best roblox employee and my dream is to work with u

  • @pilotscreen
    @pilotscreen 3 года назад +3

    The best thing is i understand him and can remember the code very good

  • @superlightning_yt7655
    @superlightning_yt7655 3 года назад

    This is the only video that i havent skipped

  • @seanhawkins739
    @seanhawkins739 2 года назад

    Thank you so much for this series! It has let me learn how to script on Roblox!

  • @Corvus_the_wyvern
    @Corvus_the_wyvern 3 года назад

    i watched this yesterday and learned so much i also took good notes but imma listen to it while reading comments.

  • @pokeben4593
    @pokeben4593 Год назад +1

    this guy is so good at teaching roblox code

  • @jacehi2u
    @jacehi2u 2 года назад

    Thanks alvin! this years tutorial imo was the best explained out of all and you help me learn simple lua scripting :D so far i know (while true do, if statement, fynctions, properties, how to make a leaderboard, findfirstchild) and so much more that i cant think of rn Thanks man :D

  • @theman3033
    @theman3033 2 года назад

    I have looked at tons of videos that teach LUA script. None of them worked except for Alvin's videos.

  • @mezilga121
    @mezilga121 2 года назад

    Tysm, i could make a cube that slowly dissapears over 1 second! That's the most advanced thing i've ever scripted.

  • @Queenofear
    @Queenofear 3 года назад

    This is so interesting... I never knew what functions actually did but it all makes sense now.

  • @fofa4500
    @fofa4500 3 года назад

    All you’re videos are so helpful and it’s for free you deserve more subs

  • @proxigoat.
    @proxigoat. 2 года назад

    this dude changed my life forever

  • @apannisseberg3154
    @apannisseberg3154 3 года назад +3

    Yey! New video!

  • @tartieswife4551
    @tartieswife4551 3 года назад

    These are AMAZING tutorials, I literally started coding today and I know a lot more than I thought I would. Your getting a sub!!!

  • @lackinfr
    @lackinfr 2 года назад

    I'm literally 11 and i started scripting.
    U won Alvin 😁

  • @_butter.
    @_butter. 3 года назад

    I gave my test subject a friend, thanks for the tutorial!

  • @1mrguy133
    @1mrguy133 Год назад

    this is the easiest tutorial ive ever seen, it helps me alot cause i suck at scripting

  • @exomonoko2888
    @exomonoko2888 3 года назад

    ive been watching since your 2020 series, nice job man. you do a good job going in depth on nearly everything and im coming back to see what your doing different for the new series :)

  • @Charduza
    @Charduza 3 года назад +4

    I want a tutorial on something like connecting a part to a player (like a tool) but with a keyboard press

  • @A1ic0
    @A1ic0 2 года назад

    I love how much detail you put into your teaching!

  • @jaystudios4252
    @jaystudios4252 2 года назад

    ive allways wanted to learn functions ty!

  • @Sunglasses.Minion
    @Sunglasses.Minion 2 года назад

    Oh my god thank you Alvin! Because of you I’ve learnt something I never thought I’d learn

  • @grileck6094
    @grileck6094 3 года назад

    ilysm, you explained it clearly.

  • @Angel-fl6ny
    @Angel-fl6ny Год назад

    thank you for switching to dark mode as soon as tutorial 3

  • @fishplayztoh
    @fishplayztoh 3 года назад +2

    Thanks a lot this really helped me :)

  • @WRLDPost
    @WRLDPost 3 года назад

    I was looking forward to a new video on functions! I really enjoyed watching this episode!😀

  • @User-to7eh
    @User-to7eh 3 года назад +1

    So a function is like a backpack, it is filled with something, in this case a script. After you fill your function with your script when you paste the name of the function is will start the script(s) in it making it take up less space so you dont have to just copy and paste the same script over and over again.

  • @seylahbakez9504
    @seylahbakez9504 3 года назад

    used this for reference for my first script, it worked!!! so proud of myself

  • @omarplayz25
    @omarplayz25 3 года назад +1

    the second part of the function was hard but im looking forward to the event episode :)

  • @eggstatus5824
    @eggstatus5824 2 года назад +2

    "Whats the point of making a function? It's not all that bad to write out a but more code"
    Not only is it needed for events, but it can also help optimize your game. As in, the more efficient your code is, the better your game will run. So you aren't dropping fps for a dumb reason
    Cause, simply put, if an instruction sent to the cpu requires less code, it will be done faster. So obviously, it makes the program run faster