I Tried to Teach Someone How to Script in 15 MINUTES! (He's a Pro Now)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
alright guys welcome back to a brand new video in this video I want to teach my friend how to script in just 15 minutes okay or I'm gonna try okay he's in the studio with me right now Godley dev say what's up for the video okay so basically I'm gonna ask you one quick question and then we're gonna get started I have a list of things I want to teach you so we're gonna try to teach you as fast as we possibly can I'll set the timer in a second here but okay wait so Devin before we start though what scripting level of knowledge like do you have like do you have any prior scripting experience at all zero knowledge except for a little bit of Java that's about it no Lua no Python nothing okay okay all right cool so you probably don't really know too much about it so it's really funny I'm excited to see what happens all right you're funny guys so this is funny okay all right so um let's go ahead and get started I guess right here let me get the timer ready and we'll get started all right so we're starting in three two one and let's go all right so go ahead make a script real quick in the workspace all right I see your screen do you know how to do that answer okay and script okay yes perfect okay and get rid of like the why does it look like that bro your thing is so weird make the Explorer like a little bit smaller zone okay all right good yeah all right can you zoom in a little bit too cuz it's kind of small okay so okay first things first I'm gonna teach you how to print okay and actually go to open the it gonna open up the outputs usually go to the View tab at the top and then hit output yeah yes that's like at the top like left down yes there you go all right and then right click or click on that down there and then like on the on the output like the little box query click right there right there and then clear it just yeah okay there you go all right anyways alright so let's get started okay so as you can see the script already has something called print hello world you know what printing is it's basically like actually okay I'm gonna sue me down okay so printing is just it makes it basically like when you write that piece of code it just prints in the output okay so basically anything you put in this combination large goes into the output alright so what I want you to do is go ahead and try to print something out besides hello world I print tap water is is awesome or I mean the Deaf King is awesome okay the deaf gig is awesome the den kind okay alright okay so that's good that's good that's your planet code so go ahead and go to the home door test tab on top okay and then you can hit run or you hit play and it will run your code so I think that's it boom deaf King is awesome so as you can see you're already coding that you wrote your first line of code I mean you kind of just edited it but you know it's good enough alright so that's how you print now you may be wondering okay why do I need that it's useful for like debugging code and stuff like that when you have errors but basically that's just it's good it's useful to learn with - alright anyway so um now I'm gonna teach you something next okay so when we go into teaching now is something called variables so basically variables are it's like a box okay you know what boxes are you know you put stuff in the box and then and then no no that's not it oh no all right go ahead and delete your line of code says print that thing is awesome okay okay all right and now basically I wanted to teach you how to make a variable so go ahead and type local okay local and then space and then whatever you want to name your variable so let's say we want to name it hotdog okay you wouldn't go ahead and name your variable hotdog all right perfect and then hit another space and then du equals no okay equals and then go ahead and basically just type any number or how many hotdogs do you want for example 45 okay so as you can see now you made your first variable and now that is an integer variable but blue orders only count like integer string like that like so don't worry about that but basically you have a number assigned to your variable so now if you actually go ahead and hit enter real quick and then gets into to a new line and then type print and then put inside those lower case but put inside the parentheses after you type print you go ahead and put hotdogs in there the name of your variable oh no without the course sorry without the quotes because with quotes basically it reaches I was like text and then it was print that word but if you just print the name of the variable it'll basically reference that variable and as you can see if you go in at play you'll see what happens you can probably guess but hit play real quick and you'll see and boom it printed 45 because that was what your variable equals so you get you kind of get what those do now yeah okay cool cool okay cool so you can actually the same thing though like with variables what was shrinks you can so basically go back to your hot dog and like to the to the equals at the end above how the number and then put like with with quotes put like hot dog equals tasty or something I don't know yeah I don't know you have to put that just put like tasty its foot tasty okay okay there you go all right now and delete the delete 245 though because that's gonna give you an error so just good it's all right all right as you can see that's kind of cool though cuz now if you actually go ahead and print it out again it's gonna just print tasty because that's we set it equal to so you can do that if you want by basically I mean that's what variables are right there's also one more thing you can do with variables you can set it equal to like true or false so if you actually like just to delete the Tastee delete that whole thing and you said you type just true or false I think ANSI now it's true or false so basically it's like a way to to test stuff to see if it's true or false I guess that's kind of useful sometimes I'll use that sometimes we won't but yeah that's that all right so you get variables right I mean it's pretty something and yeah yeah all right cool all right so now what we're gonna teach you is arithmetic ok so like basic math kind of alright so um let's go ahead and start with like okay yeah all right going to that all right said you know I like alright okay okay well let's say we're having a barbeque okay okay when I'm gonna barbecue and we want to figure out how many hamburgers and hot dogs we have alright so go ahead and make a variable for hot dogs and just make whatever number you want alright so do the same thing you just did earlier real quick do local and then you know hot dogs and then you know whatever you want however many you want um 45 I enter and make a new line and then do the same thing for hamburgers local is equal to 32 all right cool all right and now we're good we're gonna do is make a new variable so go ahead and hit hit enter and we're gonna make a variable called barbecue so just name it bvq so the local BB cute can I do capital yeah you can do capital but just make sure you local in front of it I know you probably know what local means just yet but we'll get into that soon no no you did no no no no like local but local in front of them basically when you type local whence have local in front of the variable it basically makes it like a local variable but you don't understand what that means but I'm not gonna go into this it's too confusing for right now so but yeah alright so local barbecue is equal to none open a number there yet what we're gonna do actually is we're gonna we're gonna add hotdogs and hamburgers so go ahead and type hot dog on your variable and then add and then do plus like the plus sign hamburger hamburger equals and then no no you don't need to do it equals because it already just added it so now basically barbecues equal to hotdog plus ham here and since hotdogs 45 and hamburgers 32 it's just gonna add those two numbers together so now if you go ahead and and type down there to print BBQ because I mean nothing you didn't put anything yet so you're making me lie let me enter yeah yeah we're just print print vbq you you have to put the parentheses by the way oh yeah gonna tell you some more cool no no no because it's a variable oh no no you guys this yeah all right now you learn it a hip Flay and that should work there seven so it added it all up for you so that's what that's pretty cool right like you can do that inside of coding so yeah that's basically what that is all right so yeah it's it's useful for obviously certain things so yeah that's what variables gonna tell you silver information okay so now I'm gonna try to teach you something called a function okay anything about function idea before you have okay okay okay so alright so we're gonna make a function that basically just we're gonna call it function alright yeah the type function and then what do you want to make it function do like it can do anything but nothing too complex move what do you move okay like like move apart I mean we can do that actually okay all right you know what let's do that instead okay okay I'm gonna teach you a bit of object-oriented or oriented programming okay so alright delete the function apart we'll get to that later okay so let's go ahead and use actual roll box to do real quick alright so go ahead and go into your scripting place or you know the main thing like the viewport like you're not get out of the script basically click there okay alright and then go ahead and insert a part into the into the studio all right perfect alright so now um go back to your script alright and we're gonna we're gonna actually put that part in a variable right now okay so go ahead and type local part is equal to and then do game because everything's under the game right it's a game dot workspace because it's in a workspace right and then hit enter cuz yeah alright so game about workspace dot part okay and now make sure you the calculations are correct which they are so you're good but now you actually have that part in your script so now we can do is mess with that part you can use the part and basically I mean you can just type game out workspace that part whenever you need to reference it but since you put it in a variable it makes it a lot easier to access right so basically now your variables equal to that right that's a variable useful for so what we're gonna do right now is that we're gonna change the color of that part okay so go ahead and do hit a hit enter and then do part r dot brick color and then actually wait now equal yeah equals brick color um dot new name and then type like it and then put a parenthesis in there and then you could put pick a color it's kind of weird out this this is one more question and taught you this one first because this one's like this was a bit odd compared to most properties but there you go okay so now if you actually go ahead and hit play as you can see your thing is gonna change colors so hit play and we can I do a rainbow you can do a rainbow if you want dude so where's your partner and there it is bro as you can see it's bronze obviously it was great when it first came forward it's you didn't change that says it's cool it works so yeah anyways that's how you do that right that's how you change a property that's what the you know those are called properties of the part so also do things like change the size if you want to you can do like part size and then you can do equals doctor does read on new value and then you know you could do that for that that would be you know you can do part outside and then du equals vector vector three it's kinda hard to expend all this right now it's like I don't think we have enough time but like yet in fact if you got new you just add on new at the end of the vector three and then you just basically put three numbers separated by commas so like I think it C says number X number Y and then number Z so just you know those are those commas no those are periods then I'll put like a comma between the each number there you go alright so yeah as you can see that's how that works so now if you go and hit play your parts gonna be pretty weirdly sized and yeah I think you see there it is perfect so that works right I'm also obviously not an anchor cuz you're a builder right so um you know you know anchoring it we can also unanchored an anchor with scripts right that's pretty cool it's you know I mean eat you mean okay actually I'll show you that was that's actually exam a boolean value so go ahead and hit it in a new line actually you won't be able to okay okay I don't know hit hit hit hit enter on your keyboard you have that you have it like hit you know the insert key does make rainbow there's no rainbow you know there unfortunately but um if you want to take a rainbow what you would probably do is like make up a loop right and then you just change the color every like half a second but I don't think we have enough time to teach you loose right now unfortunately we're leaving a minute left but I mean y-you did learn pretty well honestly you're doing a good job so um go ahead and go back into the viewport though like into the main workspace all right and then and then make your part go in the air and then and then anchor real quick what do you want me to anchor let's go to anchor a news anchor okay okay perfect all right so now if you go ahead and go back to your script we can do one final thing before the timer runs out okay you can do part anchor or anchor oh thank you as you can see all right and then you can do equals false and that's gonna basically make it false and then it'll fall out of the skies it's not anchored so yeah um let's do that real quick and then actually you'll people really see it because it's gonna run so fast that you know it's gonna fall in on time your load in but actually you know okay you're going it go ahead and um like I can touch it yeah yeah oh yeah yeah yeah okay if I go ahead and go out of a stop like yeah there you go all right and then go back to your script real quick and then I'm going to do one final thing before you end this go to all right go ahead and after the okay you see were you defined the part all the top make it yeah make it another line make it on the line between where you cheat all the properties yeah yeah right there for anymore exactly all right and then type wait wait and then put parentheses parentheses and then put how many seconds you want to wait so like let's just you three or maybe four so yeah yeah okay no you have to put the on foot seconds which is put the number are there you got perfect all right we have we have actually oh we're gonna have time dude no okay just let him play play let's see it though okay and as you can see does it work does it work um little actually was only ten seconds to figure it out but yeah okay as you can see you're gonna see it happen and boom look at that that's so cool right it works so yeah anyways um how did you how do you rate the scripting tutorial how you register every lesson bro what do you think I give it a 45 on a hunt seven point five out of ten but what did I do wrong bro wait wait hey why is not its head but so do you like scripting do you think you wanna you know keep learning on the script after this or is this it you know it's not something I'm really interested in not really is something I'm interested in all right I understand that nothing wrong with that you know if that's not your thing you know but it's at least you know at least you know now so um yeah all right well ITV's hope users for this video that's the end of the video if you guys did be sure to smash the like button and subscribe for more videos I'll putting every other day and yeah you guys want me to do this again or someone else let me know in the comment section below anybody's hope you enjoyed and I'll see you guys in the next one peace
Info
Channel: TheDevKing
Views: 449,225
Rating: undefined out of 5
Keywords: TheDevKing, Roblox Scripting Tutorial, roblox, studio, coding, tutorial, teaching my friend how to script on roblox, how to script on roblox, learning how to script on roblox, roblox studio, roblox studio tutorial, roblox studio tutorial 2020, roblox studio 2020, roblox scripting tutorial advanced, roblox scripting tutorial 2020
Id: _blMCeFpUJI
Channel Id: undefined
Length: 16min 57sec (1017 seconds)
Published: Tue Jul 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.