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
Thanks for the support on this series so far everyone :)
First!
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
:)
First
Can u friend me on discord Alvin I have a question I_Am_thing#2266
Yo Alvin, have you ever stopped to think how many people you’ve helped? Thanks alot
First
Yes
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
First reply
@@thompie6877 no u aint
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 🔥🔥
@CROWN I R i know right ):
@@Real_cheese3 ):
amen
It shows hes committed, he updates his tutorial every few years as roblox studios changes
I love your channel
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.
@Salxs Roblox scripting is considered 'easy' and is a good introductory way to get into scripting a step up from scratch
@@kestrells it depends what you are making
@@kestrells yep
i love this series it gets better everytime
FIRST
i love seeing him progress from a kid and still being so helpful
thanks for these honestly, I have a year of lua experience now because of your 2020 series
lol
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?
That would be nice
2021 Tutorial didnt ended, maybe he can
I know how to do custom rigs and anaimations
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.
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
Yay another tutorial. I am looking forward for it.
Glad to hear :)
Me too
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.
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
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!
Thanks a lot! 😀
TY
Yes, it's simpler, but he most likely didn't do this as he hasn't touched on variables in this series yet.
Thanks, when i did alvins way it didnt work.........
@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.
This is the only tutorial series where I actually can learn and understand what's happening.
right
@@nj5916 left
@@yeah_hell up
@@sahedulhasan8453 down
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.
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!
You're helping so much people with these videos on scripting including me. I would not be where I am without you.
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.
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.
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!
I LOVE THIS CHANNEL! THANK'S FOR TEACHING ME WHAT I LOVE!!!!!!!!!!!!!(Even tho I don't know much yet!)
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.
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 ☺️
Thanks! :D
It was painful at first, but now, I have got it! :D
KEEP IT UP! :DDDDDDDDDDDDDDD
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")
I didnt know how parameters worked this cleared all my doubts Thank you so muuch
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 :)
Thank you a lot, I was trying all things to develop: Animations, UGC, GFX, Building, Modelling. And I never saw this good Script Tutorials.
YAY A TUTORIAL AGAIN IM SUBS AND LIKEEEE LIKE IT SO MUCHHH!!!!!
thank you dude i had forgotten how to make functions but now i remember how to because i watched 30% of the video
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
Alvin your the goat man. I didn't understand any of this until I watched you. Thank you so much
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
i have watched millions of scripting tutorial but never understood
but i understand only u
u are the best
Just learned what debugging was. Thank you Alvin.
I did some other tutorials and this one is the one that explains everything the best.
I sometimes have good ideas for games but i have no experience you are saving my life
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
watching your series is the only way i learned how to script
thanks man
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
i get so excited whenever u come out with a new tutorial
i like how this is a series that is probably gonna keep on going for years on years
It's been finished for a while
Thanks a million! Could never wrap my head around functions.
You're very welcome! All the best to you my friend. Alvin
The moment I understood what he was talking about made me extremely happy.
Alvin, without you in our world, roblox studio wouldn't be a thing
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.
Loved this! You make scripting somewhat fun while educational
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
i finally understand parameters.
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! :)
i was confused in the first 2 minutes but then i understand thanks bro this was helpful too :)
I am so happy about the fact that I've had to do little to no debugging so far.
OMG I JUST REALISED HOW HELPFUL THIS IS, THANK YOU SOOOOM MUCHH
These scripting tutorials helped me alot! Thank you so much!
You learnt scripting yet?
I really love how you put so much information into 10 minute videos!
We always put the fun in functions!
I was doubting me being able to make a game with this series but by looking at the comments, I'm hopefull! :D
This is a big progression! now i can make stuff change transparency in front of my eyes in the game!
me after learning functions: starts scripting functions on a pointlight Me: does Run * script successful * MY BRAIN: goes in galaxy mode
LMAO
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
Don't go for a big project first, start small and work your way up.
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
Really nice to have an updated version of the beginner scripting tutorial and it's nice your back!
Hey, thanks!
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 👌
bro alvin your tutorial is so good learned so much in so little time
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 :)
Please Continue this series!
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:)
i was trying to figure out the arg one for so long, tysm
You are young but a great teacher. Kudos
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
The best thing is i understand him and can remember the code very good
This is the only video that i havent skipped
Thank you so much for this series! It has let me learn how to script on Roblox!
i watched this yesterday and learned so much i also took good notes but imma listen to it while reading comments.
this guy is so good at teaching roblox code
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
I have looked at tons of videos that teach LUA script. None of them worked except for Alvin's videos.
Tysm, i could make a cube that slowly dissapears over 1 second! That's the most advanced thing i've ever scripted.
This is so interesting... I never knew what functions actually did but it all makes sense now.
All you’re videos are so helpful and it’s for free you deserve more subs
this dude changed my life forever
Yey! New video!
These are AMAZING tutorials, I literally started coding today and I know a lot more than I thought I would. Your getting a sub!!!
I'm literally 11 and i started scripting.
U won Alvin 😁
I gave my test subject a friend, thanks for the tutorial!
this is the easiest tutorial ive ever seen, it helps me alot cause i suck at scripting
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 :)
I want a tutorial on something like connecting a part to a player (like a tool) but with a keyboard press
I love how much detail you put into your teaching!
ive allways wanted to learn functions ty!
Oh my god thank you Alvin! Because of you I’ve learnt something I never thought I’d learn
ilysm, you explained it clearly.
thank you for switching to dark mode as soon as tutorial 3
Thanks a lot this really helped me :)
I was looking forward to a new video on functions! I really enjoyed watching this episode!😀
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.
used this for reference for my first script, it worked!!! so proud of myself
the second part of the function was hard but im looking forward to the event episode :)
"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