Beginner's Roblox Scripting Tutorial #19 - in pairs loop / pairs loop (Beginner to Pro 2019)
Vložit
- čas přidán 27. 08. 2024
- Beginner's Roblox Scripting Tutorial #19 - in pairs loop / pairs loop (Beginner to Pro 2019)
Hey guys, in today's video i am going to be teaching you about in pairs loop in roblox scripting. Anyways, this is a pretty fun video and we build a house and have a pretty fun tutorial. Anyways enjoy the video!
Link to Beginner's Tutorial Series:
• Beginner's Roblox Scri...
-- Follow me on twitter! (my name is tapwater because thats my main channel): / realtapwater
- Join my Discord Server to learn and meet other developers!-
/ discord
--What is this series about and who is it for?
So this series is meant for people who really want to learn exactly how to script, if that is you then I promise by the time you watch this whole series you will know exactly how to script on roblox. Anyways be sure to subscribe to see whenever I release a new tutorial and I will see you guys in the next one. Peace!
this is it, you have reached the end. onwards, onto the advanced tutorials!
SPONGE
And I still haven't remembered anything from the basic tutorial
@@zachariusd6473 lol i remember some stuff
I basicslly, am now gonna test it, by doing all the stuff he did separately, once by seeing his Vid, then I will do them separately without seeing, then will do all of them together, then gonna go to advanced tutorials!!
@@zachariusd6473 Your not supposed to memorize coding you should understand how coding works. basically, if you understand someone else's script without seeing how they made it then you understand Lua.
Everybody gangsta till devking brings up his obsession with hotdogs
lmao
lol now he is addicted to pizza and pasta
@@alongal407 no hes not this is first time hes bringed that food up
@@thevoid5181 brang*
Why do I feel like I invented the “Everybody gangsta until” Comment ;-;
So honestly your videos helped me a lot more than AlvinBlox because you stayed on topic as much as a possible and kept the videos short enough to keep the attention. I literally binged it all and I understand them all WAYYY BETTER. Thanks
same here ;)
btw WHERE WERE HIS HOTDOGS TILL NOW ;)
glad I could help :)
@@TheDevKing i LIKE sponges
@@TheDevKing And subscribing you to
@@shinchanthebest SPOOONS AND THE SPOONGES
I've just finished this whole playlist. Thank you so much. This series was so simple to follow and it started right from print statements. Thank you so much...
I LIKE PONGE
@@tronixthedev7887 umm. Ok
Your WElcome
@@purekryt6961 I don't think it was meant to you...
Me2🎉🎉
TheDevKing: "First things first, leave a like"
Me: "Oh ok"
thats the only step i could understand
@@maxwellulrickson4126 LMAO
@@maxwellulrickson4126 fr
SPONGE
SPONGE AND SPOON
i love how he makes examples, makes all of us have an idea on how to use what he's teaching and it just sticks to my mind more
Last video: gets 11k views
this video: gets 12k views
The 1k people who skipped half the series: haha scripting go "type type"
EDIT: i thought this comment would be forgoten lol
Pixel Potato could also be because they already know scripting and they just wanna learn new stuff
these SIMPLETONS
@@railgun4953 ??
@@opmer4181 simpleton is the nicest way to be mean to someone
@@Scratat simpleton is the nicest way to be mean to someone
I kid you not, learning tables and i v pairs from you has just opened up a whole new world of possibilities for me. When i originally tried learning i couldnt understand these for the life of me and now i came back to your videos its so simple. Thanks for the W tutorials
for i, v loops are one of the most important parts of scripting so yeah
Him: beginners scripting
Also him: puts the whole jailbreak script in the thumbnail
HibouribouGaming lol you call that jailbreak ? ha ! jokes on you thats only a code for a single little gun
Not even
Repic011 yeah... i know... "*jokes* on you"
Repic011 *yeah i now "jokes on you"
@@dogeplayz0919 Lol yea!
---Correction
If you're watching this in 2021
there is a correction
You cannot put () in the table
You have to put {}
for ex.
local HousePart = {game.Workspace.Part1,game.Workspace.Part2,game.Workspace.Part3,game.Workspace.Part4}
It will work only is you put that type of bracket bye bye
didn't he also used the curly brackets?
@@Not_Flood he did
if you've reached the end of the tutorial, grab some scripts from the toolbox, look inside of the scripts and see how this fundamental knowledge is applied to scripts you see ran in other games to get a better understanding before moving onto the advanced tutorial. this method really helped me learn and retain a lot of the info from this series
good idea
ty
I hope one day to graduate from Dev King Academy, make a game I'm proud of, and come back here and say "Thank you so much" to all these helpful comments and videos.
Don't do this until you've watched the Advanced tutorials. You'll most likely end up accidentally just copying the script, but if you have a proper understanding of what everything does, you'll actually take something away from the experience.
5:08
You should really think about becoming a builder instead of a scripter. Your skills are amazing!
LOL
SPOON AND THE SPONGE IS BEST BUILD EVER AND IT TASTE GOOD
That was spectacular! How did he make it?
@@insertusernamehere8125 I don't know but it requires years of experience for sure
@@J4Y_JP nah it probably took him decades
I understand these videos were made more than a year ago, but I can't begin to explain how thankful I am for having these tutorials. I wanted to start learning Lua because after seeing other people's creations, it brought out my passion in game developing! Out of all the things you could do on this platform such as, animating, modelling, etc, I chose scripting as I believe there are much more possibilities to do with it! I would like to congratulate the people who've finished this playlist, including me. As I've tried getting into Lua before, I lost motivation to learn it and completely stopped watching these tutorials, here we are now, learning everything from scratch. I will proceed to rewatch these videos till I gain full knowledge of the beginners subject before I go into advanced. As I don't want to miss one single thing about this coding language, thank for Dev King for bringing these tutorials, they motivate me, and help me strive closer to my goal of learning Lua. :]
hows your progress going now mate?
Hows it goin?
@@chong brish
yeah has the job been done?
How have you’ve been doing now?
Took me awhile to get here. I’m now on tutorial number 15 on his advanced series and all I can say is it’s hard at first, but it gets easier faster. I truly believe that everybody here can make an incredible game, good luck, and this is only the beginning of an incredible time!
same to you!
wise words from bigsussyedp
Thanks to this tutorial, I am now a pretty big developer with a successful game, The group has over 1,000,000 members and the game has 50,000,000 visits, if your wondering what the game is, its Boho Salon
@@KenzCoder DAYUM congrats man im happy for you looks like you made it pretty big!
@@cha0ticClipzz Indeed I have, pretty grateful infact, one tip I'd give out to all of you is to not rush games as if you rush games usually they dont pop. If your doing scripting for robux, prolly you wont make it where and im saying PROLLY.
I've just finished this playlist and honestly, I couldn't thank you more! Thank you so much, this is the longest I've gotten in scripting so far and I couldn't feel prouder. If I become a better scripter in the future (assuming that I won't lose motivation), I will have to thank you even more! I've never been so proud of completing a tutorial playlist and I couldn't have done it without you :D. Congratulations to those who finished this playlist! I'll see you in the advanced tutorials! :D
Hey I just finished wanna work on a small project together?
read the forum or wiki has more use ful info plus the wiki has its own ai that will help you in problems made just for roblox
is bro burnt out yet
IF YOU SEE THIS WE MOVING ON TO THE ADVANCED PLAYLIST BOYS
Yeeeaaah
@@flox2winCwinge We did it!!!
YEAHHHHHHHHHHHHHH
WE DID IT!!!!!!!!!
I feel like I've just graduated college, Let's go boys!!!!!
With the knowledge I've got within the Beginner Tutorial I've written a simple teleport button script:
script.Parent.ClickDetector.MouseClick:connect(function(player)
player.Character:MoveTo(Vector3.new(-117, 0.5, 13))
end)
Although, I don't understand pairs and Ipairs.
HOPITY BOBITY THIS IS MY PROPETY :>
Ah yes
You should place a part where you want to teleport and then do it like this:
script.Parent.ClickDetector.MouseClick:connect(function(player)
player.Character:WaitForChild("HumanoidRootPart").CFrame = game.Workspace.*Part of your choice*.CFrame
end)
You can also use Position instead of CFrame
I stands for index or the table number so 1 = pizza, 2 =pasta, 3 = hotdogs, V is the variable so the value, it can be a string, int anything
I'm learning this kind of things just because i want to create cool tools just like a Sword with diferent animations, sound etc
That's pretty easy
@Someone do you have to bring politics into everything
@TheOneAndOnly nah man thats politics
I'm tryna make a game like phantom forces
@@ok-bx1bc GL with that.
Finally made it to the final episode of the Beginners playlist! Proud of myself and everyone who watched every video all the way through, keep it up and we can all become big one day
@@vapeycat i still script and I've gotten so much better.. Wow I can't believe this was 8 months ago, only felt like a couple of months
@@XentricX did you do the advanced tutorials
@@gabrielc7861 I did most of them but I've just been learning and practicing my own things noe
@@XentricX nice
@@XentricX I'm about to finish my first basic game
Helpings hand: the i in for *i*, v in pair() do stand for index which is the position it holds in the table. For example
local myTable = { 1 , 2 , 3 }
local myTable = {“bob”, “bruh”, “lol”}
In each space separated by a comma holds an index. And what ever is in those spaces holds a value
Thanks man
THANK YOU!
Wow thank you this is actually an amazing explanation
ooooh i finally get it thx
pizza... pasta? T r u e i t a l i a n
pizza pie MARIO!
@@viternal7529 LOL
starts italian then goes all american
hotdog
I like my sponges sponge is my favorite food
I finished this playlist so quickly and it really helped me refresh my mind from what I learned from others because I sometimes forget what others taught me lol. I am going to now jump in to advanced scripting
lol same
how u doing now ?
@@mercy5530 I am good
@Kaare69420 I was bored and quit coding. But still don't give up because coding is pretty much a great hobby.
@@mintyrblx07bro you should not quit man.coding is an awesome skill to have
I'm pretty sure you can help Soybeen update Booga Booga by now.
LOL yeah probably
Lol
:O He Replied!!!
@@awxhhlilla just leave it there? LOL
@@awxhhlilla there's a file button in the top left so you can save the entire game with cloud or file. If you just want to save the script you should just copy and paste it into notepad then press Ctrl + s. You can use clipboard too if that's your style.
for anyone wondering how to use for loops without the in pairs its fairly simple here's and example:
for i=1, 10 do
print("Hi")
end
what this does is it makes a local variable for it and counts up by 1 and prints hi each game tick until it reaches the same value as the 10
thatws nice
what about i want to loop like every diff value of the table?
Thank you so so so much!! I used to want to learn Lua like months ago but.. None of the tutorials I found were good enough for me. And then, when wanting to continue my journey on learning Lua, I found your channel. And I absolutely love it! This playlist was so simple to follow, and easy to understand. The fact that your videos are short, but so effective!!! You have all my support, and thank you so much for making these tutorials.
Love
are u a real pro at lua now!
@@mercy5530 Nope not yet but im still trying :') I keep making errors lol
same
THIS WAS SO HELPFUL! THANKS! You just gived me an idea from the house part table
SPONGE
LETS GOOO! I finished the beginners series! This guy is one of the best teachers!
3:22 To put it simply (TDK is the best :D), the I is the number/string in the table. The v is short for value. When you print these out it prints the (in this case) string and print(v) prints the value (duh) of the string/number.
I started this morning and I have learnt so much since this morning..
I LOVE SPONGES AND SPOONS
@@tronixthedev7887 i love shrek
Hi TDK, I truly learned a lot from this course. Looking at what I've written down, at the end of the basic course, I managed to pick up 165 key lessons
Well time to do the advanced course then!
Link: czcams.com/play/PLhieaQmOk7nIoGnFoACf33M3o0BOqB38a.html
oh yes, i finally watched all of beginner's tutorial
SPOON AND SPONGE IN YOUR HOME
Woo I finished the beginner's tutorial! Now it's time to watch the advanced one..
Just finished watching the whole playlist and I just wanna say thank you for making these,
they've really helped me with scripting lol.
SPOON
@@tronixthedev7887 FORK
chopsticks cuz am asian 😎
@@cxnnectivity6889 spork
Teacher: I know I am not much of an artist but...
(5:13)
LOL that’s so true
Every teachers
SPOON
Amazing jobs explaining, I was confused on this topic for a while...
congrats on making to the end of this series! 37 more videos to go.
Why does every episode contain at least 50 foods????
to make it funny
He likes food
Hes fat
He's like me we are food lovers
last episode was an omelette! a flipping omelette
This is like the best scripting series ive ever seen, thank you so much!! I know this was uploaded 2 years ago but i am really grateful for all of these tutorials and amazing vids u have published. : DDDD Like the other people in the comments are saying im too excited to do the advanced series! : DDD
2 years? For me 5 years LOL
@@bradandriessenme too lol😂
I like how u make these videos entertaining with some jokes and also easy to understand, I just started learning Lua and I already have an idea on what's going on. Big ups man!
exactly
Really thanks to this guy, Now i know Basic Code Scripting skills. Was excited for a bit until I learned that there's still 39 videos left to watch on another playlist.... F
though gotta thanks to this guy cuz he makes simple and short videos that is not boring and very understandable, I know I'm late but yet cant thank him enough, thanks Tap
@@MasterOfWinds he is probably watching the advanced roblox scripting tutorial
pls make more of these i still need learning from u because u the best!
SPOON AND THE SPONGE SPOON AND THE SPONGE SPOON AND THE SPONGE SPOON AND THE SPONGE
This series is awesome! Been wanting to get into this for a while and this has really helped kick start my journey into roblox development!
it is the end of the beginners tutorial now and i already know how to make a simulator game this guys truly amazing! cant wait to get into the advanced ones!
This helped me so much. Thank you. 5 days ago the only thing i knew was printing and comments lol and now i know everything in this playlist.
You should explain tables are arrays and how they are used. Your videos are good but please focus on the fundamentals and best practices. The reason i is used in for loop is because it means iteration. It iterates through the loop until value.
Thank you I’ve been trying to figure out what it stands for so I could remember it easier.
Thank you!
Now you have to use {} instead of () for groups because you will get an error for the comma
Thanks
THANK YOU SO MUCH!! i was trying to figure out why it wasntworking
bro I watched all the beginners tutorials and I feel like am pro scripter , THANK YOU SO MUCH YOUR THE BEST!!!
Lol me 2 🙌🏼
Have you done the advanced tutorials yet? Here's the link: czcams.com/play/PLhieaQmOk7nIoGnFoACf33M3o0BOqB38a.html
@@Ninjithmohan Have you done the advanced tutorials yet? Here's the link: czcams.com/play/PLhieaQmOk7nIoGnFoACf33M3o0BOqB38a.html
@@gabrielc7861 yes I'm done
@@Ninjithmohan Nice
Thanks for the tutorial dude! I made a **Working** hamburger creator sort of thing! here's the script :
local ingredients = {"BottomBun", "BottomLetuce", "Meat", "TopLetuce", "TopBun"}
for i, v in pairs(ingredients) do
game.Workspace:FindFirstChild(v).Transparency = 0
wait(0.5)
end
I have things in the workspace called the names in the table, when this runs it builds the hamburger in order, so I could even use this in a cooking game!
so i officially finished beginner tutorials
ITS TIME FOR ADVANCED TUTORIALS
want a tip on how to teach us scripting in a more effective way :)
LIVE STREAM :)))))))
Hi im Obama and i support this message
Hi i'm Dr Phil and i support this community
Hi i'm Kevin Hart and i support this channel
I just realized that both @youngachiplayz and artisticcode(this account) is my account I'm using :/
@@outlyy9406 So how good are you at scripting today?
You are so funny and you explain very well so it s good i wish you a good futur
Your channel is like the view objects thing on Roblox
after 4 active days of watching you, i finished the beginner series! the advanced series is going to be a bit harder since it covers 37 topics that are all more advanced than the basics shown in this playlist, but I think I can do it. Thanks for the knowledge!
same
Made any progress?
how u doin now
got through most the series, got stuck on the raycasting since it was outdated, quit for like 2 months, came back and actually made a turret with my own scripting skills, quit again, quit roblox until like 5 days ago where i randomly just really wanted to learn how to script again so now im doing that. so far its going good 👍
@@fabc4136 how 'bout now
Thank you so much for your tutorials, they have helped me a lot!
SPONGE TUTORIAL Take you sponge to batchroom put sponge to batch and w make wet sponge and now eat it i hope this tutorial help :D
Can't believe I watch through all 19 tutorial including taking notes (10pages in total) in one seating in one night Hahaha, First time learning scripting and having so much fun! Love the way you teach! Retention rate all throughout the playlist :D
Have you done the advanced tutorials yet? Here's the link: czcams.com/play/PLhieaQmOk7nIoGnFoACf33M3o0BOqB38a.html
Dude, your videos are more clear than AlvinBlox. He goes into extreme detail about things we wont need to know or already understand and that burns me out. You stay on topic consistently and make things as clear as possible, i appreciate it DevKing. You really are the king dude.
Here's a disappearing plates script I made for an obby :)
local parts = {game.Workspace.part1, game.Workspace.part2,game.Workspace.part3,game.Workspace.part4}
game.Workspace.part1.Touched:Connect(function()
for i, v in pairs(parts)
do
wait(.55)
v.Transparency = .5
v:Destroy()
wait(.5)
end
end)
nice
303 liker and while I missed hotdog the whole series I just wanna know how many people watched the whole series ;)
I did and when he wrote "hotdogs" I was like yay finally! comeback of hotdogs!
Me
@@SaymonHissa nice
me i watched it full
Meee
yoooooo letsss gooooo i graduated from beginner tutorial
i created a mini simulator using all of the stuff you taught to me
THATS SO COOL! can you link the game!
jokes aside this series was a life saver, I've been using lua outside of roblox and literally the last episode is what intimidated me everytime, in pairs loop and pairs loop made no sense to me, as well as people using "foo" as a value idk what that means
Is it me aor has he... stopped liking hotdogs?!?!
edit: I was wrong
it got from 20k people from the start to 3k.. People get lazy.
yea bruh
What do you mean?
Idk
now 160k to 30k
@@Rose-id9sj the amount of viewers
Amazing series with good explanation and jokes that doesn't make feel boring
Lets gooo I graduated dev kings beginners tutorial! It took me half a year but lets goo finally
it took me 2 days :D
@@ShortCraze0 waht, noice
127 likes, 0 dislikes, 2314 views
... the *OMNI GOD*
PRESS ALT + SPONGE = WET SPONGE
1:40 come on man i know you want to type hotdog
lolololol
I finally finished the tutorial, I really learned a lot because of your simple teachings.
Hi, I'm working on a dinosaur game on Roblox, I already have a team, but our Scripter is out and we're looking for a new Scripter, does anyone want to help?
Up
UP
The 22 dislikes are A Hater and 21 of his alts
dislikes got removed..
True
This beginner scripting tutorials have been very teachy! I can't wait to start the advanced scripting tutorials
Congrats, only 179k made it this far out of the million. Your a 1 in 10 person. Cheers, have a good day to whoever views this.
One good way to look at i, v is seeing i as the integer and the v as the variable :)
Thanks this helped me a lot!
this is in 2020, yet this has helped with my roblox JoJo game and now its a huge skyrocket because of your tutorial
Yeah eat sponges and spoons and you have Slawepostigin
I feel kinda sad because it's the last video. Thank you so much for helping me learn how to program
I have finished this series even if it's 4 years old... it's amazing and simple, thank you dev king!
Wow! Thank you so much for explaining the IN PAIRS very well, I was able to understand it!!!!
i guess this is it well i hope you all become really good devs and scripters time for the advanced hopefully your ready..
Wow bro everyone grew man and now we are gonna take on the advanced tutorial.
now this might be a lil confusing with table but im sure in the advanced tutorial i will understand if you want to know my progress just replie i will see how far i made it and if i understand it
hey, how u doing now?
how far have you been now
Thank you so freaking much man! I'm currently on Peaspod's tutorial on in pairs and I just couldn't understand what he was talking about! So then I looked up a video on in pairs then I found this video! And it helped me so much! You showed a demonstration on how it can be used in a game! When I finish peaspod's series i'll come back to you! Thank you so much!
Peasfactory is outdated
@@insertusernamehere8125 Haha true. But for people that just step into the world of scripting. Although they are outdated, they're pretty good.
@@funfofa yea he does have good tutorials though, it's just some are too old to work, so you have to skip them, for example hopperbins which are now deprecated and he has an old tutorial on them that is useless now since they're removed from roblox
His hotdog demonstration is what got me here today
im pretty late but he explained in pairs loop pretty uh yea,
basically the script reads tables as an index and as a value
so if we were to say local newTable = {“Hey”, “Everyone”}
the script would read hey as the value and 1 as the index because its first in the table
so basically
i(index,name),v(value)
exampl"
local newTable = {“Hey”, “Everyone”}
for i,v in pairs(newTable) do
print(i,v)
end
would output:
1 Hey
2 Everyone
ooohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh thanks a lot i was about to spend so long googling what it means
1:57 I KNEW Bro was gonna say "HotDogs"
I like ur expamples of variables with foods names
Interesting, for anyone who is struggling don't worry we were all their keep going!
This was honestly the best tutorial for just about anything that I have ever had.
when your tutorial so good you binge watch it all in one day.
I finished this series 2 years ago then gave up so im back, i watched this again now onto advanced.
lol i just noticed i watched all his beginners script tutorial and haven't subscribed him yet no worries just did now
"first things first, leave a like
lol so funny and wholesome definitely leaving a like as always
This was pretty cool, thanks for the easy to comprehend tutorial. You truly are a DevKing!.
Yay I finished the begginer turtorials these really helped keep up the good work
you still going?
@@Mot0Mot0 im on the advanced now
I just finished the playlist and it's been really helpful, gonna watch the advanced now.
Other scripting youtubers: *Explaining the easiest to understand thing in 1hr and explaining the hard stuff in 2sec*
TheDevKing: ACTUALLY KNOWING WHAT TO EXPLAIN FOR LONGER
I've graduated from a beginner.. NOW ITS TIME FOR SOME REAL SCRIPTING!!
Thank you so much! you explain so good and ive been trying to learn scripting since 2018 and you gave me motivation and hope :)
if you want to keep it short you could do:
for _,parts in script.Parent:GetDescendants() do
task.wait(1)
parts:Destroy()
end
also another way u can use i,v in pairs is:
local players = game:GetService("Players")
players.PlayerAdded:Connect(function(plrAdded)
for i, players in pairs(players:GetPlayers()) do
print(players.DisplayName.. " Has Joined The Game! ") --here i stated displayname, but u can change it to name wtv u want
end
end)
Finished the beginner series lets go!
This tutorial series is helping me out alot thank you Devking :D!
just finished this playlist, i have hope in me and i think i can make really good games, thank you so much TheDevKing, you´re the best :D