welcome to the first scripting tutorial in this series so this series is gonna teach you how to script on roblox it doesn't matter whether you are a beginner you have a little bit of knowledge or there are just a few things which you want to learn you don't already this series is for anyone really and we're gonna be going over in detail everything to do with roblox scripting so that you can become a pro alright so let's open up our box to do if you don't have it installed you can go get it from roblox although if you played a robot's game before chances are it's probably installed on your computer I've also got another video going over the basics of studio and how to install it which I'll link in the card and description but let's go and open it up and usually to wait it's usually quite quick you might have to login if it's your first time but don't worry if you see a screen like this as well just ignore it we're gonna go and click on baseplate and that will just give us a blank area to work in okay so in this video the first video in the series we're going to be looking at properties and what properties are to begin with you need to have these two panels enabled okay these two panels are the Explorer panel and the properties panel and to enable them you need to click on View at the top in this ribbon menu and then you should just be able to click Explorer and properties and that will open them up like this okay so the Explorer and properties window they are the most important panels you'll be using when you create games and the Explorer lets you search for and see all of the objects stored in your game and the properties window lets you change them so how they look or how they function okay so properties there are lots of different objects in roblox studio ok to get a list of all these objects you can go on the model tab and click on advanced objects just make that a little bit bigger and here we go there are loads of objects which you can insert into your game they do different things now each objects will have properties which contain which contains information about what they do how they look etc okay so we're going to insert a part to begin with all right so you can either insert a part by finding it in advanced objects you can either look for it or search for at the top or you can just click on parts over here okay and that's just one way what a few ways to insert a part so we're going to be focusing on a part today we're going to worry about all these other objects we'll get to them in a future video but we're going to be using a script to manipulate and do some cool things with this part by changing its properties so to have a look at a part or any other objects properties you just need to select it okay so you can click it or you can locate it in the workspace for example if you didn't know where this part was or you have lots of parts in your games and it was hard to find a certain one you could just look in the workspace or you could search for it okay and that will find all of the objects with the name that you searched for so once you've found your parts you can press F on the keyboard and that will move the camera directly to to this object so you can see we have lots of properties in the properties window so we have properties for its appearance which change how the part looks such as the color of the brick you have brick color which is a set of colors from from a palette which you can choose from or if you want a more detailed color you can awfully pick one in this RGB picker things like material as well you can change the material of the part reflectance as well which if I set it to something like smooth plastic it's basically reflecting the light in the game say from from the Sun and things like transparency as well we've got data properties such as the name of the parts so I could change the name to be hello and you can see the name of the part that's changed so that's what we reference with we reference the name to find the specific parts we've also got orientation which basically is the amount of degrees it's been rotated if you use the tools up here things like position velocity we won't really get into that today but we have some important properties which you need to know okay so anchored is a property and the anchored property if it is set to if it's checked then the part is going to stay in the air okay it's gonna stay fixed in the air but if we set anchored to unchecked it's gonna fall out of the sky okay so anchor just means that it's it's locked in its position and it's not going to be affected by say like collisions if it if it hits something then this brick isn't going to move because it's it's it's frozen in the air we've got can collide and can collide is it determines whether a part will collide with another part if it hits something okay so we've got count collide set to true on both of these parts now let's just change the color if I get this part and I uncheck can collide then the red part is going to just fall into it like this okay in fact the green part fell out of the world because it's not colliding with the base plate either so they are important properties which you need to know and we've also got size but we're not going to focus on on those today there they are just some simple properties and you can see that by changing these properties the part looks and acts in a different way okay let's just make it transparent and sorry opaque and not reflective but we had to manually change those properties okay but in a roblox game that's running we can't just manually change these properties we have to use a script because a script can automatically change these properties for us and automate our game every roblox game that you play such as jailbreak or death run has got a script running behind the scenes which is making the game work so like running the rounds checking to see if he's worn the game etc and it's always changing properties because properties is one of the most basic things you need to know to even get scripting so a script allows us to carry a carry out tasks in a specific order we can tell the game what we want to happen and then the game will be able to do these things and run itself automatically so let's insert a script into server script service so we're going to click on the plus and then click script we're not going to do module script just a script okay now as I said a script will carry out tasks in order okay so whichever line comes first that line will be the one which is executed or run first so to change properties of a part let's say we're going to change the property or some properties of this hello part which we created okay we're going to need to reference this part and reference just means tell the script where this part is because the script we can't just say hello and then we can't just we can just say that okay we have to reference it and tell the script where this part is located and that always comes first so in our script we're going to firstly get this part and to get it to reference it we firstly need to say where the part is stored so it's stored inside the workspace the workspace is a store for all of the parts and things that you see in the game okay for example if I take Hello out and I put it somewhere like replicated storage we can't see it okay so workspace is where all of the parts that are currently in the game world being rendered are okay so everything that you see in your game will be in the workspace so we just need to get this part which is inside of the workspace now the workspace is a service and there are loads of different services here you can see all of these ones here and these services they do lots of different things they house different objects for different reasons but all of these all of these services they are together stored inside something called the game okay so if you think of our services as being in the pink squirt square and then we have our game which is the outer scope okay so everything in the pink box switch sauce services such as the workspace the lighting etc they are a part of game so whenever we want to reference it we have to say game first okay so we say game and then we can do a dot and a dot and allows us to reference something that's inside of of game or the thing before the dot okay so if we said workspace okay which is after the dot workspace is inside of game and game is its parent okay and workspace is known as the child so game dot workspace we've just referenced the service but we now want to get the part called hello which is which is inside of the workspace now hello is going to be a child of the workspace as it's inside of it and workspace is the parent so we're gonna do another dot because we want to get something from the workspace and we're gonna just get the name of the part which is hello and you can see world looks to do begins to it begins to autofill the the result so we just write out hello and we have just referenced our part in a script it's just the same as selecting a part and now we can see all of its properties that we can change okay when we don't when we haven't clicked on a part we haven't referenced it and the game doesn't know what we want to change so we have to tell it what we what we want to change okay so we've selected it and now we can see its properties and that's that's pretty much the same as what we've just done here in the script so now if we do a dot we know that the properties are a part of that part of that of the brick called hello so if we do a dots you can see the script it starts to autofill all of these different properties which can change look we've got transparency anchored and brick color so you can choose any of these properties so we're going to we're gonna do a couple properties to begin with only you could prove oh just to keep it simple so the property that we're gonna change first is transparency okay and all properties aren't the same they take different types of data okay so for example we have transparency over here and you can see the amount of transparency which this part has transparency is basically whether it's see-through or not you can see it's a number so we could have 0 which means no transparency at all we can't see through it or one which means fully transparent so any number between 0 and 1 is going to affect the transparency so not 0.5 would be half transparent okay so it's a number transparency is a number property okay because the value it takes which changes how the part looks is a number okay whereas something like the name property isn't a number it's a piece of text but we call a piece of text a string okay so if you want to change the transparency of this part we know we have to give it a number so we've referenced the property and now we want to set it to a new value and because it's a number we're going to say equal to so we're making this track this this property equal to a new number a new value and so we just put the new value after the equal sign so I'm gonna set it to 1 which means fully transparent okay now if we just go back to the game and we select our parts let's just set it to completely opaque so we can we can't see through it and now we can run our script to see if we've successfully been able to change the transparency so we're going to click on the Home tab here and then click on this arrow which is underneath run it might say play so click on the arrow and click on run run basically lets us run all the scripts in our game without having to join it so let's click run and there we go the part has gone fully transparent and we can see through it but it doesn't mean that the parts been deleted it's still there we just can't see through it because we can select it in the workspace and look it's still there and if we go ahead and change the transparency again you can see one it's at the end of the spectrum and as we move it further to the left it becomes opaque again and that script is only ran once once it's finished setting the transparency it will see that there's no lines left to execute so it will just stop running okay so that is a very very simple property transparency but I said there were other data types which properties take because not all properties are going to take a number for example the material property that is text but you can also select them from a drop-down so there are two ways to set the material of a of a part so we're just going to get rid of the dock transparency but this time we're going to set the material now the first way is just by putting the text okay the name of the material in quotation marks or speech marks okay so if this is smooth plastic that it's currently on and we want to set it to grass we could just write grass in here okay and if we go and run the game it's sure to change the property to grass there we go and if we click on the part again and have a look in the properties tab the script has automatically changed it to grass for us okay now the second way of doing this is by using an enum okay so an enum is kind of like it gives you a list of properties to choose from so you could write enum and then you could say dot and you then have to write the name of the property okay so I know we've written out before but we have to write out again for enum so when we write out and then do another dot it will give us a list of all of the materials just like when we typed in the property name sorry the the name of the parts it gave us a list of properties before we wrote the property so you can select a property so material here such as wood that will do the exact same thing okay it will set the property so there's two ways for you and can choose whichever one works for you I prefer doing it this way because it gives you a list of materials but you can you can use enums for all types of properties well all types of like drop-down properties like this okay where you can select one from from a list and we you also have brick color so there's two ways to change the color of parts so you could either do brick color and brick color lets you set a preset color which from this palette okay if you click on brick color you can see a list of all these colors and each color has a name which represents its RGB value an RGB value is just a set of three values red green and blue and it makes it one big color but brick color is simpler than that and it just gives you the name of the color so to set a brick color we obviously have to say the name of the property but we can't say it in speech marks like this because brick color is a special type of property and we have to say Bricker dot new because because it's roblox's color palette and this is the way of picking the color so you say brick color and then you say dot new the new in lowercase and then you have a set of parentheses or brackets after it and then in quotation marks or speech marks inside of these brackets you can write the name of the color but it has to be a color from their palette and has to be spelled correctly with the capitalization correct as well you can see we have a capital R for really but then it goes lower case for red now if we go and try this out you can see the part that goes red alright and there's one more way of changing the color with this color palette if you wanted to give an RGB value so instead of saying brick color you could just say color and don't forget this is the American spelling so those of you that are British we spell it with a u you have to spell it Co lor the american way so when we set a color we can say color 3 because a color 3 value is made up of three RGB values ok color 3 and then we can say dot from RGB and then we can give a number between 0 and 255 for each color so the amount of red the amount of blue and Green and it will mix it together kind of imagine it like paints if you're mixing red green and blue paint you're also gonna get a color right so if you did 255 comma zero comma zero that would be completely red but um you shouldn't really have to understand this for now I'm just showing you how color 3 works and you can see if I choose a color on the color picker it gives me a red value green value and a blue value so 255 one five seven and thirty seven one five seven and thirty seven and that should give us the orange car yeah there we go so that's how you change the color now there's one last type of property I want to show you and that is the behavior properties so anchored archivable can collide locked masses etc they're all check boxes and a check box is either on or off so true or false so there's two values you can choose from and this is a boolean value a boolean value is either true or false it can't be anything else so if it's true then it's gonna be what if we were looking at the anchored property for example okay anchored and we set this to true if it's true then it means yes it is anchored but if it's false think of it as being unchecked or not I'm good so if we keep anchored as false and we lift it up into the air and we run the game it's going to fall straight to the ground but if we change anchor to true which means it is anchored and the anchored property is turned off then there you go it stays up in the air and you can see again in the properties window we have managed to change the property from script now you may be thinking this is really really simple can we just get into the really good stuff I know it's done that but we have to really go really really simple to begin with with the properties because then we can do really really cool stuff in the future use need to make sure you have a good understanding of how to reference okay by saying the service and then getting the name of the parts parents children and the property as well okay I think we're gonna leave it there for the first video if you want to go to the next video there'll be a thumbnail on your screen right now with an arrow so go go click it I'll see you in the next video don't forget to subscribe to my youtube channel I produce lots of roblox scripting videos to help you make your own roblox games do take your time and don't give up on scripting it may seem hard but trust me you'll be able to do it alright thanks for watching