Advanced Roblox Scripting Tutorial #9 - Welding (Beginner to Pro 2019)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
right alrighty everyone welcome back to another advanced roblox scripting tutorial and guys in today's tutorial I'm gonna be teaching you about welding now what is welding you may ask ok so basically guys welding um how do I put it well I'll explain the second year but before start the video guys I just want to say one quick thing be sure to go watch the beginner series if this is your first video by me or else you probably will be very confused so the link to the beginner series all the beginner stuff is in the description below so anyways let's go ahead and start alright guys so first things first what is welding okay so some of you might already know I've actually been requested tutorial quite a few times but I'm really teaching you about welding and basically what welding is okay in roblox is it's basically you're making two parts move with each other okay so they're not okay how do I put this okay so you're basically making two parts like attached to each other right and they will move if the other one moves that's that's like I'm just going to put it so I mean you can read about it on the dev form but it basically says it's attached these two parts together and they stay in the same relative position or in an orientation to one another so if the part moves the other part will move the same amount and if the two parts are not touching one another they weld it together with a relative straight okay okay so yeah basically they're just gonna move in order of how they were well together right so let me show you example here that lot probably cleared up for you guys so I'm gonna go ahead and actually just use the weld in the row box2d okay I'm not gonna use a script yet I'm just going to show you what a weld looks like okay so you guys might have seen cars in Roebuck studio right there's cars people people make those things right and how you make them is with welds you need to weld the wheels to the body of your car okay so we're gonna make a quick little car here and I mean actually because it's not gonna work but I'm just gonna show you in a minute like so let me go ahead and make some wheels I need cylinders here we go alright one second guys I just gotta make these will dry here there we go there we go okay and now we just need to make this like that and there we go okay all right so I'm gonna weld this part right here to this wheel and then I'm gonna put another rule on the other side okay and then she's gonna roll around so let's let's show you what I mean okay so I'm gonna do this oh I'm gonna copy this part paste it oh wait no I'm gonna ctrl D paste this over here okay now how you weld in roblox to do what you can do is you can go up here in the home or actually think it's a model and then is it weld somewhere up here can come no I don't know I don't really use this tool much to be honest with you okay here it is create so create hinge prismatic cylinder all the stuff to room with uh stuff right now but what we're trying to do is well okay so what we're gonna do is create weld and what you do is you click on one and you weld it to the other okay so I just welded this wheel to this thing so now it should work I think but there's also another way to do which I'll show you in a second too so I'm gonna do the same thing when I weld this wheel to this thing right here too and they both should be well does that and now so let's go ahead and test it out and see if it works so make sure it's unanchored so what we want to do is just roll around so we're gonna push it with our little characters and see if it rolls so here we go okay come on up and it look look look at that look at that alright do you see what I'm saying here it's rolling right now right and the thing is if they weren't welded together they would just fall apart because looking I'm show you I'm gonna break the welds okay I'm gonna delete them and now when I spawn in watch what happens look see it fell to the ground why because it's not welded none of them are touching each other anymore so they're not welded and they won't say like together and in same position that that guys know that he's gone okay yeah he's gone anyway you get the flame right hopefully the next time see you guys and that's that's what welds do now there's no way there's no way to make welds and robots to do in building which what you can do is you can click on the thing you want to weld right and then go to over here in the properties the surface and then to the front surface or now what would be for this one it would be left surface and then you do hinge I'm sure you have a smooth and then you would just stick that in there and then it would weld once the game starts the game wouldn't know to weld that okay that's how it'll work and then do the same thing for this side too but using the this little crate thing up here's a lot easier as you can see cuz I love to just click click and then dump so yeah anyways but now I'm gonna show you how to weld something to your character or to tu right we're going well we're gonna weld like a cool thing to our head okay so let's go ahead and do this alright okay at first things first make a script obviously and what interview look see boys I don't even know no no no okay all right let me go script and alright what we wanted to do is we're gonna make a little part right here too I'm going to make this part and I'm gonna call it Balu okay and I'm gonna be okay if we're gonna make an example as if this blue block if it was above our head we would be in the blue team right that's what we wanted to do we want this blue block if it's above our head we want to consider us in the blue team all right so let's say there's an imaginary team in our game and yeah okay so we're gonna put the script inside of the blue thing right there so it's just easier so they move that in there and yeah and then we're gonna do go ahead did this we need a script dot parent or a local blue is equal to script op parents actually I'm gonna name as a blue heart so I don't think fuse you guys blue part and then I'm okay guys so I one more thing to so you see how sometimes I I capitalize the first letter of the word and sometimes I don't well that's really a bad habit of mine and please don't do that okay sometimes like sometimes I'll be like you know blue part and now this x will be like blue part you know the lowercase so like sometimes I do with a capital sometimes with lowercase now basically this right here write this with the first first word lowercase in the second word uppercase because you there's two words in here so the first letter of the first word lowercase in the in the first letter of second word uppercase that's known as camel case I'm pretty sure and I know that word I put in here will also be capitalized for the first letter like blue part yeah or you know you get the other point okay that didn't make any sense there but but yeah I'm gonna try to stick to that and it's a good habit of stick to you sometimes you'll mess up and you'll be like oh then I name it with a capital B or lowercase B and that matters and stuff so yeah okay sorry about doing inside track anyways alright so um local blue part also guys please make sure you understand the C frame before you watch this video you need to understand the C frame so if you didn't notice in the last video then don't worry I mean you can still watch and maybe it'll clear it up for you but we're gonna be using C frames here in a second alright so we're gonna do script dot or not I'm scripting right we're gonna do blue part dot touched okay so we're gonna say if this is touched okay we're gonna do connects function and then we'll name that hit in the parameter and then we want to make sure it was we want to make sure you know if hit dot parent fine first child humanoid we want to make sure it was a player that touched it right not just like the the base plate touched it you know I don't you know I'm saying so we're gonna so now basically what we wanted to do is we want to touch it and then we wanted to put it above our heads to signify we're on the blue team okay and then we're gonna do now we have it so basically if it's touched it is touched by a player and we're gonna be in this if statement okay so we're gonna go ahead and make a variable for our body part which is gonna be local local I don't know what to call it local head okay it is equal to hit dot parent dot head there we go and then we're gonna do local weld we're gonna create the weld in the script okay what the instance dot new what you guys should know how to do so local well because instance dot new weld okay we're creating a new weld here and actually it let's not well that you are ahead let's weld it to actually nevermind that's funny that's funny let's see okay so we're gonna do okay okay so this is where it's a little bit confusing okay so what we're gonna do now is we're going to okay this is gonna it's gonna look weird okay so when I make a weld right in roblox to do let me show you let me make one real quick when I make a weld wait leave me another part so I can weld it to that when I'm making well well there we go wait okay there you go all right these are welded now right when I make a weld as you see here if you look in the properties of a weld right it says part zero and part one also has enabled which is pretty useful feature to use so you don unable and that's thinking disabled but anyways part zero and then part one now what is part zero in part one means so basically these are properties of the weld which basically means what part do you want in the other okay so the first part one in the other is just that part I made just now and the second part will them together is the blue I did made just now right so what we want to do is we want to make part zero or equal to our head and then part 1 equal to blue and weld it to us so you see what I'm saying that's what we're going to do we're gonna weld part zero to us or parts there's gonna be us and then we're gonna weld it to our head okay so when I sit and I say parts of your on the script right here don't don't get all our wheel with me oh crap why did you leave that so yeah okay let me delete that part alright anyways so we're gonna now we're gonna do crap we're gonna do weld dot part 0 is equal to head okay and then we're gonna do well dot part 1 is equal to blue part okay now if we run the script right now it would work but we actually need to set a parent so first of all we use actually you can get up here we're going to set up here a little weld actually we will do it down here because we wanna make sure all is something configure before do that so we're gonna do well dot parent is equal to script dot all right basically that's what I'm doing now because we created the instance a weld right but we didn't actually put it in the game yet because we didn't set a parent for the weld that we'd made so I'm putting it inside of the inside of the part right so we can weld it to her head all right so now if we run the game it should work but watch it's gonna be really weird I think it should worked out okay come on now let's go let's go come on and ok look at that guys we know we are now I've just this blue box ahead of us and yeah we did well the to our head okay as he goes to there it's literally walls into our head and yeah I mean yeah that's what it is so okay so that's basically how you use that that's how you use welding and that's how you weld stuff to you now you're probably wondering okay well we're gonna put it above us right so that sucks like stuck on our face all the time okay so yeah the way we do that is what we're gonna do is just add a C frame to it so what we're gonna do is just offset it so remember what we learn with C frame we're gonna do C frame dots or no crap now we're gonna do blue part dot C frame equals head dot C frame mix we're gonna offset it off the head and then times or plus but we can't do plus but that's what it means maybe my face pretty much and then we're gonna offset it by 10 on the y-axis okay so we actually need to put that after that - oh crap but put it up here guys now it's hard to explain why right now right but you need to put it up here okay don't write it down here okay because you want to have like this set before the weld because if you set it after the weld it's not gonna work it's just gonna move you up with it so yeah set it up here and you'll see why okay and then if we run the script it should work right so let's test it out real quick and it's actually not gonna work I don't think but I just wanna show you guys something real quick so yeah it didn't work and why did it no work okay here's exactly why so basically what it does is it actually sets it right and when it sets it it moves it by default right it changes the C frame whenever you weld it changes the C frame by default to each other okay so what it's doing is it's setting the C frame exactly to the head so now it's directly in the head right so these had the same C frame right now right the you know the head and the blue part of the same so your frame so what we need to do is actually make it so it doesn't automatically do that and how we do that is by making it so it keeps its properties and or it keeps its rotation and position when it moves and stuff like that okay so how we do that so how do we make keep it same as proper scape keep it same position and rotation or orientation you know when it's welded now how you do that is you're gonna do well dot C zero now it's honestly I'm it's very hard to explain this right now but basically weld zero basically means like head okay we're gonna set it equal to head dot C frame okay so it's part zero and weld 0 well 0 is equal to a dot C frame and we're gonna do weld see it c1 is equal to blue part dot C frame now basically what this does is it sets it equal to you know okay like the opposite thing okay it's so hard to explain I'm sorry guys it sets it equal to like the opposite thing and it sets the orientation and it makes it so it doesn't change okay so it basically makes it so it's gonna stay the same and the position wants to the stamp so let me show you what I mean by that okay so I'm gonna go ahead and hit play and it's not gonna work I don't think but watch what happens okay okay and actually it did work and I'm very surprised but look what let me do it again and let me show you if it doesn't work button wait a minute here we go and okay look at that it's under me now why the heck is it under me I don't know I couldn't tell you okay but before is above me right I don't know why it's under me I literally couldn't tell you but it was okay now I guess it must have added it like below me for some reason but basically the point is it's under me okay now why did it go above me the first time I actually don't know but let me touch test us something real quick okay no but it's still under me okay the first time I don't know what happened but the point is it's going under me okay now the way you stop that is you're gonna do inverse on the end of these see there's zero things you're gonna put inverse and that's a : inverse so basically you're inversing it and it's gonna go above you now so watch this and now boom it's above you okay now finally it works okay it's so awesome now anytime when you walk by someone they know wrong the blue team or whatever you want to call it and yeah it looks pretty cool I like it a lot and obviously we could put like a GUI up here it says blue team but yes I want to make sure you eyes yet I don't think you do at least but um yeah that's pretty much how welding works now one more thing I want to show you with welding is obviously the very important for tools so whenever you make tools you're gonna be using them like you know too well so we're actually gonna move the tool in there further now but I'm gonna go ahead and make a little axe okay I'm gonna make it like a like a little axe it's not gonna be a good one okay but that this is it okay this is my axe all right or actually it looks like a tea but this is my axe oh my gosh it looks so bad this is my axe okay and obviously we need to set the handle so we're gonna do handle you guys don't know you guys know how to make tools you should know how to make tools I covered that and in the advanced series the first episode of it I'm pretty sure so make sure to go watch that again already but we're gonna rename this to axe okay listen gonna be our tool now if you actually you just run this right now and put it in our starter pack right it's not gonna work now let me show you what I mean okay watch this okay the reason why is because I grab the handle right i grab the handle and i and it went to my character right it wallets my character but the problem is this isn't welded to that okay it's not welded to it so it automatically just went away there's still and it's still in the tool right it's still in the tool as you can see there whenever I click it it pops up right but it's not welded so it's falling off now the way you fix that is by welding it so there's an easy way to do this which is you know obviously you you could just move it here right and you could oh crap come on and you could do this you could do handle and then wait crap handle and then let's see well where's weld up here I know I think it's in model also kind of fourth monitor it's pretty cool if you guys don't know I have three monitors when I four it's pretty pretty crazy looking to be honest but maybe I'll just set up one one day anyways where is it weld and then tool click wait that's that I didn't did I did that right okay wait a minute all right axe and then okay model creates weld I'm on the handle sign over to that and then now it should work let's move it into our starter pack and let's see if it works real quick I'm actually gonna curious because I don't I normally don't weld this way in our new tools but I want to see so yeah it did work now obviously the tool is the wrong way up but that's a pretty simple fix that's that's not like that's nothing to do with welding that just has to do with the fact that I didn't rotate it right so I need to rotate like this I'm pretty sure and then it'll work or you can just set the handle position grip differently but yeah that should work now I'm gonna test it actually because oh wait crap it's in the it's in the workspace let me go back to the starter pack and then it should look like a like I'm like hey it like a a tool it's welded right now okay it's still sideways you need to have to you know set like the grip position differently yeah that's a different problem though that says something else but anyways you get the point okay now it's welded right and it works now there's actually a much easier way to do this is which is with the welding script made by Quinte so I'm gonna show you guys something it's actually a free model I use it to be honest it's pretty simple a lot of people I know it uses it well and basically what it does is it's just it's just an easy way to weld right it's just um I'm gonna show you so let me open up my toolbox over here and then let me go right here mmm it's called cue perfection weld script I think weld and let's see if it pops up here okay there it is not quite - you see that's the first one to perfection weld I don't think the description if you want to use it link in description but basically what it does is it just welds everything in like and everything in a model right and for tools you don't have to put it in a model tool you just put it in in the tools right you put it in tool but basically a welds it all together for you so I'm actually going to delete the weld and then I'll show you how it works so it works pretty good it's pretty simple you just hit literally just hit play and then boom welded already so yeah um I can add any more parts to it I want to add to it now I can select for example if I wanted to make another one right here man like that I don't ever wanna make that one right here - obviously it's not like it doesn't look like an axe much anymore but um it's still still like that and now if I hit that oh I didn't move it to the oh my gosh I didn't move it to my starter pack again also guys one more thing about welding the parts don't have to be touching - well if kiss guys didn't realize that the parts do not have to be touching and they'll stick is still weld but as you can see here it welded together with the script yeah and now we can touch our little bar and we're in a team with a cool-looking axe okay not really but yeah anyways guys that's pretty much loading for you oh but that made sense if you have any questions like always please leave a comment now guys this script right here is pretty popular so you don't want to easily don't have to but it's it's made by a good person named quench you can look on Twitter is it pretty pretty cool guy but um yeah anyway that's pretty much it guys see you in the trip I'll see you in the next video leave any questions you may have in the comments or in description below and I'll see you guys later peace out
Info
Channel: TheDevKing
Views: 80,788
Rating: undefined out of 5
Keywords: TheDevKing, Roblox Scripting Tutorial, roblox, studio, coding, tutorial, roblox studio, how to script on roblox, roblox studio tutorial, roblox studio welding, roblox studio weld, how to weld in roblox studio, qweldperfection script, how to weld in roblox, what is welding roblox, welding roblox studio, roblox weld, how to weld stuff in roblox studio, how to weld stuff in roblox, roblox beginners scripting tutorial, roblox scripting tutorial beginners, roblox scripting tutorial 2019
Id: LEy0po6sLso
Channel Id: undefined
Length: 20min 27sec (1227 seconds)
Published: Mon Aug 26 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.