Beginner Roblox And Lua: Start making Games with Roblox Studio | Nico Kaupenjohann | Skillshare

Beginner Roblox And Lua: Start making Games with Roblox Studio

Nico Kaupenjohann, CS Student, Nerd and Educator

Beginner Roblox And Lua: Start making Games with Roblox Studio

Nico Kaupenjohann, CS Student, Nerd and Educator

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
58 Lessons (5h 46m)
    • 1. Introduction to my Roblox Class

      1:03
    • 2. (Lua) Variable Types in Lua

      8:38
    • 3. (Lua) Output & Comments

      4:43
    • 4. (Lua) Math Operations

      9:17
    • 5. (Lua) Relational & Logical Operations

      6:32
    • 6. (Lua) If and Else Statements

      6:53
    • 7. (Lua) Local Variables)

      2:23
    • 8. (Lua) String Operations

      7:08
    • 9. (Lua) Loops in Lua

      7:10
    • 10. (Lua) Tables in Lua

      7:23
    • 11. (Lua) Functions in Lua

      4:36
    • 12. (Lua) Coroutines in Lua

      9:55
    • 13. (Lua) The Math Library in Lua

      7:22
    • 14. (Roblox) Roblox Studio Explained

      9:47
    • 15. (Roblox) Reference a Game Object

      5:49
    • 16. (Roblox) Types of Scripts

      6:20
    • 17. (Roblox) Properties Overview

      9:42
    • 18. (Roblox) Built in Functions and The Object Browser

      10:02
    • 19. (Roblox) Colors in Roblox with Color3 and BrickColor

      4:59
    • 20. (Roblox) Short Math - Vectors

      3:39
    • 21. (Roblox) Vector3 and Position

      9:50
    • 22. (Roblox) Making a Conveyor Belt with Velocity

      5:10
    • 23. (Roblox) The Wait-Function

      2:13
    • 24. (Roblox) New Instances with Scripts

      8:21
    • 25. (Roblox) Part Property: Surface

      3:55
    • 26. (Roblox) Part Property: Material

      3:25
    • 27. (Roblox) The Touched Event

      7:58
    • 28. (Roblox) Players (Player vs Character)

      9:21
    • 29. (Roblox) Adding a Spawn Location

      5:05
    • 30. (Roblox) Click Detector

      5:34
    • 31. (Roblox) Making a Leaderboard

      8:33
    • 32. (Roblox) Adding a Trail to the Player

      9:05
    • 33. (Roblox) Make Parts that the Player can collect

      8:51
    • 34. (Roblox) Services Brief Overview

      7:13
    • 35. (Roblox) How to navigate the API References on your own

      6:33
    • 36. (Roblox) Screen GUIs in Roblox

      18:40
    • 37. (Roblox) Billboard GUIs in Roblox

      5:08
    • 38. (Roblox) Surface GUIs in Roblox

      3:47
    • 39. (Roblox) Introduction and how this Section is build

      2:42
    • 40. (Roblox) Modelling the Obby

      21:00
    • 41. (Roblox) Adding Movement Scripts to the Obby

      19:41
    • 42. (Roblox) Adding Cannons to the Obby

      16:02
    • 43. (Roblox) Creating Checkpoints for the Obby

      5:58
    • 44. (Roblox) Creating the Timer and a Leaderboard

      12:23
    • 45. (Roblox) Publishing your Game

      6:34
    • 46. (Roblox) Add Pictures to your GUI

      5:10
    • 47. (Roblox) Storing Player Data with DataStoreService

      17:34
    • 48. (Roblox) Creating Developer Products and Prompting Purchases with the MarketPlaceService

      18:28
    • 49. (Roblox) Multiple Places in a Single Game

      3:39
    • 50. (Roblox) Teleport between different Places

      8:11
    • 51. (Roblox) Using Packages to share Scripts between Places and Games

      9:28
    • 52. (Roblox) Pressing Keys with the UserInputService

      5:08
    • 53. (Roblox) The Roblox RunService

      11:56
    • 54. (Roblox) Adding a simple NPCs and using Pathfinding

      16:10
    • 55. (Roblox) Adding Sounds to the Game

      4:20
    • 56. (Roblox) Pressing Keys with the ContextActionService

      14:17
    • 57. (Roblox) The Roblox TweenService

      12:12
    • 58. (Roblox) Sending Information with RemoteEvents

      14:36
37 students are watching this class
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

256

Students

1

Project

About This Class

Have you always wanted to create your own games, but didn't know where to start? This is exactly the class you need then! 

In this Beginner Roblox and Lua Class, you're gonna learn the basics of the Lua Programming language as well as Game Development with Roblox Studio. No experience is needed to learn the ins and outs of making Games with Roblox Studio.

This class is accessible to complete beginners. Even if you have never programmed in your life. Basic knowledge of Roblox would be advantageous but isn't necessary.

First, you will learn Lua, then we'll go through basic concepts of Roblox Game Development and as a part of the class, you will even make your first game! 

The entire Source Code will be made available so you can follow along with everything I do in the lectures. 

If you have any questions or suggestions, feel free to contact me here. I'm happy to help you learn to make Games with Roblox. 

Meet Your Teacher

Teacher Profile Image

Nico Kaupenjohann

CS Student, Nerd and Educator

Teacher

[EN/DE]

Who am I?

I am Nico Kaupenjohann and I study Computer Science at the Ruhr-Universität Bochum. Early on I was always intrigued by the magical act known as programming. It was something truly magnificent and useful.

Why Computer Science?

The magic and the feeling which began with my first Hello World programme never really faded away and I would love to share it.

Programming, in all forms, is a superpower. It will make you invincible in modern times.

Wer bin ich?

Ich bin Nico Kaupenjohann und studiere Informatik im Master an der Ruhr-Universität Bochum. Schon früh fand ich das Programmieren gerade zu einen Magischen Akt, da man schnell etwas sinnvolles aus dem nichts e... See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

phone

Transcripts

1. Introduction to my Roblox Class: Hello, I'm Nico cop mu1, masters students for computer science and all odd nerd for everything game development related. Not too long ago, I've discovered the amazing power in tools that roadblock Studio gives you for game development. In this, the most extensive beginner class or roadblocks game development here on skill share, you will learn all the basics you need to make your first roadblocks came. First, you'll be introduced to the scripting language Lua to understand the fundamentals. And then we'll go through robot studio and step-by-step, you will learn the basics of scripting and roadblocks, like how to reference objects, how vectors work, and much more. After we're finished with the basics, you're going to create your own first game. It will be an ABI, read something with the skills you have acquired during this class, I'm excited to see what you can come up with. You only need robots to do to start, the very friendly is very low and you can start without any prior knowledge of programming. So what are you waiting for? Enroll in this class now and let this be the first step of the journey to build your own first roadblocks game. The power is in your hands. I will see you in the first lesson. 2. (Lua) Variable Types in Lua: At Welcome to the loo introduction here for the robots course. And in this lecture, we're gonna talk about variable types. But first of all, we're going to create our own project here. So if you've never used roadblock studio before, this is probably something that you're going to see first time you open it. And what we're gonna do is we're just going to select base plate here. So make sure you are a new, old templates and then base plate. And this will open a new, a new base plate. So a new project for us. And this might look a little different that it looks for you. So we have the, we have the window here where we can actually see what is in the game. We have an output here, properties and the Explorer. Now, I'm just going to give a quick overview here. So if this looks different to you, you can actually enable and disable up here in view, will actually enable and disable certain windows. The three main windows that we're gonna need is the output, the Explorer. And then one more thing here we are. We actually see our scripts that we're gonna write. So those are the three things that we need and the rest right now we can completely ignore. So to start, what we're gonna do is we're gonna go to the right here. And we're going to create our first script. And we're gonna do this in the server script service right here, this one. And by, we're just going to select this. And we're going to click the little plus icon. And we're gonna get a whole bunch of stuff that we can actually put in your, but what we want to create a new script. So we're just going to click Script and it immediately opens. Now inside of here we can actually zoom in by holding Control and then zooming with a mouse, the mouse wheel, right? And let's make it nice and big toe, you can actually see something. And we, as we can see, someone's already written in here. Now the first thing, however, that we're gonna do is we're going to rename the script. So on the explorer, right, you can click the F2 key or you can right-click and then go to Rename here. And we're going to call this variable types. Because this is the lecture about variable types. And as you can see, there's already something written in here. Now, to start the script, we actually need to go up here so you can see that the script menu is opened up here. And we actually want to go to this little arrow here and then do run instead of play. Because if we hit play and the game starts, well, we only want to run the scripts and not, sorry, I have the game run at least in this Lua introduction. So let's just click over earlier and see what happens. So we click Run. And as you can see here, helloworld was just printed out. And we can also zoom into this output by the way. So this is probably the best. And let's stop that appear. And as you can see in the home, you can also run the script. But right now, that's basically all you need to know about robots to do. First of all, we're going to go through the loop introduction. And then we're going to look at the functions and, and functionality that we can use for robots. Now, Lua, what is Lewell? Well, the question is, so. This here, roadblocks is created in a language called Lua you. So this is very similar to Luan. This is basically well, 5.1, right? With a few different additions. And this is basically all the basic knowledge that you need to know. This is Lua you, there are two resources on here as well. One for the Lwoff 5.1 manual, where everything is explained once again in even greater detail. Then we're gonna go through this loop introduction. And then there's also a short little introduction to Lua you as a resource. And that is, that highlights some of the differences between Lua you and the normal Lua versions right? Now, what is this first lecture about? The first lecture about is about variable types. And the question becomes, well, what are variable types would have variables. Variables are basically, they are datatypes in which we can store some information, right? So let's think about this. We might have a variable x and what we want to save into that is ten, then what we write this x, and then we were at an equal sign and then ten. Now this inside of here is of course a number and this point. So this would be a number, right? So let's write numbers because there are different types of numbers. So if you've already programmed in another language before, then this might be familiar to you. This would, this is what we would call integers in Lua, however, they are all the same number types. So in this case, this is a number type, an integer without any decimal point. And now we can also, for example, write 10.5, right? And this would be a float that is something that, like I said, if you've programmed in other languages, in this case, these would be the same types. Really, there's not much difference there because Lua, also for the people who have programmed in another language before. Of course it's not as strongly typed language. So we actually don't have to specify what type of variable it is. We just have to write the variable name, then an equal sign, and then whatever we assigned to that variable, right? So those are the numbers. There is also something which represents the absence of any value at all. So we can just take the x that we have done before and assign it a new value and we're going to set it nu. So this is basically the null, right? So this is, this represents the absence, absence of any value, right? We're also null in other programming languages, this would be a null in Lua, This is a nill. And this simply says there is nothing in near, so it's not 0, it's nothing that this represents an absence of any value. Sometimes a little hard to wrap your head around, but going forward, this will get clearer with time. Yes. So that's also another thing that is going to be a Boolean. So a boolean value basically simply is true or true or false. And that's old stores. So a one or 0 or true or false. So for example, you could say, is what course are good? And then hopefully that will be true. And inside of a game, you could imagine maybe there is a Boolean value that's called is grounded. And is grounded might be true as long as you walk upon the floor. But then what you'd jump, this would get turned two faults so that you can't jump while in mid-air. And as soon as you touch the ground again, this would be turned into true. So this would be an example of a Boolean value and in sort of a way you can use it. Now those are three variable types right now. And then we also look at the worth. And that's gonna be the strings. And strings are basically characters or sentences. So we can have words, for example, a variable called words. Inside of it. We were going to write hello world. Now we've already seen this helloworld before, but this time it's actually inside of a variable. To initialize these strings, we actually encase them with quotation marks and everything inside of it is then counted as a string. It might be the case that you actually want many, many words next to each other. And the more that you can do is you can type two of these brackets. And then you can go, for example, a little further down and write another two of these brackets. And then everything inside of here is going to be. So this is, this can be a very, very long string, right? So this can be a very long, well even a text or something like that that is inside of these brackets now. Yeah, and those are the basic types that I wanted to show. There are some more advanced types that we're going to talk about in later lectures. But in this case, with these basic types, we can actually already look at a few things that we can do. And from here we can actually go forward with the LU, introduction. So, yeah, overall, that would be it. If there are any questions, of course, always feel free to ask and I'll be shorter respond. And yeah. 3. (Lua) Output & Comments: All right, welcome back to the loo introduction. And in this lecture we're going to talk about the output and some comments. Now, first things first, I want to add a quick little addendum. Of course, each script I'm going to be writing here in these lectures is going to be available as a resource for you to download. And the entire project is also available as a resource to download. So you don't necessarily have to program with me. I still encouraged though, it makes sense because then you'll get a sense of how to what to do in order to actually facilitate some end goal. I would advise it, but it's not necessary so you can download everything I'm going to be doing here, right? So in this lecture, we actually need a new script right now. So we're not going to be writing in this script. We're going to create one script for each lecture. And of course, once again, we actually go to the server service, to the little plus. And then we're going to click script. And I'm gonna rename this immediately to output and comments. So output Kaj up comments. And we're going to quickly talk about the output. So it, I actually already provided us the output here. This simply is a way of outputting either variables or consider here just a string, right? So we've already seen this when we run this, it just prints out hello world. But what we can also do if we, for example, define a variable up here. So how about something like health? We're just gonna call this 1000. Then what we can also do is we can also output just this variable. So what, what's written inside of health right now is 1000. So if we print out Health, what's going to be printed out is a 1000 and not well health as in the string health, right? If we want the string health to be outputted, then we actually need to make it a string by surrounding it with the quotation marks. In this case, we don't want that. We can also have something written before that and after it. So this is a sort of more advanced comment or a more advanced output would be if we have a string. So for example, our health is, and then we have this, and then we'll just make a comma and then the variable that we want to output. And we can chain these together as how much we want, right? So we can have another variable, we can have another string and another variable, and so on and so forth. So for example, we could do something like this, right? Our health is h1 and then it's going to display the health variable, so that's 1000 and then HB after. So let's run this. It's gonna be our health is 1000 HP rate. So this is basic, basic output. This can be needed for, well, if you have some services going on and maybe you want to output, hey, we're at this point in the servers and we've initialized this. And it can also be used for debugging purposes. Although there are other tools for that, it can be useful to just quickly print out a few things. Print out all your variables are, maybe they're going to be something different than you expect. And that's always useful to have the print in there and comments. Well, you've probably already seen the comment in the last lecture, but we're going to talk about it once again. So if you do two will these dashes, then it creates a comment. So I always put in the, the lecture topic at the top. So this would be output and comments. And I like to personally put two dashes behind here. This is not necessary actually, so we can also skip those. I personally just think that this looks better, but this is a absolute personal choice and it's not necessary at all. So this, in this way, we can create one single line comment. We can also create a multi-line comments. And we do this by creating first a normal comment with the dashes. And then we actually do two brackets. And then inside of those brackets we can actually write in anything we want. And then we close it with two other brackets. And now we have a multi-line comments. We can also write a multi-line comment. Nice, right? So for example, this works very similar to the strings that are also multiline or of the strings that are a little bit, a little bit longer than we've seen in the last lecture. This is basically all to know about the output and the commons. Just a short little lecture to get you up and spit on that. Once again, if there are any questions, feel free to ask and I'll be sure to respond. And yeah. 4. (Lua) Math Operations: All right, welcome back to the loo introduction. And in this lecture we're gonna talk about math operations. But first we find ourselves back in the old script from the last lecture. And what I advise you to do right now is each time a new lecture starts, I would advise you to simply comment out the old print statements that we use. Because otherwise the output is going to get very cluttered very soon. And I'm gonna be doing that going forward. Now, I really do advise you to do this because for example, in this lecture we're going to have a lot of print statements. And then in the next lecture we're going to have a few more. And because the order of operations, so the order when each of the scripts is executed is not always the same. You can't reliably tell when what output is going to show up. Therefore, I advise to print those out. However you can, of course, simply delete the dashes and then it's going to print out whatever is written in there. So that's just a short little thing. And I've also already created the math operations script. I'm sure that you can do this, right. It's just over the server script service plus another script, rename it, and then you're ready to go. Right? So math operations, so I already here some of you science or math again, don't worry about it. This is not crazy complicated. These are the, just the basic operation that you can do. So the first thing that you can do, of course, is an addition. And the way we do addition is actually very simple. What we simply do is we say, well, let's have a variable. So for example, we call this edition, and we just say 20 plus five. That's it. That's already edition. They don't need to be spaces in-between necessarily. Rod, you can also write it closer together. That's a preference thing more than anything else. And let's just print this out and see what we can see. So 20 plus five equals addition, right? And then let's save this and run what d plus five equals 25. Yeah, I could have told you that one, but once again, this is, this is the easy step. Write addition. Not very complicated, but still very useful. Of course, you can also do this with variables, right? So 20 could be a variable. So it could be, you know, at one is equal to 20. And then we can do this one for example. And this, of course works just the same. 20 plus five equals 25. Because in the variable at 120 was written into it, right? The next thing, of course, would be subtraction. Now subtraction is simply as easy as addition. It is simply, let's say functional 23 minus three. Now, the first thing you're going to think about, wait a second, but that would be less than 0. And of course that is less than 0 because we can also have negative numbers, right? So this one would be negative seven in this case. So in sum, satisfy subtraction. Actually negative seven is written in them. And that works totally fine. And you can work with the negative numbers just as you do with positive numbers. That just works. So luminous works that out on its own. Then of course, multiplication. One thing that's always interesting, so let's say a multi is equal to, let's say five times 40. And let's print that out as well. So the Times is simply going to be a star. You're right. And let's write that together again. That's already is multi Diego. And let's print that out. And that is of course, once again, five times 40 is equal to 200. I'm sure that that is correct, of course, correct. Right. And then the last thing that you've probably already heard of, that's of course division, also not crazy. Division. Let's do something like 20 divided by five right now. So this would be 20 divided by five equals division. And this is of course simply for, right. But what happens, for example, if we have something that doesn't evenly go in there, what happens then? Well, we're going to see that's actually going to be 6.6666 something because the because three doesn't go evenly to 20, we're actually going to get a, the will float representation of the division there. Which is very interesting because when you, if you come from different languages, then you would actually expect this to simply be a six. So usually it just cuts off everything else, or seven depending on what language, but usually it would be a whole number, so integer instead of a number with a decimal point and then stuff after it. There's also something very interesting that's comes after division, which is the modal or the remainder operator. This is usually used in things like cryptography. Now this is of course, just one of the examples where this actually can be used. But in our case, what it can be used for very effectively is, for example, for, well, evaluating random numbers. We're evaluating whether or not a number is divisible by something, right? So if we say 20 and then we make this percentage sign, that's a 6 first. Then we're going to have 2020 percentage six. So this is present. The sand percentage sign is the remainder operator. And then we're gonna do remainder. And this is going to come out to. Now, the first thing they're gonna say is how is it to, well, the idea here is that how often does you actually divide it? So you'd say 20 divided by six. Well that doesn't really work. The closest number to that is, is 18. And then you say, well, 20 minus 18 and the remainder is two. So the remainder is very useful. For example, if we say divided by a. So if you say remainder two, and this is actually going to be a 0 because there is no remainder, right? 20 can be evenly divided by two. And this is what I say. This what I said. If you want to look for a even number so they can see 21 would be a one. So you can very easily just ask, hey, is this equal to 0 or is it not equal to 0? And then, you know, if a certain number is divisible by two or is even, in that case, there is one more thing and that is going to be increment and decrement. Now what does that mean? Well, that basically means adding by one or subtracting by one. And of course, you might say, well, let's just add by one year. That's easy enough. But there are some things. In some other languages, you could use something like this number plus, plus, and then usually you also have a semicolon, but in this case we don't need this number plus, plus what is that do? Well, this would actually just increment or plus one, this number. Now as you can see, this is actually an arrow. This doesn't work because this is not supported in Lua, right? So number one doesn't work and also numbered 00 doesn't work either. So this would be the decrement. However, what does work is number plus equals one, right? So this simply takes whatever is written in number and adds whatever is written in here and writes it back into number. So after this line, number is now six, we can also do number minus equals one. And then of course, number now equals five again after this line. And this is actually something that was added in Lua you. So this is not supported in the Lua 5.1 version, which roadblocks is actually based on. So this is something they added on their own. Very useful to actually have this be because this is just an easier way to write this. Yeah, so those are some of the basic math operations. And as you well know, within mathematics, as soon as you have those very basic things that you can use the basic operations, then you can, all of a sudden you get really powerful. And yet we're going to build up some more things that we can do with Lou up. And with each lecture that you're going to build up, you're going to build up tools that you can then use in order to solve problems for the world, for programming a robot scheme, right? So this was it with the math operations. I hope that it was useful to you if there are any questions as always, feel free to ask. And yeah. 5. (Lua) Relational & Logical Operations: All right, welcome back to the lower introduction. And in this lecture we're gonna talk about relational and logical operators. And relational operators and what are logical operators? Well, first of all, I've listed the relational operators here. And they are smaller than, bigger than smaller or bigger or equals, equals and doesn't equal or not. And those operators produce a Boolean value, right? So they produce either a true or a false. So this, these comparisons or relational operators make a statement of either true or false. Which also makes sense, right? There's either something is bigger or smaller than somebody else or not, right? So let's think for example, let's make a test variable right here. Let's say, well, three is smaller than 20. Well, of course this is true because three indeed is smaller than 20. And we can simply print this out, saying, is three smaller than, smaller than 20, for example. And then we're going to print out the test and let's see what happens. And of course, is three smaller than 20 equals true. So this is true. This statement here is true. Then we can for example, say test is equal to 20, is bigger than 200, which of course is false. And then we're just going to quickly copy this. So I'm marking this. I'm pressing Control C and then control V to paste it in. And then we're going to see 20 is bigger than 200. And let's print out has, once again. Of course this is false, right? So those are relational operators were also comparison operators because you can compare things with each other. Now this case we compared numbers, but we can also compare strings, for example. So we can have string one, that's hello, and then string, string to, that's also hello. So this could be, for example, two names that we want to compare. And then the comparison is equal to string one equals, equals string to. This operator actually asks, is, is not an assignment operator as this one is right. With a single equal sign, we actually, we actually assign whatever value we've written on the right to the left. And in this case, what we're actually gonna do is we actually compare these two and if they are the same, this is true. So let's just print just comparison. And it is in fact true because hello and hello are of course the same. Now this is different. So hello one for example. And this is false, right? Because they are no longer, they no longer have the same value. But we'll keep it like this and then write in now to the logical operators. So these are all, well, a single statements. And now we can also chain those statements together. So there are three logical operators, and, or and not. And let's just look at a, an example. So we could have comparison, which is of course a Boolean value, right? So this compares the two strings together. And then we can say well and true. Okay, how did, how does this work or does this mean right now? Well, we're actually looking at one Boolean value on this side. And we're looking at another boolean value on this side. And depending on what logical operator we use, it depends on what comes out. So in this case, of course, we have true and true, right? Because this is true and true is always, in this case true. You can also think about this as 11, right? Because true could be expressed as a one and false could be expressed as a 0. And if we then print out x is x, i guess. And then this would be true. Because the relational operator, and if this is true, end, this is true, then the entire statement is true. So we can also put parentheses around the statement to make it more clear that this is a statement. And these are the components. So this is nothing more than, let's say, addition in a way, right? But this is basically the logical and operator. Now to illustrate this a little bit further, I'm actually gonna do this with ones and zeros instead of true and false because it actually gets a little complicated if you do this with true and false. So one equals one, well that everyone would agree that this is of course true rate one is equal to one. And then we can ask what end 0 is equal to 0? And this was also true. So this is a true, true and true. And this would then equal true. And this is with the end operator, right? Once again. Now we can also say, well, for example, one is not equal to 0. That is also true because one is not equal to 0. So this entire statement is true. And then we sent or 0 equals one. And now this is of course false, right? So we can see here this is true or false. And this is equal to true. Why is this equal to true? This is the OR operator that we've used in this case, and the OR operator. So the entire statement of the OR operator is true. If either one of those is true or both are true. And in this case, of course, the first part of this is true. Therefore, the entire statement is true. And last but not least, we have the not operator. And this simply negates or switches a true to a false or a folds to a truth. So we can say not x. And in this case, it would simply switch the x, which was true before 2-way faults. In this case you, right? So those are the relational and logical operators. It's sometimes can be a little bit hard to get your head around. So if there are any questions, feel free to ask and I'll be sure to respond. And yeah. 6. (Lua) If and Else Statements: All right, welcome back to the Lua introduction l. In this lecture, we're going to talk about if and else statements. Now, we've seen in the last lecture that we can take Boolean values and both compare different variable types and get boolean values out of that. And then we can take Boolean values and then we can chain them together with the logical operators. And now, what we're going to see is how we can use this in order to change the program flow. So everything we've seen before is that everything that happened was the program started at the top of the script and just ran down and executed each line, well, one after the other. Now we can actually put forks in the road so to speak and say, well, if a certain thing happens, then execute this. If that doesn't happen, then execute that. And this is what we are going to look at. First is the if statement. And for that we just typed if and then a boolean expression. So we can either write, for example, good or we can write a Boolean expression. First of all, we're going to write a Boolean expression with x is bigger than y. Now, as we can see up here, X is a 100 and y is 1000. So this is actually false. After the boolean expression we want to write then. And then we'll hit Enter. And then this end here is going to be generated automatically. And everything inside of here, including the indent, is what happens inside. If this is true. Right? Now in this case, we know that this is not true, but we're going to write in here, print x is bigger than y. And of course, if we run this, nothing happens, right? And that's actually great because that's what we wanted to see. Because x is not bigger than y. But we can add something else. And that is exactly the keyword that we want to use, and that is L. So if we go back here and write else, and then everything that happens now here in between the cells and the end statement. That happens if this is not the case. So this happens if this is true, and everything here happens if this is false. So here we can write in print x is not bigger, then Y. And if we run this, we're going to see this actually gets printed out because this one was false. And so we actually go in here. But we can also do this. Like I said, instead of using the relational operator of equal bigger, we can also use just a normal Boolean. So for example, is good course and this is actually also being suggested here. We can just hit Tab or Enter to auto-complete this. And then we can say then, and then let's say for example, yap. It's a pretty good course. And this is one way to write it, right? So we can just write the Boolean expression. We can also write it like this. So this is if it's good, course equals, equals true, then the printout, for example, still really good. For example, at this is both correct. So we can either just put the boolean variable in there or we can explicitly state, hey, is this equal to true? Both of those work, this has, this comes down to style really, and what you prefer. If you prefer this one, then use this one if you prefer this way of writing if statements, take this one. But it's good to stick with one or one of the other. And then stick with this everywhere you write code. I personally like this will more. But like I said, some people like the explicit, least stated, hey, I want to know if this is true or not. But that's just it's basically exactly the same thing, just written a little differently. And you will find that sometimes with scripting and programming, that there are certain things that you can do where you have multiple ways of doing it or it comes down to simply using away and sticking with it. But yeah, that's just a short little thing there and then there's one more thing. And that is, for example, well let's say we had that extra, that's a 100. And let's say, well, let's matter, may be the axis a, a test rating or a test score. And if it's smaller than 50, well then we're going to print out, say fail, because, well, you failed if it's less than 50. And then we wanna say, well, and now we want to look if it's between 5000 and then went to a 100, we actually want to print out a special meshes message. And how do we do that? Well, instead of just doing a else, we can also do Else, if so, just written together as one word. And the else if one actually expects another if statement after it. So in this case, we would want it to be x is bigger or equal to 50, right? So it's at least 50 or bigger. And X should be smaller than a 100. And then what we want to have happen is we want to print out, for example, passed. And then here we have another else statement. Now this else statement actually belongs to this if statement. This if statement here is this else daimon blocks there. So that's basically how this works. And now here in this else, this is now being run. So let's say here, print passed with honest, let say for example, something like that. Then what happens is if x is smaller than 50, this is going to be printed up. If x is between 5099 in this case or smaller than a 100, then pass gets printed out. And if it is exactly a 100 or bigger than the skin gets printed out. Let's see if that works. And of course we pass with on us as we all should very well. And it, this was basically already the introduction to the if and else statements, very, very powerful and a basic building block for programming, but a very useful one. However, if there are any questions, you can always feel free to ask. And yeah. 7. (Lua) Local Variables): All right, welcome back to the Lua introduction. And in this lecture we're gonna talk about local variables. So this is just a short lecture to explain what local variables are. So what we've seen before was variables were simply written by the name than an equal sign and then the value that is assigned to that variable. However, what we actually want to do usually is we want to write local in front of it. And this is another key word in Lua. And what that does basically is it limits the scope where this variable is accessible. So let's just make an example. So in this case, of course, we can just print out what? This simply works totally fine, right? So we're just gonna print out too easy enough, right? That works because right now we're in the same script. That all works if we're, for example, in an if statement. So let's say what is bigger than one. Then we want an inside of here, we actually have another local variable called x, and that's going to be a 100. We're gonna print that out, right? So now what we expect is two and then in the next line we're going to print out 100. This is exactly what happens, of course. And now we say I actually, you know, after the if statement we want to change x. We're going to print x out again. We're actually going to get an arrow because in this case, x is limited to the scope of the if statement. And as soon as the scope ends, so as soon as the end hits, the scope of the if statement ends as well, and this variable is gone. Now, it is advised to always use local for every variable that we use. If we don't use it anywhere else. So make every variable local. And then maybe there will be some times where we essentially say this time we actually wanted to global. So usually global, normal variable like this is a global by default. And we actually have to specify that as local. Advice, always put local infinite variables. And from this going onward, every variable we're gonna use is going to be local. And that is basically all that there is to it. We're just going to comment this out to get rid of the Arab. And yet this is the very basic introduction to local variables. It's very important that you use this and gap if there are any questions, feel free to ask. And yeah. 8. (Lua) String Operations: All right, welcome back to the loo introduction. And in this lecture we're gonna talk about string operations. So what kind of things we can do with strings? And the first thing we're gonna do is create a new string variable. This is of course, once again, going to be a local variable. Keep that in mind. And this is going to say hello. This is me saying hello, right? Like that. And we can just print this out. We've seen this already, right? Just writing Print and then in the parentheses using the test variable that we've created. And of course it's going to print out hello. This is me saying hello, rate. Now, what type of things are there that we can do? Well, the first thing that you might want to know when you have a string is how long is that string? And we can actually ask that. So length of the spring is going to be simply hashtag and then the name of the variable. So hashtag test. And then this prints out length of the string is 30. And it's as simple as that. That's the length of the string. So that's very, that can be very useful to know. If you, for example, want to maybe go through each of the members of each of the single characters of the string as an example. Now, there are also some other things that we can do. And if we type in string, this is actually also something that gets a year suggested for us. So if you use those string is a spinning turns blue, and then we could do a dot. And here we find a bunch of suggestions that we can use. Those are functions that we can use to basically change springs and operate on strings. Another great thing here is that there's always, for each of those functions, there is a short little summary of what it actually does. Unbelievable rate I've really advise you to, for some of the functions that we don't go through in this lecture, actually use this as a great resource. It's a great idea to simply look at the function, what it says and what it actually does. But the first thing that we're gonna do is we're going to use the G sub function. And inside of here we're going to write test. And what this does is, well, we can actually look what it does, right? So we can just write g sub and then assess returns a copy of s. So this is the first string that we're going to give him in which all the occurrences of the pattern have been replaced by replacement strings specified by ripple. So this is this one which can be a string, a table, or a function. What that means, we're just gonna ignore that right now so we can replace something with someone else. So let's just use g sub Test. And we want to replace, let's say we want to replace hello with Howdy. How about that? Like now we're going to Texas, I guess. And well, let's let's just see well, printer test, right? So what we would expect this Howdy, This is me saying how the read and what we have is hello. This is me saying hello. What happened here? Well, what happened here is. That this returns a copy, so it doesn't modify this variable here, it actually returns a copy. So what we can do is we can make a new local, new test of variable. Let's say, let's call a new test. And this equals whatever returns here. So in this case, we then say new test, print this out. Then it's going to print out Howdy, This is me saying how. So this is very important that there are some functions that modify the the variable you give it. So in this case test or there are some functions that don't modify it. This is one of those examples and I believe the string operations Dulles, ring. Functions all give a copy. And there are some other methods and other operations and functions that actually do modify this. Yeah. So there are some other functions that I want to show. So for example, maybe we want to search something inside of the string. So let's say we want to find, instead of this new test, what we want to find is this. So where does this begin? Inside of the string? And then let's say where is this? And then du finding. So that is going to return is, it's going to return the index at which the word that we give it starts. So this is basically just count this as well, right? So this would be 5678. This is the eighth letter in the string. And this is basically what this finding, the string dot Find function returns. And there are also two other things that I find kind of funny to show you. So for example, shouting, you can have a string not upper, which simply then makes everything uppercase. And then you can also have something we spring, which is going to be string lower. And that's simply returns a copy of the string in either completely uppercase or completely lower-case. Though is. It can actually be useful as well if you have, for example, user input. And you wanna make sure that it's uniform because maybe some people are going to, well, I mean, some people are going to rate maybe something with the first letter, uppercase and lowercase, or they're going to use these SpongeBob meme where everything is, something's uppercase and lowercase. You're never gonna know. So that's why this might actually be kind of important. Those are the basic string operations we're gonna go through. Like I said, you can also go through other ones that there are in the find when you just type in string. And then you can see some of those are going to make, some tomatoes are not yet in Mill makes sense because maybe some other basics we haven't yet covered, but we're going to cover in future lectures. Now, it's important to say that most of the stuff is also little trial and error, right? I always encourage you to just try out a few things and see what happens. Always think to yourself, well, I expect that this happens and then just do it. And if that doesn't happen, then think to yourself, well, That's really we're right in this work and then you tinker around a little bit and then hopefully does work and any like are now understand it. Because in the end, by doing, you're gonna learn way, way more than simply, well, typing off what I'm writing here. So you actually do have to go out and just try a few things out for yourself. That's always great. But like I've already said, I'm always here to help. So if there are any questions, you always always feel free to ask and I will be sure to respond. And yeah. 9. (Lua) Loops in Lua: All right, welcome back to the Lua introduction. And in this lecture we're gonna talk about a loops. Now what our loops? Basically, if we have a certain part of the code or the script that we want to execute multiple times after one another. Maybe with different would say, numbers associated with it. We can use loops for that. And it's basically a way of doing something over and over again without continuing to write this down. So we could imagine that maybe we want to print out numbers from ten to 0, let's say, or ten to one, um, and writing, you know, print not ten per nine and so on. That's just not very feasible, especially maybe we want to do that, you know, a 100 times in your code somewhere because we want to count down from ten to 0. And yeah, that's what loops are foreign. We're going to look at the first type of loop that is going to be a for loop. And a for loop basically works like this. First of all, we're going to write the for keyword. And then we're going to initialize the after it, a variable called i. That's just going to hold to, let's say one right now. And then we're going to say ten, and then we're gonna say one. And then we use the keyword do, hit enter and then an end is once again generated automatically and the indent as well. And here we're going to print I. Okay, what does this, what does this do? Well, let's just make a comment here. So the idea is that this loops starts at one. So it starts at this number that we have specified here, this i, then it ends at ten, okay? Because this number that we've specified, and it increases by one, and this is this number that we specified. So if we play this right now, or if we run this right now, what's going to happen is it's going to print out 12345, and so on until we hit ten. Let's do this. Let's hit Run. As you can see, if we make this bigger a little bit. There we go, 12345678910. Exactly how he imagined it. And you can of course modify this as well. So we can say, for example, a two here, right? Well, maybe not a 12-volt B2. And if we do this, then it's going to be 13579. Yeah, so this is the basic four loop. And as you can see here, you can also access this i inside of the loop. This AI is not accessible outside of the loop by the way. So this is automatically a local variable. That is why we don't need to write local and flooded. And so there is a, another type of loop, which is the while loop. And it is similar but also different. So let's say we have a local variable called z. And we can say, well, while x is smaller or equal to ten. So while this is true, right? We're gonna do something. And what we're gonna do is this. What's, whatever's written inside of this? While you're, and we're going to write out a printout, let's say something like while. So then we know where this comes from, an x. So we want to print out x. And then each time we go through this while loop, we're going to just increase x by one. And then in the end, maybe we're going to say, well, you know what, if x is equal to, let's say seven, right? Then we're going to break and put an n-tier. Now, this is just an inline if statement. Usually would look something like this. But we can also write it all on one line because in this case, we're not doing anything crazy in here. We're just calling the break keyword. And I'm going to quickly explain after we've seen what this does, what, what's going on here. So let's just run this and see what happens. So as you can see, when we go up here, while three, while for wildlife and wild six. So how does that work? Well, the idea is that we have a variable with x equals three. Now this variable is asked, here's asked basically as a Boolean statement. Hey, is smaller or equal to ten. If that is the case that everything inside of this while loop, your is, is executed and this is done as long as this is true. So if I were to, for example, get rid of this, this would run forever. So this is a, this would then be an infinite loop. It's highly advisable to try to avoid infinite loops because, well, they're just, it's good to not use infinite loops. Well, I mean, they can crash the program basically that is possible. So always make sure, especially when you use while loops, that there's some sort of exit criteria on. For example, this break here. We wouldn't need this break because as soon as X would be 11, this is no longer true. Then of course, we will exit the while loop. However, this is, let's say a premature exit with his break. Because we can use this break keyword inside of loops, either in the for loop or a while loop. And then we can, and this simply means, okay, we're going to break out of the loop, so we're immediately going to hit end and then we're going to continue. So those are loops for loops and while loops. And there is another type of loop, which is the repeat loop. Now it's, it's actually very similar to the while loop. We put in the word repeat and when we then hit, so actually the keyword until it gets generated. And let's say for example, we want to print x again. And here we actually increase x by two. And we say until x is bigger than 20. So this actually reads like a normal sentence almost right? Repeat whatever is in here until this, right? So let's see what happens and exactly what you probably would expect. So 791113151719 gets printed out. Now we start at seven because remember, we have exit this while loop when x was seven. Therefore we print out seven. We have to, so then it's nine, and so on and so forth until x is bigger than 20. And then this loop gets broken and we are we continue with the rest of the program basically. Yeah. And that is all with loops. So they are really useful and they can we really powerful as well? And going forward we're gonna see a lot of uses for them in the future. But for now that was it. If there are any questions, of course, feel free to ask and I'll be short respond. And yeah. 10. (Lua) Tables in Lua: All right, welcome back to the Luan introduction. And in this lecture we're gonna talk about tables. Now I'm not talking about the tables that you sit at. My actually talking about the tables that we put in some data. And if any of you have may be programmed in another language. This is very similar to arrays, let's say. However, they have a unique twist on them. So let's just make a new table, which we're gonna call days. And we're just going to put in, so how to initialize this is basically with a, with these curly brackets. And then inside we're gonna write Monday because that is the day. And then we have Tuesday and we're going to have Wednesday. And let's all sprints Thursday and Friday. Why not? They go. So every weekday right now is in there. And you can just put in, you separate each element with a hammer, your n. Yeah, and what we're gonna do is let's just see what happens if we print this right. So print days and see what comes out of this. Well, a whole bunch of jumbled mess because we actually have to specify, okay, what do we want? So let's just put in a day for the sake of argument here and then let's say days. Now how do we access each of these members? Well, we take these these brackets here and inside of them we put basically the index of whatever we want. So we put in a one and then it's going to print out Monday. And let's just do this. And as you can see, it a Monday. Now for all of you who have programmed another language, yes, the index starts at one instead of a 0 because this is how Lua works. Louis index, indices and index starts at one. It's very important if you don't know what that means, just be sure to know. This is basically the first element, the second element. And this is how you can, Excellent, right? So if we put in a three, then we would expect Wednesday to come out. And of course, wednesday SP printed out. That's great. So that's great. But what else can we do? Well, we can actually have a special type of four-loop or of these tables. And I'm going to quickly write this out and explain what happens here. So in this loop, we can simply go through each of the elements. And then we can, for example, say something like value and then let them. So here the idea is that we, these are basically key value pairs, right? So we always have a key which is just our index at this moment in time. So the key is just a, give me the first element and then he, and then the value is whatever is written in here, in this case a string containing Monday. But in if we have a three, then we get returned the string containing Wednesday. And in this case we're just going through each of these pairs and printing out the value. Let's just run through this and as you can see, for example, we're just going to get. Monday, Tuesday, Wednesday, Thursday, and Friday. Now, the great thing about that is that this, if we add another day, for example, then this just works automatically. It's also got the camera out of there. And now maybe we want to add in a new date. So let's just do, do that. Table dot insert is the function that needs to be cooled. Then we pass it the table, and then we pass it, where is this supposed to go? So this is going to go in number position six, and this is going to be Saturday. And then we're just going to copy this and we're gonna do a, another one. And this would be Sunday, not Sundays but Sunday, right? Now if run this, of course nothing really will change because this change only happens after the for loop. But this is a great opportunity to show you another for loop. And what we can do is compute the normal for-loop as we've seen right? Starting at one, and then using the same thing that we have done with the strings. So how can you get the length of the string? You just use the hashtag symbol and then write the name of the table in this case, right? And this will get you also the length of the table. And then if we increase this by one, we can actually just print out. And then we can say, let's see, weekday number. Number i is equal to days i, right? And in this case we can just print out each of these days. So well, actually it's not a weekdays, just day, let's say day number, the ego. And let's run this. As you can see, works like a charm, right? Day number one is Monday and so on until you get to on day number seven, which is Sunday. And yeah, so those are some basic things you can do with tables. There's also another thing that's very important, that the elements inside of a table have to be the same type, right? So it can have a ten here and a 2059 here. And I can have another table if I want to in there as well, that they don't have to be the same type. And that's very important. And also what we're going to also do is I can say, well, maybe I would a person and maybe, you know, the first name of that person is going to be John. And then the last name of that person is going to be smith, Right? And I wanna print out what's going on here. So let's print out person, right? And what are we going to print out? Well, how can we get this? Well, we can just say, well-meaning person run rate. So then we're gonna get drawn. And as you can see, that doesn't work. Interesting, isn't it? Why doesn't that work well? Because we've actually specified the key here. So what we need to do is we actually need to put in firstName here. And then it's going to work because this is now the key to getting devalued John. And as you can see, then John actually prints out. And there was a another even easier way to do this, and we can just specify this person1 variable person, and then we write a dot. And then as you can see, I can actually get both of those members just by using the dot operator here basically. So those are two ways of actually getting this. If you specify the key beforehand, right? So if we then run this person is John Smith, Right? And that is basically it with tables. So this might be a little bit confusing. This is a definitely a little bit more involved. I definitely advise you to play around with this a little bit. Just make a table, look at it a little bit. Put in a few different values, assign it of you different, different key and value pairs, and just play around with that a little bit. I'm of course always here to ask and to answer any questions if you have them. And yeah. 11. (Lua) Functions in Lua: All right, welcome back to the loo introduction. And in this lecture, we're gonna talk about functions. Now, you've heard me say the word function before, because we've actually called some functions of different scripts before. However, now we're actually going to define our own function. And just for demonstration purposes, we're going to create a function that just adds two numbers together. So we're just going to call this, or we're just going to write the function keyword. And then the name of the function, which is going to be some. And then open parentheses. And it's going to immediately generate close parentheses as well. And inside of here, you actually write the parameters. Now, perameters are the things that we've seen already. So let's just put in, say Let's just let it generate right now. And let's just do the print. So we've seen that print is also a function and we can pass it in some values. For example, hey, right? And if we do that, then hey gets printed out. And hey, in this case is a parameter that the print function uses. Internally, we don't know how the print function looks in this case, but we know what it does. And in this case we can do the same thing. So in, inside of here, we can actually say, okay, what are the parameters, parameters of a sum? And we can say num1 and num2 for example. Now, this can have basically as many parameters as we want. In our case right now too is enough because we only want to sum two numbers together. And then what happens? Well, if we, for example, do num num to, that would definitely add them together. But how do we, I mean, what is this? Sum equals this, or what do we need to know? And we need to do is you need to use another keyword and that is returned. So return basically is the keyword that specifies, okay, whatever is written here in this, after this returning is actually what we're going to return when this function is called, right? So when we use something like let's say some function, and then we're going to do some. And then we're just gonna say, let's say 310, right? So what we would expect here is to be printed out some function and then 13, right? Let's just look at this, the case and yes, it is the case, some function 13. That's pretty good. So let's take a look at how this works. So number one is three num two, because that's what we've specified here with the Skoll. And then it's going to return whatever the addition of those two is exactly 13, which is exactly what we want. This is an example of a function. And the great thing about functions as well as something that we can use and that is functions as variables. And I might say that's a little weird. Well, let's just make a local x and make it equal to some k. That's just the name of the function, but without the parenthesis and without any values. And then we can do is we can actually say x is a function and a variable. And a variable. What's remark? And let's see if that actually works. So we can now call x and per parenthesis in there and say, I don't know something like 25. And if that now yields 25, then we know, okay, this some function, actually it was cold. And of course that works. So you can put functions into variables as well and then call these variables. This can be really useful because that also means that you can perhaps pass a function in through a parameter and use it there as well. This can be really useful for all sorts of things that are way, way beyond this video right now and are more complex. Well, which we're probably going to see in future lectures. And this is a rough overview of functions and how they work, how, what their functionality is, let say. And yeah, that was basically it. If there are any questions or if something was unclear, of course, feel free to ask and I'll be short response. And if you found anything helpful so far, I would really appreciate a review or a an a rating. And yeah, that was it for now. And yeah. 12. (Lua) Coroutines in Lua: All right, welcome back to the loo introduction. And in this lecture we're gonna talk about co routines. Now, this is a topic that's a little bit more advanced, I would say. However, the main thing in this lecture is that you have heard about it, that you know a few basic things about it. And that's going to be the most important thing. Because when we actually use them going forward, maybe in the roadblocks part, then you're not going to be confused to what routines are. So this doesn't need to be complete understanding in this case. It's just a little short overview. Let's say that you've heard about it and that you see what they can do. So first of all, let's just start. So we're going to read a co-routine one and call this SEO. And how we create them is by typing in coroutine dot create. And then inside of here, we actually need to supply a function, as you can see as a parameter. And we're just gonna create a new function here. And then we're going to hit the enter button. And by doing this, we immediately generate the end for the function here. And then everything inside of here is now the function that we supplied. Now of course, we can also create a function above it and then give it that function. In this case, we're just gonna do it all, let's say inline. And just for demonstration purposes, we're going to do a, a short little for-loop in here. We're going to say, or let's do 28 and then one, do this. So we're just gonna go through from one to eight in one steps and we're just going to print out, let's say coal routine. And then i so we're just gonna print out whatever number we are at in the for loop. And then we're also going to print out as the first thing that's going to be interesting. And that is going to be co-routine dot status. And then we pass the co-routine to know what the status of this co-routine is. So that's the first step we're gonna do. And let's run this and see what happens. Now as you can see, nothing happens because we actually have to call this co-routine. So we have to, it's, it's similar to a function, but it's also different. And we're gonna see why. Because the first thing that we are going to look at is we're going to look at the co, routine status just for the moment. So we're gonna say cool routine and dot status, a another function that we can call and give it a core team. And then we're going to print out the status of that. And we will see that this status is suspended at this moment in time. It's very important that there are three states. A co-routine can be an starts in some suspended there you and it can also be running and it can be dead. That they go. So those are the 33 status. Three states, three statuses. A co-routine can be suspended running, or that it can only ever be in one of them. And depending on what happens, the coroutine is in that state now it starts in suspended. And how can we make it run? Let's say we can do this by calling co-routine dot resume. And then once again giving it the coroutine. So the CEO variable we have defined here. And if we do this, then the coroutine real run. And it's going to print out co-routine, one co-routine to, and so on. And each time with we would expect with the status of running. And then in the end it would be dead. But we won't see that. This is why we're going to copy this, right? Once again, selecting this Control C and then control V to paste it afterwards. So we're gonna see that afterwards. After this resume method, it should say dead. Let's see if that happens. And indeed, this seems to be working. So we have, let's make this a little bit bigger. So first it's suspended. And then we go through the first right here, this one, this print, this is co-routine one. And then it says, hey, I am running, this coroutine is running, and then we're gonna print out 23 and so on and so forth until we're at the last one. And in the coroutine is done. And then we're gonna print out dead. Because then the coroutine is that. Ok? Now, this is all pretty cool, but what else is there? So there's a little like a, something that's kinda cool as well. So what you can do is, let's say we have an if statement in here where we lose like well, if i is equal to five, then what we wanna do is we actually want to co-routine that yields. Now, yield is a, you can think of that similar to, let's say the, the brakes for a for loop. It's a little bit different. Of course there are way more nuances here, but you can think of that as, OK, if a yield is cold, then the co-routine stops and is suspended again. So that's very important. So if we run this, the for loop is going to run through one to five. And then it's going to hit this courting dot yield. And what's going to happen then is we're going to have the status down here is going to be suspended again. Instead of running. As you can see, we start suspended and then we start coroutine one running and so on and so forth. Right? Okay? Now the first question that comes to mind is, well, what happens if we run this again, right? So resume CO, What happens then? We'll, we're just going to start again, right? Well, not quite. We actually restart where we left off, right? So we stopped at i equals five, um, and, or, yes, we start at i equals five. And then as soon as the for loop hits again, we're actually start at six this time because the co-routine remembers where it stopped. So in this case, it's yes, it's suspended. Its suspended. But as you can also think of it as Stop, right? You can always think of it as stopped. But yes. So this is a, an interesting way to start and stop a function midway through. And there is one more thing that is interesting for a co-routine to note. And that is that when we can actually pass in this function parameters, let's say we pass in a as a perimeter. And what's gonna happen is we're going to set this to a, so whatever parameter, parameter we're going to pass the Coubertin, that's actually going to be our starting value for i. Ok. And let's think about then, for example, saying, well actually I want to start at three. So we can do this by when we call the co-routine dot resume function. We can actually just add another parameter. And as you can see the, we actually have a nice hidden. So we can have very int val and you can have, well basically as many as you want. So you can if as many parameters in the function as you please. And yeah, let's just run this. And then as you can see, if we go up here, we actually start at co-routine three. So we're going to start at a3 and not the one because we've supplied the three here. And we can also get something out of this. So when we call the resume function, this can also return something, right? So this can return something and we're going to print this out. And what it returns is whatever we give the yield down here. So let's just give the yield I. Now this should be a five then, so we should print out a five-year, because whenever the coroutine yield is called, I0 is going to be five, right? Let's try this. And as you can see, true and five, that's great. So what's important to note is the true here just denotes that there were no errors in the co routine. And then the five of course, is what we have written out side of it with this i here. So for example, if we then, if we could also say, you know, something, something, for example, and then if we run this, then it's going to print out true as once again, there were no arrows and then something, something. Yeah. So this is a, like I said, a brief overview of the of cool routines. It's gonna get a weight clearer once we actually use them in some of the examples for roadblocks itself. I just wanted to show you a little bit of the idea around it and that you've heard about it. That's, it's, it's sometimes very important to her hero about those concepts. And then, you know, later down the line when we actually use them, I'm going to go into them in a little bit more detail or I'm going to explain again because they can be a little bit more complicated, right? Yeah, but that is it for this lecture, right? If there are any questions, of course, feel free to ask. And yeah. 13. (Lua) The Math Library in Lua: All right, welcome back to the Lula introduction. And in this lecture we're gonna talk about the math library. Now, we already talked about math operations. So we talked about adding, subtracting, and so on. But now we're going to talk about the math library. So those are functions that can help us do some mathematics. So first of all, let's think about something like this. We can print out minus five, right? That's, I mean that's totally fine. And when we print this out, minus five appears here down in the output. This is no mystery. But what if we actually don't want the, the negative sign in front of it, what we actually want is we want the absolute value. Well, we can use this math and then we can hit a dot to see the functions in it. And as you can see, there are a whole bunch of functions in here. And this Math.abs, So this is the absolute value of something. So if we put it in the negative five, then we're actually going to get a normal five because this is absolute value. Maybe you've heard of that before in math. That is a, it can be useful sometimes because maybe we don't want to know necessarily whether or not something is negative. We only want to know what the value is. And this is something the absolute value could be used for. The next thing is going to be rounding up and down. Now, the way we can do this is by using math dot seal. So seal, basically a shortening for sealing. And this rounds up to the next whole number. Very important, right? So when this rounds up to the next whole number, we would imagine a, an 11 to be printed out. And an 11 is printed up, that's pretty good. And next thing very similar to this is going to be Math.floor. And let's just put in the same number. And this, now, this now rounds down to the next whole number, right? So this one we would then expect to be a ten. Let's run this and as we can see, 11, and then afterwards 810. That's great. So those are seal and floor. Almost can also be really useful for, well, for a little bit of mathematics. Now, two functions that are incredibly useful and they actually can be actually used a lot is the min function. So let's just put in 520 for example. And this returns, simply returns the smallest number given as parameter. That's it. In this case, we have given it a 520 and this is going to return a five of them that you go. And the same thing. And we're just going to copy this one time. And we're going to write instead of minimum, we're going to write max because of course, there's also a max function and this is going to be the biggest number that, right? So this is going to return 20 landscapes. Yeah, it would go, right? Also, just some random things. Let's say maybe you want to use PI ever, you can just use math.pi instead of using our own pie. It's, it's quite accurate actually. It's more accurate than I could go for from my head. So that's pretty good. And then if you ever want to use the square root, you can use Math.sqrt square root. Let's save 25. So just, just, just going to be a five right here, right there are also some other ones which I'm not gonna go into. So there are some sine and cosine tan functions which you could use. Those are the trigonometric functions. We're not gonna go into those if you ever need them. They are, they are however, and however, the big one that we're going to look at is going to be the random function, math dot random. And this is going to be a really, really useful one. So this one returns a random number between 01. So let's see what happens here. As you can see, this is 0.04 and then a whole bunch of other stuff down there. Now the great thing about this random, when we just copy this, we can actually, you know, and this is the great thing. You can actually give it a lower and an upper bound. And this is incredibly powerful because we can actually say lower and upper bound and be given. So this is going to return a number between 0100. Both of those are inclusive. Let's see, 66. And then let's run again. I'm going to 64. And then we will have 211 more time for the measure 88 while they go. So those are some math library functions that can be really useful. And yeah, I think that one of the ones that is going to be used the most often probably is random simply because of the, the idea. When you are making a game, random numbers are your favorite, favorite thing to go to. As a quick note, once again, of course those are only pseudo random numbers. If you don't know what that means, it doesn't really matter. But you might have heard once or twice that computers can really do real randomness. And what happens here is that when we do a math dot random, as you can see, we actually give it a seed, right? We can give it a seed. And there you see it, that it sets a seat for the pseudo random number generator. So the idea is that when we set a seed, it's always going to produce the same numbers when we ask them to. So if we set the seed for a 100 for example, and we run this, we get 0.6442. That's a, that's a, that's a great random number by the way. And now if we run this again, it's the same because we have set the seed in the same. So you've might have seen this in other games you've maybe played Minecraft has a seating system, right? So if you put in the same seed, you're going to get the same world. And for example, I don't know the binding of Isaac has seeds and then it generates the same random game. And this is basically the idea here, is that when you give the same seed, the numbers, random numbers are always going to be the same. So the sequence is going to be the same, right? So if I now call this 80 more times, we'll AT numbers are going to be the same in the same configuration of the same sequence, right? That's also important to know that the random seed is something you can set. Usually it is already set on its own and you don't really need to worry about it in general, right? Right. So that was the math library. If there are any questions about it, of course, feel free to ask. And yeah. 14. (Roblox) Roblox Studio Explained: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about a roadblock studio and some functionalities and basically a short overview of how the studio works. So first things first, we're gonna create a new project here. And we're gonna do this by just selecting the base plate again. And this should be similar looking to this. If this is your first time opening roadblocks studio, there might be some other windows here. And we're going to look at that part, you know, piece by piece. So first things first, as you can see, this really big window here. This is the base plate. And the way we can move around in this is when we right-click the mouse, we can turn the camera around. We can zoom in and out with the mouse wheel. And also if we press the mouse wheel, we can sort of walk along somewhat like this. We can also use WAS AND D to move around. If we hold shift, we move slowly. And if we let go of shift and we move fast, this is a basic movement here in side of the camera view. Let's say. We also have this cube appear in the top rate where we can get sort of defined views here. So back, right, front, left. We can look at that as well. But for now, our basic movement tools are gonna be fine. Now, if we have this select tool here, selected, right? So we have a normal one than we can actually with a left-click draw and select things. Now, right now, we don't have anything in here in our workspace. But this is going to change. We're gonna look at this. But first of all, I would say, put your eyes up here to this part of the robot studio. So we have a few tabs, homo, model, test, View, and plug-ins. Now for ourselves, view right now is interesting because in here we can actually turn on and off or certain windows inside of robots to do so, for example, hey, I really want the toolbox and then we can have the toolbox scene and we can either disable it by clicking it here again or clicking the X. Also disables that. We can look at the game Explorer. Now in this case, there is nothing in there because we don't have the game published yet. But for example, an Object Explorer just gives you every object that there is, that there is. You can look at the command bar down here. We have some other things that might come that can be interesting. Subscript forms, for example, there's something there when we can look at the performance of certain scripts. But right now, all we really care about is the base plate. So this, this camera window, the output, the properties, and if the Explorer, those are like the main four windows that we need. And if we have those, then everything is fine. And the rest right now really doesn't concern us. We're going to build up on that. Now when we go back to home, we have multiple things. So as you can see, we have the Select tool, a move to scale and rotate tool. Now we're going to look at those after we've added a new part. And how can we add a new part? Well, skipping over a few things so the terrain editor is not going to concern us right now. And the toolbox is what we've just opened there. So if we can also open the toolbox here, but we don't need that right now. What we want to have is a part. And if we simply click this part, as you can see, the tooltip already says plays a part in the workspace. So if click this, there we go. A part has been placed inside of our workspace. And as you can see to the right here in the Explorer, this part is below workspace, and it's right here. Now we can see the properties here and we're gonna go through properties in another lecture. So we're going to look at those in detail in another lecture. But right now, we only want to look at what can we do with this part? Well, first of all, this is now not selected anymore, so we don't see any properties. We can select it by either clicking on it. And then we have a selected or we can of course drag and then select even multiple ones. In this case, we only have the one part. Now, when we switch to different tools appear, we can, for example, switch to the Move tool and then we're going to see something like this. And if we hover over these arrows, as you can see, they get a little bit bigger. And then we can, if we left-click and then drag it, you can actually drag it along this axis and change its position of the part. And we can also scale it. So scaling is pretty much exactly the same along a certain dimension. If we hit shift while we scale, we can actually scale in all directions simultaneously. And yeah, and then rotating should be self explanatory. We can simply rotate around a certain axes and a certain angle. Yeah, and that is really much the like the tools up here. And also important when we have this handle, we can actually left-click and keep left clicking and then we can also move this around. This is a little less accurate, I would say, than the Move tool. When we press Control Z for the four windows, it should be Command Z for the Mac. Then we can go back and command y or control y is going to be putting a going, redoing it. But there's also those two, undoing and redoing. Maybe if you've worked with some other program, you have seen that before. Right? So this part right now. As I've said, those are some of the things that we can do. Now, there are also other things. For example, we see here, when we go to model, we can actually see a whole bunch of stuff that we could do in theory. And when we move it, we can say how, how much we want to move it by, right? So the, the positioning, or I would say the distances here are. Measured in studs, right? And the rotation is, can also be locked now we can also unlock it and then rotate this thing, however, little one. So now it's sort of a smooth rotation. Usually it makes sense to sort of snap it to the grid simply because then you can build a little nicer and not have, you know, like weird angles, let's say. So if I rotate it by 1.258 degrees, that's going to be a little weird, especially if I have multiple ones next to each other, it's going to look weird. So we could change the material as you can see here. So for example, we could make this metal, it's going to change its appearance a little bit. Slate. We actually going to get a texture here where let's say marble, also kinda nice. So this is a possible material. We're going to look into that later as well. And then we can also change the color. So those are brick colors. We'll look at those in a later lecture in even more detail. For now, it's really good. We can just change the color of this part in this case, let's say for example yellow. And now we also have a surface possibility here, but we're not going to look at that at this moment in time. I just want to tell you that these are some of the things that we can do immediately inside of roadblock studio. And of course later down the line, we are going to learn how to use them in scripts and how we can change them in scrubs, right? So how can, how we can change properties in scripts or we can change the part, the materials, the color of the surface, and all of that. And yeah, those are some basic, let's say movements and controls that are in robots studio. What I'd definitely advise is just playing around a little bit, especially with a camera controls, right right-clicking to move the camera, middle mouse to move around or W, a, S and D. And yeah, and that's and maybe even moving around the pieces a little bit, you know, making them a little bit bigger. Rotating them. Just so you get a little bit of a feel of how this works, because this is something that we're going to do quite a lot. One last trick let's say, or one last thing that you can do is when you have a piece selected, you can press control C to copy it, and then control V to paste it in again. On Mac. Once again, this should be command C and Command V, and this simply then copies the piece. Now what is important is that they will have the same name, which going forward when we use scripts to, let's say, change up our parts. This can lead to conflicts, but we're going to see this later when we use our scripts. And yeah, so this is a basic overview, let's say over the most basic of functionality of roadblocks studio, of course there is way, way, way more. And going forward, we're going to learn even more things about both the program and scripting. But this as a first overview. If there are any questions, of course, feel free to ask. And yeah. 15. (Roblox) Reference a Game Object: All right, welcome back to the roadblocks course. And in this lecture, we're gonna talk about how to reference a parts in side of our workspace here. So first things first, we're gonna create a new script. Once again, inside of the servers Script service, just a normal script. And inside of it, what we're going to talk about is referencing game objects. That's what we're going to call it right now. Basically parts anything that's inside of the workspace. And how can we do this? Well, let's think about it like this. Let's say we want to get the base plate red. So this plate down here. How can we get this? Well, first of all, we're going to call make a new variable called local base plate. And we're gonna get this by typing First of all game. And then we can gain basically gets you to the part of the Explorer and then everything at the first level of the explores or everything right here is accessible. So for example, workspace where players or lighting. So everything in here is accessible through this. And so first of all, we're going to say workspace. And now everything in the workspace is accessible once again with the dot operator. And then we're going to say, well there's a base plate here. So let's just try base plate L. There is a base plate, and then we have the reference to the base plate right inside of this variable. Now, we could also think, wait a second, I have these parts. I create these parts last time. Can I reference dose? And yes, we can. So let's make a local my part equals to game workspace and then port. Now, however, we run into an issue. And that is we have two parts here. And we could say, OK, let's, it's not going to be an issue. Well, let's see. First of all, what we're gonna do is we can then change the properties of this part. Now this is going to be like We're gonna do this in depth even more. We're just going to take a, a property that is going to be easy. So transparency, and we're going to set the transparency to 0.5. So this is going to be half as transparent as it would be if it was not so 50% transparent. And let's just see what happens. So we have said, well, we want the workspace part, but we have two parts in here, named part. How does that work? Let's just see what happens if we play it. So if we play the game, there they are. And as you can see, one of the parts transparent and the other is not. Now if we go here, we can actually see that the first part is transparent and the second is not. So if you have multiple objects, parts, in this case inside of your workspace with the same name. It's always going to take the first the first part in this in this order basically. Now this is why I said that it's not a good idea to have them be named the same. I definitely advise you to always rename them. You can do this by pressing the F2 key word by right-clicking and choosing a rename. So we're just going to say my port one and the other one we're going to call my two. And all of a sudden we can say My part one, let say. And then let's also rename this variable right here. And yeah, so now inside of here we actually have my Part one and then we can also just run it. So then we concede immediately. And then my part one now has been turned transparent and the other one has not. And maybe we want to change this just for the sake of argument. And then the other one turns transparent. If we change what the my part refers to write. And so the idea here is that like I said, there are multiple things that we can do. So my Part one and then as you can see, those, let's say anchored archival, those are all properties of these parts. So if we look down here, for example, at port, we have behavior anchored, we have archival can collide, and all of those, all of those properties are accessible through our script. And we can, we can change them. Now, like I said later down the line, we are going to look at properties in its entirety and we're going to see all of them. But for now, let's just say that maybe what, something else we wanna do is we want to say, hey, you know what changed the color of the base plate. And we can just do this by doing something like this. So let's say we wanna make it green. We can just say base plate break color equals brick colored dot. Now this is a function very important. And then if we run this and all of a sudden, the base plate turns green red. So this is a way you can reference the objects inside of the workspace and even beyond the workspace. So this is basically how you reference all types of things inside of the game. Yeah, it is very important that it's, that you usually do may save them inside of a variable like this. You could imagine, of course, we could always write game dot workspace, my part, and then transparency and so on. I would advise to always make a local variable for it and reference it later. Yeah, that was it for this lecture. I hope that it was useful to you. If there are any questions, of course, always feel free to ask. And yeah. 16. (Roblox) Types of Scripts: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about the difference between a local scripts, normal scripts and A-module scripts. Now this is a bit of a more theoretical lecture. However, it is important. So looking back, we have always only created normal scripts. So we create a script that ran in the server script service. Scripts there of obviously run on the server. So they then are running for each client. The idea in roadblocks is that you have a server and people connect to that server. Now if you are a player, you are a client, right? And the server, of course, is simply the server. Now if things happen on the server, things are going to be seen. So if we create an object and that is created on the server, it seemed for every client, if we create something on the client side, it is only seen for that client. And this is something, for example, GUIs. So basically user interfaces, those are all done locally with local scripts. Because we're usually the server doesn't need to know about how the GUI looks like. The server may be only needs to know is this button pressed or this been pressed? And the server doesn't need to know about the layout would say how, how this looks or what Texas displayed or all of that doesn't, is not really necessary. Now, if we look at this, so inside of our service servers, we can only create scripts and multiple scripts and everything else is grayed out. This is because this is what is supposed to be created there. And let's just create a module script. So it immediately makes, creates a table here for us. And the idea for module scripts is those can be, like I said, in the service, service. They can also be created in the server storage. And the most important thing is so if they are in the server storage, they are not run. So they don't automatically run whatever is written in here. You know, a function's variables doesn't matter. This module scripts are basically used, so you can load them in other scripts. We have seen the math library. That's basically what you can think of as a module script. Just as a, as an example, this is very similar to that. So this is the idea of a module script. They are usually in server storage. Right now we have created one in server script service. It's basically the same thing. And a module script, it doesn't run code, it can only be loaded in other scripts. So that's very important to know. Also know important. You usually don't want to use local variables if you want to use them outside of this script, right? And we have seen before that we should always have local variables everywhere, basically. Well, the module script is one example where this doesn't apply to. Because if we want to use those variables or functions outside of the script, and of course they can't be local. And this is a, an example, just a, just a overview, let's say of a module script. We're going to see examples going forward. But just once again that you've heard it and you understand the difference at least a little bit. Now, the normal script, we can see here the referencing parts. We've seen this already. This is in service and this happens for everyone. So the server. And now there are also local scripts and they are basically used to change my ENT only objects. For example, of a player's camera could be changed. We could access that and look around. There are also other things that might be changed. So the backpack, the model of the player, of course, the GUI, that's the most important thing used for Lobel scripts. And yeah, so those are some of the ideas here. If we look into down here, the starter player, we can actually see that there are different types of scripts, character scripts and players groups. And if we were to plus there we can see local script. So here we could, for example, make a local script. As you can see, it also gives us an example of what happens. So a script that runs on the client's, not server's local script can only run when parented under one of the following. And then only on under backpack, the model that we use scripts or the replicated first service solos are where local scripts run. And like I said, they then only changes that happen in local scripts only happened for the client itself. That's sort of a brief overview of local scripts, module scripts, and normal scripts. When we go through the rest of the concepts, the basic concepts, and even go, going through making a game. Then what we're going to see is some application of these things. But it is important to have a foundation of this knowledge and to have heard it. This always one of the most important things. Even if maybe it's a little bit confusing at this moment in time. Once the application, and once we basically applied this, we're going to see that this is, this makes a lot of sense. That's the basic overview over local, normal and module scripts. Like I said, this serves only as a theory and an overview. And we're going to see going forward some application of that in the near future. Now, if there are any questions, of course, feel free to ask. I will be sure to respond to that. And yeah. 17. (Roblox) Properties Overview: All right, welcome back to the roadblocks course. And in this lecture, we're gonna talk about properties and we'll everything to do with properties and a short little overview over some specific properties. So first things first, we have already seen properties, you know, a few times come up. It's this little window down here at the right. It might be somewhere else for you, but if you have the layout of robots to you as I have, then it should be somewhere. If you don't see the Properties window somewhere, you can go up here to view and make sure that this is on. The properties here are on. And then you're gonna see it most likely down here to the right. And now it's important that the properties are empty except for when you have a certain part selected. And the first thing that we're going to look at is we're going to look at the properties of this part here. Now to do this, we're actually going to make this property window a little bit bigger. So I'm actually going to drag it up here. And then it's going to take up the entire space. And then we're also gonna make it a little bit bigger as well like this. Because right now we actually want to look into the properties themselves and not anything else. So when you have a port selected, we can actually see up here this is the property of a part and then the name of my part two. Now we can filter the properties. So for example, I'm looking for, I'm looking for anchor where it's anchored, and then I can give it in, type it in, and then there we go. Here is anchored under Behavior. And then when we deleted Again, we are back at the normal properties. View soap. As you can see, there are different types of properties. So I'm going to quickly put them all in. And as you can see now, we have four, well, let's say big sections and those can be opened or closed. And let's just open all of them. It's appearance, Data, behavior and apart. And some of them, some different types of objects share properties with other objects. But we're going to look into that soon. First of all, we're going to look into the properties of a part. Now, we have selected this part, and you can see it has a brick colour of new yellow. It does cast shadows. So this would be a Boolean. We're a true or false. And this we can, for example, just set to false and then it doesn't cause shadows anymore. We have the color. This is of course related to the brick colour of the brick color, of course, are predefined colors and the color than specifies this a little more. You can also hover over them and see that there are some examples given or a brief description given what it is at the materialist plastic. Now we've seen the material before very briefly up here at model in the roadblocks to you. We saw that we can change the material with this as well. But of course we can also go through the properties. And we could, for example, say, Well this is glass now and then little, little much. And then when we look at this, it sort of has a little bit of a reflection property to it. So the light reflects off of it a little bit differently than the plastic. And yeah, those are some materials. It is best to, first of all, play around with them a little bit. If you, for tough like a certain effect that you want. But right now we're just going to keep it at plastic. The reflectance is simply that how reflective the materials, and now it's completely reflective a one. So the scale goes from 0 to one. And now as you can see, it reflects the Skybox back. So does though clouds and all of them, of those are reflected back. Let's turn out off again. Now we've already seen the transparency before. So we can make a completely transparent or, you know, 50% transparent. And we've seen that in the referencing part right here. The transparency property that we've accessed via the script and set to 0.5, so 50%. Now those are some of the appearances. There are also data properties. Some of them you cannot change, right? So what's very important is this class name. As you can see, the string name of this instance most derived class. Now, this is basically a very complicated way of saying this is a part that's basically it. There's a mass that is defined than the name. This is the name that we've defined here in the Explorer. And the orientation is the rotation basically. So if we rotate this, lets say like this, then it's going to be 000. And if you rotate it like this, then it's going to be 0 and a negative 90 degrees in the y, and then 0 degrees in the z-axis. The parent is workspace. So if we go back to the Explorer, we can see, if we have this part selected, we can see OK, the next part that is sort of indented to the left is the workspace. And if we close the workspace, we can also see that all of the children of the workspace are also no longer visible and therefore, the parent of my part two is workspace. If we were to change this via a script or indeed here, then the location here in explorer would also change. So that's something to think about. The position can be changed with the move tool. Of course, we've seen that already. And it can of course be changed in side of a script as well. We're going to look at that in a later lecture in way more detail as well. The rotation velocity and the velocity itself we are not going to look at right now. This is also done in a later lecture. For an example. You can do with those then behavior. So anchored is a Boolean and there you can see, determines whether or not a physics acts upon the part. If true, part stays anchored in space, not moving regardless of any collision forces act upon it, it folds, the physics work normally. So right now we don't have either part anchored. If it is anchored, that is just going to float in the air. And basically Gravity is not going to be affecting this port. Now, then there is an archival. This simply is, as you can see, determines whether or not an instance can be saved when the game is closed, tends to save the game. So there are some things that are a little more advanced that are not really. Let's say neither force right now, but I'm still gonna go through can collide simply means that if there can be physic physics interaction with other parts, you have a collision group ID. This is really not all that interesting to us right now, are locked. Simply means that it cannot be changed. So as you can see, they're, determines whether a built, a building tools in gay men Studio can manipulate this part. If true, no editing as loud a folds editing as loud so we can lock this and then, for example, scripts cannot change this part. Massless simply means that it has no mass, right? And then we have something for the part. We can have some custom physical properties. If we check this, then we can actually open this up and change the density elasticity, elasticity weight of friction and the friction weight. Those are some physics constants that we could change for this part. That's really, I would say a little bit more advanced stuff. We don't need that right now, but it's important to see it. The root priority, also not important for us right now. Let's just ignore the root priority, really not of interest to us right now. The shape is simply the shape of course, and then the size is simply the size which we can also change by scaling this, right? Yeah, so those are basically the properties of a part. Now, what we're also going to look at, and we're going to make the small again. Oh, no, not quite. There we go. What's gonna happen is when I now, for example, select the terrain. As you can see, this has actually changed. So we have in, under appearance, we have water transparency, water wave, we have, we still have this, but we have different appearance properties here. If we select the base plate, I believe this is almost exactly the same, Yeah, but we also have surface and surface inputs. For example, as you can see, there are plenty of different properties here. And this is something that is, you need to think about because some different, different object types, so different down here in the, in the data placed class_name. So right now, the base plate actually is also a part in that sense, right? However, it is a certain type of part which also has the surface inputs and the surface as parameters. Different types of objects have different properties. This is why we can't go through everything, everything and every one of them I just wanted to show you the ones that are from part because we are going to go through a few of them in the coming lectures. And yeah, that, that is basically sort of an overview over the, the basic properties. And going forward we're going to look at some other ones as well, of course. But right now I think this is going to suffice. If there are any questions regarding properties, of course, feel free to ask and I'll be sure to respond. And yeah. 18. (Roblox) Built in Functions and The Object Browser: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about some built in functions. Now, we've seen a few bits already. However, now we're really going to start to, we're really going to add some tools were toolbox, let's say, so that we can actually create a game going forward. And one of those things are the built in functions. Now we've seen something similar with, in the lower part of this course where we had, for example, the math library, right? Where we had some math functions we could call, well, this is actually something totally different. It's not only different is similar, but it is something that is for row blocks only. So first of all, I have already prepared a script here built in functions and have already have the local part here in a variable. My part. And what we're gonna do is we're going to look at what functions we can call on this part. And to actually see, OK, what functions are there. We can go here up to view and have this object browser. Now if we click this and it's going to pop open the Object Browser. And then at the left here we can see every possible class that there is in sight of roadblocks. Now as you can see, there are a number of classes here, right? So of course we can't go through all of them at this moment in time. This is why we're going to look at the part of, at this moment. And we're going to see, okay, what can we do with the part? Now, the things that we've already seen, if we go, sorry, there we go. If we go back to the script and we say my apart dot, then we can see we have, as a suggestion here, all of these blue dots, those are the parameters that we've seen last lecture. And then we also have these, these lightning bolts. We've not talked about those yet. Those are events, but we're gonna talk about them also in a future lecture. But now we actually want to talk about some functions. Now, here, no functions are mentioned actually, so we can actually call any functions on this. Why is that? Well, functions are called a little bit differently here in this case. And, but before we call any one of them, let's see what there is. So as you can see, there are a few functions available. The functions are all in this, with this pink, pink squares, a cube, a cube going somewhere alone. Also like that. Suppose all the functions and they all returned something. Or you can also give the function a parameter or multiple corrupt parameters. And of course, not all of them were not going to. We can also look at all of them. A lot of them they are, but we're going to look at a few of them. How can you access those? Well, you can access those by actually putting an a colon and then an axis, the functions. Now for example, let's first of all do my part clone. And we can also go by, if we do this, this is going to return an instance. So that's interesting, right? What is an instance where not sure? Well, let's just do local testlet say because this is going to return something. And then for example, we could just say, well, let's test it out. Let's just print out test Amin, who knows what happens? Let's just, let's just play it and see what's going on. First things first it's going to print out my part one. That's interesting. And now if we go here, nothing really changed all that much. But if we go to the Explorer, nothing here has changed as well. So that's, that's kind of weird. So what, how does that how does that work? Right now there's a big reason why we haven't seen the new part. They are because the parent is actually not set properly. So we actually have to set the parent to game dot workspace. Otherwise, the new par, let's say that we've cloned here is just going to say float in the air. It's, it's not going to be anywhere, right? It's not going to exist anywhere if, And if we play now and look at the workspace, as you can see, there's a second, my part one. And it's actually going to be in-between the other two parts. There it is, yes. This is the new one, the fully and one that I just renamed WD. So this is the new part that we've just created. And now it's gone again because this was created via this function and via the script basically. So this is, for example, a clone, the clone function. Now there's also, let's say, Oh, well let's just take the test and learn and say, well, let's just destroy it. Now on this, on this, this variable, we're actually not going to get any, any suggestions because roadblocks at this moment in time doesn't know what it is, what type is written in this variable. That's, for example, let's just say that we actually want to destroy the original one. And then let's say, let's say my part wouldn't destroy. And then let's, let's run this and see what happens here. And now what's going to happen is that the one of the parts is being destroyed and the other one isn't. So the original part is being destroyed and the one we've cloned is actually remains. So that's, for example, the destroyer. And there are a bunch of other ones. For example, we could say 5z, find first child, or we could also say, Is there not a good parent as well, something like that or find parented might be something like that. Get children we can do. So get children is basically the idea was that we've seen with the properties that there is a parent property, and we've also seen that here right here. And the parent is in sight of the Explorer always the thing that is above above the child, basically, right. So workspace right now with parent of cameras, terrain, base played my part one and part two inverse. Conversely, of course, when the, when this is the, those are the children of workspace, the air go. My part one is the workspace is its parent, right? So that's the idea. And a, an object can only ever have one parent. In this case. It can however, have multiple children. Now if, for example, we would take my part here and put it under my part one. Then of course what happens is that first of all, we can go down here and then we can see that the parent now is my part one. So my Po2 has apparent. That's my part. 01:00 AM I put one has another parent that's workspace. Now, this shouldn't be. Completely crazy because of course your parents also have parents and their parents also have parents. So this sort of a way of building a tree. And you can get some of those things, for example, with the, with the built in functions here. And as you can see, there are a whole bunch more. Some of them will be used, you know, soon enough in other lectures. Some of them, I mean, maybe not, I'm not even going to be used at all. But there's a lot of things in here. And these are only for the parts. By the way, there are so many other ones, you know, for some of them are once again shared because those are mostly objects, functions and not a 100% sure effort and the chat, there is another one where the I'm not sure. Is there not something where another one I yeah, there you go. For an analytic service, for example. Doesn't matter what that is right now. But just as an example, there are different types of functions there to call as well. So that's just important that there is a whole bunch of different types of objects here. Most of them are not even interesting to us at this moment in time. And then for each of those types, right now we want to select the particle, they would go. And then for each of those types, there are different types of functions that they both share. And then there are some functions that are specific to that type of object, basically, just like we've seen with the properties. So yeah, what I would advise you to do is simply go to the part and just look at some of those functions here. Maybe just play around with a couple of them. When you select them, you can see what you're gonna get out of this. So for example, you're, you're gonna get objects returns a read-only table of this object's children, right? So most of the time you have good summaries. Not always, but most of the time you have a decent summaries there as well, which are going to help you understand what the function actually does. So I, I definitely say, play around with a little bit, see what you can see, see what happens. This is basically one of the beauties of, well, you know, programming and scripting in general. You can just goofed around a little bit, just play around a little bit, just write something and see what happens, right? Because in the end you're not really going to break anything if it's not in a fully fledged game or anything or something that's going to be sold at this point, it doesn't matter. You can just play around a little bit and maybe you're going to find something that's kinda funny. And you're gonna be like, Oh, that's, that's kinda funny. I didn't wanna do that, but, you know, that's kinda cool. So I really, really implore you to just experiment a little bit, especially with those built-in functions. So yeah, that is, that is a shortlist overview of the functions and basically the object browser here. And I hope that everything was clear. If there are any questions of words, always feel free to ask and I'll be sure to respond. And they Yeah. 19. (Roblox) Colors in Roblox with Color3 and BrickColor: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about colors and brick colors. Now, we've already seen something in that. When we talked about referencing parts, we saw that we change the base plate brick color to green. But now we're going to look at this a little bit closer. So first of all, we're gonna create a my part two. So we're going to reference dot workspace, not my part two. Or he suggested here, great. And we're first of all going to change its color and then we're going to look at the brick color. Now the great thing is that the roadblocks, and in this case, Lua as well, it gives us a great way of actually choosing the color. So when we do my part dot color, we can set this to color three dot. And then we, I personally say choose from RGB because that makes the most sense. And as you can see down here, actually have this little preview. And if we click this, this color wheel, let's say we can actually simply select the color here. So that's the simple color selector. And let's say for example, we want to make this nice blue. Yeah, something like that. And it immediately just puts in the red, green, and blue values here. And as soon as we put the carrot, the mouse inside of here, we can change it once again to something else. And if we simply run this, then as you can see, this is turned blue. And this simply also turned transparent. Because of the other thing we've done in the first lecture when we reference the game objects, right? Right. So this is a way to change the color. That's all great. And this helps immensely when choosing a color. Now the question becomes, well, what exactly is the brick color? Well, as discussed already, brick Carl's are basically just predefined colors that are used in robots. And let's say for example, we want to use, let's do read. We've not used up. So we can simply go type and in brick color and then dot, and then choose one of the functions that will return a new color, and then it's going to turn red instead, because of course, this has been called after. We've set it to blue, so it is set to blue and then to red. And if we actually select this and look here, we can see that the brick colour is bright red. And when we choose the brick pillars here, there are actually all named in this case. So they are all named. And yeah, so those are a brick colour idea. We can also say brick colored dot random, and then we're gonna get a random brick color. In this case, we got a deep blue. That's actually kinda funny. And now we get a nation pink. And let's do another one. And that's gonna be a phone round. So if we use brick colored dot random, we're gonna get one of those random brick colors. And yeah, however, like I said, we can also use the RGB colors and then just setting the color like that. So you have a little bit more control over what color you want versus the brick colour, which are some predefined colors. They are, however, they can be really useful and it is run inbuilt random function is actually quite cool as well. Yeah, that's a little short introduction to colors basically. Shouldn't be too crazy. Vice to just play around a little bit with it and see what you can see. Just two for completion, the other ones we have here. So when we use new color, right, then what we can do is basically exactly the same. So we can just save this. And then it's going to have basically the same idea of the RGB, just in a little bit of a different format here. And if we use from each as V, this is simply the hue saturation and value. Instead of the RGB values, it is however, almost the same. Personally, I think that RGB is, Let's say, the most sensible in the most transparent. I think that that's something that you might have already seen, possibly in something else. So yeah. Yeah, that's just to be complete here. Yeah, this was the basic introduction to the colors here. And the difference between color and brick color. If there are any questions, of course, feel free to ask and I'll be shorter respond. And yeah. 20. (Roblox) Short Math - Vectors: All right, this is just a short little addendum I made to explain vectors and the math behind them. This is really useful to actually understand. And while we're not going to go into crazy detail, we're going to look at a few things so that you hopefully can grasp the basic concept of vectors. So first we're going to start with something. Everyone should be familiar with the number line. Now as you can see, the line goes from 0 to five, and of course beyond that as well. But for our purposes, this is all we need. You could imagine yourself being somewhere on that line. Know your location. You would only need to know one number, the number you're sending on, right? So this would be a one-dimensional line in this case, because only one numbers needed to know where you are. Let's add the negative numbers as well. Is this still one-dimensional? Yes, it is because we still only need to specify one number to know where we are. It can be negative or positive. What was still only one number? What does this have to do with vectors? You might ask, well, we can represent that number as a vector. So the two then becomes an arrow from 0 to 20 in this case, and often other cases is called the origin. We can have different vectors. Let's see some examples here. We have a vector with value2, value3, and value negative three. If I now were to ask you to add the numbers 23 together, you'd say, well it's five. Well let's see what happens when we add the vectors together. Here we have a vector with value two and here with value three. How can we add them together? We could imagine the vector with value three traveling down the first vector. And after it's made that journal look what we end up at five. So two plus three equals five. The same thing can be done with subtraction or rather negative numbers and vectors. So five plus minus three is equal to two. This might seem completely obvious to you because this is how you add and subtract numbers every day. But what if we go one dimension higher into the second dimension? Now we have two number lines. This one is traditionally called the Y axis and points upwards and as vertical. The other one is called the x-axis and is pointing to the right and is horizontal. Looking at the same example we had before, the two would now be written as 20, because now we need two numbers to identify where we are on this grid. We go two steps into the x direction and 0 steps into the y direction. But let's say we want to end up here. Well, we need to go five steps in the x direction and three steps into the y direction. We are going to call this vector a equals 53 with value 53. And we might want to add another vector on this, possibly b equals minus 22. We can take exactly the same trip before I simply sliding b along vector a, we can get to our destination C equals 35. And as you can see now, the addition and subtraction is simply an addition for each number of the vector independent of each other. So if you take the x value and add or subtract them. And if we take the y values and add up, subtract them, whatever it is, the sum, those are the new values of the new vector. Multiplication is just stretching the vector. So if we have two, three-year and we multiply it by two, and we just stretch the vector so it becomes 46. And division just make some shorter. Now for our purposes, we're actually be using vectors in three-dimensions, but it is just as easy as in two-dimensions. Thank you for listening to this lecture on vectors. I believe it is an important part of mathematics to understand, especially when trying to develop a game no matter what engine or system you're using. And if there are any questions, of course, always feel three tasks and I'll be sure to respond. And yeah. 21. (Roblox) Vector3 and Position: All right, welcome back to the roadblocks course. And in this lecture we're going to actually look at vector three and positioning. So first of all, I have created a new script or vector three position here under our server script service. And I've also created a new part called position part, which is position at position 0, ten y, and ten to Z. And we're actually going to play around with this a little bit. So first things first, when we select this part and we go down completely, we can actually see the sizes of 444. And this is the first thing that we're going to change. So we're gonna say part that size. And we're going to change this by giving it a new vector of three. Now of course, a vector three simply means that it's three numbers, x, y, and z. And this should be fairly easily understandable. We have a direction, x, direction y, direction z. And the numbers of the size simply say, okay, it's this many will units in this direction, this many units size in this direction, and this many units size in the other direction. And we're gonna create a new vector. How we do this is rewriting the vector three dot. And then we will type in the three coordinates, let's say. So let's make this, let's make this a little bit bigger. So 888. There you can see other suggestion, we already have number X, Y, and Z. And we're gonna say, we're gonna use this. And what's gonna happen is that this is should basically expand to 888888. So let's spawn it and see what happens. So this is, it should be bigger, I believe. Let's select it and go down. And indeed it is 888444. It would look like this, sort of a Mario cube almost. But in 888, of course it's a little bit bigger. So let's launch this again and see. So the size has changed on this part. So this is the first thing that we can do with a vector of three. Now we can also change the position. So this is once again simply part dot position. And then we also say new vector. And then let's go with 101010. Let's just move it about a little bit. Right now. It is at 01010. So we're going to push it ten points to, into the x direction, into the positive x direction right after this is being launched. So let's see, let's launch and let's see what happens. And as you can see, it is now no longer on this side but on this side. And if we check here, the position part, you can see 1010 tennis the position, and 888, the size. Now there are also plenty of things that we can do with vectors. So for example, after the theory, you should be able to think about this in, well at least a little bit of terms. We can just take the position and add a new vector to it. So we can just add a new vector here. So four by 55, this would then yield 151515, for example. And we can, by the way, also do this by doing a plus equals. So this also works right? So if we do vector three dot new iv, iv, five, this also works, also works. So we can do both of those. I'm going to comment one of them out just to say government, but both of them work. And then let's see if we do this. Then we would expect this to be at 151515. And let us look at position, and this is at 151515 grid. So something else that is possible. We can do part dot size for example. Once again, both of those are vectors. So you can make, have vector operations with them, how you please, you can also do times equals. So let's say we want this 50% bigger. Let's say. Then we would just times it by 1.5. And let's see how this works. Should yield a twelv size. If I'm not mistaken. And indeed, because eight times 1.5 is 12 and it's going to be 121212. Now, what's very important, of course, these of course can be different numbers, right? It does just maybe not the best way to show it. So we can just do some oil 31 is maybe a little bit much that I have to walk a little bit too much, let's say 14. And then let's say this can also be negative numbers, right? Minus 40, it could be 0, right? Something like that. So, so completely crazy numbers. Let's see what happens now. I'm not sure where it's going to be, what's going to be there. That's good, right? So those, of course don't have to be the same numbers, but now it's 12 in the x-direction, three in the y-direction, and 7.5 in the z direction. And it is positioned at 51510. After all of those operations. There's one more thing I want to look at when it comes to vectors in themselves. So we've seen the position, we've seen the size, and just vectors from themselves. So we can do vector three dot and then we use new to create a new vector, red constructs a new vector, and then you just using those three numbers. We can also do from axis and from normal ID. Now, the difference between the small and the large written functions, I gotta be honest, I have not found. So what I'm assuming is that they are exactly the same. So we're just gonna use the one that is written small. And here it said, If we look at this again, we said this is a enums dot axis that we want. And so we can just type this will enum dot axis, right? And then another dot. And then we see we can choose the axis x, y, or z. Then we can just simply say, well, let's choose x. And this is going to be the x-axis, then of course represents 100. Because then we have a one in the x-direction, 0 in the y and z and z and print this out. This is also what we are going to see. So if we print this out, what we're gonna see is 100, exactly this. And then conversely, you know, for example, if we do y, y is then going to be 010. Let's just print this out. And as you can see, 010 and then z is of course 001. So those happen, that happens if you do a vector from an axis. Now, there's also something that is a vector three from a normal ID. Now once again, this is something that you don't really need at this moment in time. I'm just going to show you. So because it's good to know this is going to be an enum from the normal ID. And there we have some directions back, bottom, left, and right and top. Let's just do back for example, that this a, this is basically a specific direction. And in this case this is going to be 001. But as you can see up here, at the top rate in this, in the window, we actually have these directions here back. We have the, sorry, you have right. We have front, left, top, and bottom. So those are directions that are already sort of predefined. And if we now print out the normal ID back, we're gonna get 001. This should be it. Let's see. Yep, zeros, 01. And in terms of in terms of this, this would be the back direction. And there of course the other ones as well. So top is just 010 of runned is then the opposite of Mac. So if we just do runned, for example, this, then I'm going to be minus one because minus one is exactly the opposite direction of, well, I mean, you know, if you negate one of e, one of the members of the vector, then it's immediately going to point in the other direction. So if you just times minus one times negative one, then you flip the vector around a 180 degrees. And now this is, of course all, let's say theory covered already in the last lecture. If anything, if there's anything that's unclear about vectors, I definitely would advise to watch that again. Anyway, that is sort of the idea when it comes to vectors in the position. There are two more vector properties that we're going to see in future lectures. That is going to be the rod rotation velocity and the normal velocity. Sort of, sorry, it's the rotation velocity and the velocity because normal velocity would be something a little bit different. But Yeah, yeah, so this is basically all I wanted to tell you about vectors and position. And I hope you found it illuminating. If there are any questions, of course, always feel free to ask. I'll be sure to respond. And yeah. 22. (Roblox) Making a Conveyor Belt with Velocity: All right, welcome back to the roadblocks course. And in this lecture, we're going to create a conveyor belt, right? So first things first we're gonna create a new part. And we're going to situate this on at the bottom of the base plate. And I'm going to move it around a little bit and actually scale it like this. So now it is size 26 in the z direction or in, let's make it. Now. Let's make it a three, let's say. And then only 0.25. So let very flat in the y direction. Now what we're gonna do is we're gonna make sure that it hovers over the ground a little bit. So by 0.5 right now. And we're going to make sure that it is anchored. Because next thing we're gonna do, we're gonna call this conveyor. That is not how you write conveyor, right? This is how you write conveyor. Of course they go. And the idea here is that once we also need a server script, service script, which we're going to all. That's also will this conveyor just for the sake of argument right now. And we're going to pull this, however, this is going to be the velocity because we're going to use the velocity to basically create this conveyor belt. So I'm going to say, we'll call this the con there. And that's going to be game dot workspace dot conveyer. And then we're going to just say conveyor dot velocity equals two. And this is once again a new vector, vector 3.1a. It's going to be 800. So very important that the default walking speed in this case is going to be 16. So when we stand on this, we're going to be pushed in one direction, in the x-direction. So actually we don't want it in the x-direction. We actually wanted into the z direction because the we've laid out into the z direction. So let's try it like this and see what happens. So in theory, everything should work. What is very important is that the, that the part is not that is anchored. So let's see what happens and they, we go actually Dr. through this. And then if we run into the solution, as you can see, we basically have half. We usually have. And if we go into this direction, we're going super speed. So this is basically a, a, a very easy way to sort of build a conveyor belt. Now if we put this tool, say 16 speed, then what happens is we basically made a treadmill that we can work out on. So let's see. So in this direction we're going to be really fast. This as far as walking. And on this direction, we're actually not making progress as you can see. So if I go in here and I'm walking, I'm running as fast as I can, and I'm not moving because the movement speed is exactly the same as my walking speed. And yeah, so that's, of course you can make it ridiculous, right? So you can do something like this and then we're going to be thrown. Let's just see what happens. I mean, why, why? Why not, right? Well, let's just have some fun. Let's see. Oh, so that's really fast. So this could be, for example, a way to get around some cities, for example, conveyor belt, conveyor belt thing everywhere, right? So this is basically the way to create a conveyor belt. Now, important that the part is set to anchored, right? This is very important. Now we've already set this, let say manually. It makes sense that if you want to create a conveyor belt, now part that you may be set it explicitly. Once again, you're in the script just so, so sure. And I also want to mention one other thing. If we hover over the velocity here, it says that it is not recommended to be modified a directly unless there is good reason. Now, usually what happens with the velocity is that when we apply a force to an object. So you could think of that ad for AES, for example, if we throw an object and the velocity basically tells us, okay, in what direction is it moving and how fast is it moving in that direction? Now, we've basically, however, use this velocity right now to create this conveyor belt as simply a well, something that is that can be done with robots studio in this case. And yes, so this is just a fun thing to play around with basically. So yeah, I hope that that was kind of funny and helpful for you to play around with a little bit. No, I would really appreciate a review or a reading from you if that is something that you would give. And once again, of course, I will always be available for questions if there are any. And yeah. 23. (Roblox) The Wait-Function: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about the weight function. And this is a, let's say, a special function that we can use in order to delay execution of a certain line of code or script. So first of all, we're gonna create a new script once again in our server script service. This is gonna be called weight, weight function. And then of course, at the very nice header up here, and we're just going to create a for loop. We're going to start at 0, go to ten, increased by one. And then we're gonna print i. So if we do this, and let's just run instead of actually starting the game, let's say. And as you can see, it's just going to print out from 0 to ten every number in sequence immediately. Now baby, what we want. And well, the way I've called it a wave function, that's not, that's not right. Let me wait. Function. There you go. Let's say that after we print this out, we want to actually wait for 1 second. We can just do this. So just add weight one. And then what's gonna happen is 0 and then one, then two, and then three, and so on. And it's going to print out. And each time weight is called, it's going to wait 1 second and then it's going to continue with the next line. So this is basically already the entire idea of the weight function. It's basically there two into two. Well, wait, I mean, that's the that's the best way she can say it. It's just a little thing that is important to know because sometimes we maybe want to wait something for a second-order soap. And this is what the weight function really is. 48 shines in many different ways in that sense. Yeah. So it was a very short lecture here, but just so that you have heard about the weight function because you're definitely going to use it in future lectures and specially when we make a game ourselves. So yeah, yeah, that was it. If there are any questions, of course, feel through task. And yeah. 24. (Roblox) New Instances with Scripts: Right just before the lecture starts, a quick update or a quick note, right? Remember to always comment out the print lines in the previous episodes so that your output doesn't get cluttered. Just making sure to remind you of that. And off to the lecture. All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about instance not a new, what is instant dot new? Well, how can we create a new objects via scripts? This is exactly how. So? Once again, we're gonna create a new script pulled. This is going to be new objects. And Of course, like always, the nice heading over here, New, creating new objects with instance dot new. And we're just going to dive right in. So we're gonna make a new part. There's going to be a local new part, and there's going to be equal to instance dot nu. Now inside of there, as you can see, we want a string, which is going to be the name of the class. So here we actually get a whole bunch of things already. Well suggested to us. Now we are going to choose part and we're going to look at the rest of the list soon enough. But this simply then creates a new part. Now, if that's the OMIM, that's great. Let's run this, let's see, where is it, right, so new part. Well, first of all, we don't want to run this. We actually want to play this. It doesn't really matter, but in this case, let's play it. Let's see. Well, you know, the position part of the conveyor. Well, where is it? Where is well, once again, when we think back to when we cloned the one part, we needed to set the parent. And this is something that we need to do here as well. So we actually need to set the parent to game dot Workspace. Now, we can already set the parent in here as well. As you can see, this is also a pair, an instance, and we can just set the parent inside of the instance that new as well. It really does matter in that sense, weird you do it. So if we then look at this and here, we actually have the new part down here or part that's here. So for example, we can then say, well, let's give this a new name. So let's call it a new port. For example. Just were all written together. It doesn't really matter. Let's just call it a new part. And then we can also position it somewhere else. So for example, we will position it at vector 3.Now you had, let's say 050. So we're going to actually put it five units up, and we're also going to anchor it so that it doesn't fall down at this. We're going to set it to true because anchored it's a boolean type value and we can set this to true. And then we should land on it as well. There we go. So we actually landed on it. And, and can we make the jump? We actually can't let go. Right? So anyway, so this is the, the part and we have now created a new part. We can actually see this is called the, a new part. So the name has also changed. That's pretty nice, but that's pretty cool. Now, there's one thing that I want to mention, and this is usually something that doesn't it's not as big of a deal as I might make it out to be, but it is kind of important. So the order is important, right? Because what happens is if we create a new part two, let's say. And we're gonna do instance W. And this is going to be a part, right? Then basically what we should do is we created, then we should change properties, right? So properties, and then we should set parenting, right? And the, the idea is that if we change the properties before we, before we set the parent, then we have, this is a little bit optimized for the processing, let's say, because as soon as the parent is the workspace, you know, it has to be rendered and all of that. Let's, let's keep it as simple as possible. However, it is a little bit better. At least this is the conventional wisdom, let's say vector three new, let's set this to 0150 this time. And then once again, Newport 2.txt is r2. And then we can set the parent to new part two dot parent equals two game workspace. Now we can also, by the way, do only workspace. This also works. I prefer just by then came that workspace, it is functionally exactly the same. So if we do this, then we can see we've created another part right here above it. And yeah, now of course, like I said, we're not going to really notice it and is usually it's not that big of a deal. However, I did want to mention it just in case because it's, you know, it's something that should be in your mind maybe at the back, but it should still at least sort of heard about it. And now coming back to this, so the part here, right? So when we do this, we can actually see that there are a ton of different things that we could possibly create an instance of, right? So there's a lot of them. And going back up here to view and then the object browser, it is exactly the things that we have here that we can create. Basically. I believe that there are a few more in here. If you're more mirror. So for example, actor. I don't think that an actor is in your yeah, right? So there are few things that are not in the object browser that can actually be created. And I do believe that there are some things in the object browser that also can't be created. But usually all of those things can be created through instance that knew. And we've only seen the part. And this is also something that is well, most likely what you're going to create in this case. Yeah. So however, if you want to try out a few other things, you know, me, especially once we go through some of the other objects possibly and see how they work, then it's possible that you want to try out a few different things with the other in CSS and just create a few of those. Yeah. So that's basically how you can create a new instance of a class, in this case a part. There's one more little detail I want to mention, and that is if we create these parts with instance that new, as you can see, they have the stats on them. And if we then say, for example, the new part, if we select this, we can see down in the properties we actually have the surface and the surface inputs as possible properties as well. This is the same that we have seen with the base plate. And if we look at our normal part, we don't have this. This is because we have not set any surface in the model. So if we go to the surface and we could for example, say smooth, nothing happens. If we say surface glue. Then we can actually glue it on something. So we can actually say, well this is a glue or we can say stubs for example, and then studs at the, at the top. And then as you can see, we also have studs and then the surface inputs and the surface properties appear down in the Properties window. This is of course, because if you don't have a surface, then you don't need those properties and this is why they are not there. I just wanted to mention that if they are that because there might be some confusion there, I hope that clears that up, right? Right. So that is it for creating new objects, especially new parts, with the hope that that was informative for you. And like always, if there are any questions, feel free to ask. I'll be shorter respond. And yeah. 25. (Roblox) Part Property: Surface: All right, welcome back to the roadblocks course. And in this lecture, we're gonna talk about the surface of a part. Now, I have mentioned this in the previous lecture just shortly at the end. And we're now going to actually look at some of the surfaces. So to look at this, make sure that you are in the Model tab. And then you can see the surfaces here. And we're gonna try this at this position part. We're gonna just try out a few things. So for example, the surface, we can say, for example, studs. And then we can actually basically move around and specify which surface we want the states to be in. So let's say for example, we'll actually want, this starts to be on the, actually not that easy to navigate. Let's go, let's say on the site and also at the top, right, like this. So that's, that's pretty good. And then let's say what I want is I want inlets on this side and inlets on this side as well. Why not that you go. So now we have some special surface here. And in side of our properties here, when we have the part selected, we can see that first of all, we have some surface inputs. Those are not really interesting to us at this moment in time. What is interesting to us here on the surface, as you can see, we can also change the surface down here now. So for example, the left surface is this one. We can actually change this year as well. So we could, for example say, Well actually went back to smooth and then it smooth. Or of course we have other things. Stepping motor, we have universal, which is the studs and inlets alternating. We have a weld, we have glue, and we have inch as well. And in inlet. That is also something we have seen it there and motor of course, as well. Now what some of them do we will not discuss right now. However, what we are looking at is just that we can change the surface of a normal part basically. Now, this is changeable VR script as well. Right? So we find ourselves here in this example script just for the sake of argument right now. And we're going to get the part. This is gonna be game dot workspace dot position part is the one we used. And if we then say part, we can actually should see that we have back surface as we can see here. And this is something that we can access, that we can actually set this to a surface type, and this is done by using the enum once again, so inner surface type dot. And then we can, Let's, let us define the type. So let's just say we're going to use a motor just for the sake of argument because the position part at this moment in time doesn't have a motor that we have smooth studs, inlet and studs. So this should set the back surface to a motor. Let's play and see what happens. And if we look at this guy, this is the one we actually move. So let's just see here position part. So this guy, there we go, there's the motor. And so this is the way we can actually change the surface via the script as well, right? This is basically just a short overview for the surface. Just so once again it is mentioned and we're going to look at some of the functionality later down the line as well. Yeah, yeah, so that was it for this lecture. And I hope it was informative for you. If there are any questions, of course, always feel free to ask and I'll be short respond and yeah. 26. (Roblox) Part Property: Material: All right, welcome back to the roadblocks course. And in this lecture we're gonna take a look at the material for the part. Now last lecture we've seen the surface and now we're going to look at the material. Now, as you can see, there are a bunch of materials that we could choose from. And the most important thing is they can actually be combined with the color in order to create like an interesting, interesting combinations, let's say. So for example, we can make the material a metal. Material right now is metal, but very important. The surface, if we open that is still the same, right? And if we are going to play this, because we've changed the surface and the position of this part is going to change. You know, we can actually see that. So the more we can see the other stuff. So the studs are not actually visible or the inlets. That's just a side note right there. But yeah, so we can change the materials of frictional force field is something that we can do. So this is like a very lightly, so it's, it's a little bit visible, not black, white, but it's almost completely transparent. By the way, has nothing to do with a transparency property. Also very important. This is really the material and something else would, for example, we immediately have a texture. Now, this would, in this case, I believe, is just great because the color is gray. Yeah. So we would actually have to change the color as well. We can do that, for example, if we say something like that and that almost sort of mahogany or someone like that. Yeah. And then some others things fabric. There are, there's cobblestone. So that's quite nice maybe for making a road. Brick, sorry, a brick, that's pretty cool. That's been used for building a house, for example. And we make that red. Now it looks really nice, right? This is, this is a nice, a nice break. This is a nice break. If I've ever seen one L C example in-game. There you go. So that's a, that's a really nice brick texture there. So that's basically a material that comes with the game. Immediately. Yeah. And once again, those are customizable in a similar way to the surface. We have part dark material and then we can use the enum dot Material, dot whatever we want it to be and just choose one. So for example, maybe we want it to be sent. So we can do this and play. And I'm, we're gonna see red sand now. So this is sand. And it's going to be read in this case because the color was but, but that's fine. Yeah. So we can change the material within the script as well. Right? Yeah, and that was it for the material. Once again, it was just a short look at it. Once again, I would advise to play around with it a little bit. And then we're going to see what we can do with different material is going, you know, going forward and in future lectures. And I hope that was informative for you. And if there are any questions, of course, always feel free to ask and I'll be sure to respond. And yeah. 27. (Roblox) The Touched Event: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about the touch event. Now, I have already created a new script, for example, in some of our server script service. And I've loaded in our, my part two here as a local variable. And we're just going to look into what we can do. So in order to use this Touched event, what we have to do is we have to take my part and we can say, we can say My part and then do touched. This is one of those. As you can see in the suggestion there. This is one of the lightning bolts. So this is an event. And the way we use events is basically we take an event and then put a colon in the afterwards and then say connect. And inside here, we have to supply a function. So for example, function. And then everything written in here is, is executed every time. This is something touches this port. And that's basically the anterior. So what we can do is we can say, hey, and the great thing about this function here is that this actually supplies the other part that is touching that my part in this case. So what we can say is I'm oh, no, southern like this. I am picking. Well, that's a, that's an unfortunate to phrasing. I'm being touched by all apart. You go. But let's keep it like that and yeah. Now what's also very important is that my part, it has to be anchored. Otherwise, it will just fall to the base plate and then the base plate will keep touching the part. And that's clearly not what we want. So let's just see how this looks. And let's just go to the part that's going to be one that's not transparent. And as you can see, as soon as I touch it, a whole bunch of stuff is touching it. Now, why is that the case? Well, my my model here is actually more than just, you know, it's more than one part, it's multiple parts. So as you can see, if I'm very careful about this, I can get it so that the right hand is currently touching it. And then right upper arm and then maybe I can get the yeah, exactly. If I stand on on it and I can get the foot to touch it. And so yeah, so basically you can have different parts of your character model. Touch it. Currently, this is not quite what I wanted to do. I wanted to do something a little weird, a little funky by not. And what we're gonna do first of all is we're gonna create a new local Boolean here called moving. It's going to be false in the beginning. We're going to do is every time you touch this part, it's going to just move a little bit. So yeah, let's just, let's just see what happens. And what I wanna do is basically, each time I'm not moving, so the part is not moving, right? I would stationary. Then I'm going to say, okay, so then we know that moving is false. And then I want to do something and then I want to move. And because it's moving now, we can set moving to true. Because of course now we are moving. Now of course nothing happens right now that no movement is happening here, but this is what we're gonna do now. And for that, I actually also want the ordinates for this. So we're just going to copy this position with Control C or Command C for Mac. And then we're gonna do a for loop. And this for loop is going to start at 0, go to ten and increase by one. And then we're going to say my part dot position. Now we've already seen the position that we can just set it to a new vector. So we say vector three dot. And then we can say something like this. And then we're gonna do is we're gonna add i to this, to the exposition. We're just going to add i. And then actually, let's start at one then that makes it a little bit more sense. And let's also print out just for the sake of argument here. No, print, please, not prompt. Print out. I am changing, changing my position ego. Now after this for loop, we can think about this, right? So I'm touching the part once moving is false. So we're going to move in true. And then each time I touch it with another part, it doesn't matter because we're right now moving. So we cannot enter this again. And, and this for loop is going to start. And it's going to go through one to ten. And it's going to move the part. But what we really want is we wanted to wait a second here, right? Because if we wait a second and it's going to slowly move along. And once it's done, we have stopped moving. So then we can say moving equals false again. Now if this doesn't really follow, if you, if you don't quite understand the logic, what I would implore you to do is to just go through this a little bit, try it out, take this, take the script and just play around with a few parts of it. This simply comes in after you've scripted or program for a long time. There were just some things that, you know, you have to build up everything from the bottom-up, right? So this is why I said that there are a lot of tools in your toolbox that you're gonna need. And this is a continual process, right? And in the end, at the end of the day, a course can bring you a Long, Long While further along, right? Without a doubt. But at the end of the day, you're not going to create the next crisis, let's say, or I don't know, that's maybe not the best example. Maybe the next Call of Duty by watching one course, right? There is some self-learning To do that you need to do. And this is one part of it. Playing around with these scripts is the best thing that can do. So if you didn't follow exactly, that's what I would implore you to do. And let's just see what happens if we now do this. Now what I always advises, if you program something like this, then you should always have in mind, OK, I'm expecting this to happen. And then let's see. What I'm expecting right now is as soon as I touch it, after 1 second, this block is going to move one step into this direction and then another and another and another until it has reached a studs. And every time it moves it's going to print out. I'm moving. I'm changing my positions available. And after this had been printed out ten times, it's going to stop and remain in that position. Let's see if that happens. So I touched it and then they go. So it's slowly moving along and solute moving along. And as you can see, this is five times, six times, and at times ten, it should stop. Now it should stop. It has stopped and is fine. And now what I'm expecting is because this is not the, let's say into the new position, it's going to reset again and go back here. Once I touch it again, after a second, it's gonna go here and then move there to there again. So let's see if that happens. And indeed it didn't go back. And now it is moving here. Again. Let n it's going to stop at times 20 this time. Right? You go, right, and that is just an example. So this is not really anything. That's what would you say. It's not really anything practical is just a demonstration to show how would you could build something from the ground up. You know, that there are probably some things where this might be useful. And yet this is a short introduction. We'll overview of the touched, touched event. And I hope that was informative to you. And of course, if there are any questions, always feel free to ask and I'll be shorter respond. And yeah. 28. (Roblox) Players (Player vs Character): All right, welcome back to the roadblocks course. And in this lecture we're going to take a look at the difference between the player and the character and what do these concepts even meet? So first things first, when we join into this game, for example, when we played this game rate, we can see that our player has been added to this player's will property here or displayed in the Explorer, right? And we can see cotton drawer, that is me, and that is my player. Now, the Player basically is the client. You can think of that as the client that is connected to the server. And each player a, is connected to the account that you have for your roadblocks, right? You have an account made for roadblocks and that's sort of also connected there. And then each, the player itself has a character. Well, that's sort of a part of it, right? And the character has the reference to the model. So how I look like and well, every, every part that's a part of my model that is basically inside of the character. And there are also some other things like inside of the starter player down here, there are sorted player scripts and Starter character scripts, and we'll take a look at that, those right now. So for example, if I put in, into the player soccer player scripts, right? It already says, okay, you should only put in a local script here. And that's what we're gonna do. And we're just going to print out something like hello player. Well, well, how about Hello? Hello player, welcome, right? And then let's just play this and see what happens. And what's going to happen, of course, is this going to print out hello player, welcome. Now the great thing is that roadblocks in the newest version of the robot studio, they actually added eight cool new outputs tool here so that you can actually see where this is coming from and this is coming from the client. So this is only seen by client site. So if I were to join flow example a server, this script would only happen for me and no one else would see that. I was greeted. Let's say, for example, no one would see hello player, welcome. Well, they would see their own, but we wouldn't see it if another person joined at an old person joint, we wouldn't see multiple ones. We would only see it once. Now that's of course, one of the things that we could do here in this starter player scripts, those are just the scripts that should run once you start with this player, right? There's something that we can do which we're going to take a look at just right now, just for the sake of argument, which is going to be, we're going to make a new script. And we're gonna call this, we'll say player versus character, right? And then what we can do, so for example, the players one rate. So we can say local, all players, right? And we can then say player workspace, this game dot workspace. And no, it's not workspace. It's gamed on players. Exactly. Game dot players. And then we can do a colon again. And here we can get it. Children. No, it is good players. It is good players. And this simply gets all players. So for example, we can just print out all players here. And let's just see what happens when we do this, for example. So as you can see, right now, nothing has been printed up because when the script started, it was empty. Aha. So how then can we make sure that this is, let's say populated or if there is something there, there's another event that we can subscribe to that says, okay, well, what happens here? And that is going to be, That's going to be game dot layers. And that's going to be Player added. This is the event and then we can simply do a connect on this and then make a new function. Let's save right here. And this passes in a players versus the player that joins, right? And then we can say, well, okay, then let's do the following. Let's print this out as soon as someone joins, right? And then also let's print out hello. Let's just say layer dot. This would be layer. We could go for the character, but let's go for display name. And then let's see if that works. Let's see plate, right. So first of all, we still have it in, it's still empty, as you can see here. Here at However says hello cotton jaw and this hello player welcome, of course is the one from our local script. You can also see that those two come from the server. Now, you might ask, well, why is this still empty? This shouldn't this happen when the player here joins? Well, we could also say, well maybe, maybe it has to do with some sort of way because you're using a local variable and all that. And welcome, welcome. It is something like that. And as you can see here now, all of a sudden, as you can see, we have cotton Joe in there. And if we store it again, this is no fluke, right? This happens again. And now if we use this variable, the old Player variable here, but let's close this again and save it. And then let's run it again. As you can see, it is empty. So in this case, what you would do is you would actually put this in here and do something like this. So you would get it into this local variable right here, inside of this function. And then it would work when you use the variable. Then, as you can see, oops, there you go. As you can see now, I am inside of this table, and this is the reference to my character. And also your hello calvin Joe, with the display name, right? Right. And if we say, for example, if we say player dots character, right? And we play this. And what's going to, we're going to see first of all nil here because the character at that point, and that's just, and that's the important thing. At that point, the character has not created yet because you have actually seen the, we didn't actually see my model after this was printed, right? So look at this again. This gets printed and then the eyes spawning, right? Well, this sprint, and there I am. So the character actually has not been added yet. Once again. So we actually need to, if we want to have get the character, we actually need to wait or have a different event here that says, okay, let's, let's, let's wait until the character was added, right? We actually have to add a new event here and basically say, well, this player that just joined, we then have to say, well, this player that drawing there is a character added the event. And then we want to connect this to another function which passes the character here. And basically we would just want to put everything inside of here, right? And then we can, and then if we print out the player dot character, so we actually actually can do something like this, right? So first, just getting all the players wants the players are in and then printing out all players. And then afterwards, when this printed out, then we're gonna say, okay, now we're going to wait until the characters at it. And as soon as that is added, we're going to print out hello, player dot character. And let's just see what happens there. And as you can see now, it actually took a while longer until this printed out because it actually waited until the character was added instead of the player. Now, these, it seems, it does seem like a very superficial, let's say separation here. But it is actually important. And later down the line we are going to see some important differences and also some important ways we can use this to our advantage. And basically just some use cases wherever this is important. So this is why I wanted to quickly mention it. Once again, a little bit more of a theoretical thing. I'm also going to link a, a resource for this one. It's going to be on the on the developer reference, the API reference for both player and character. That's very important and there's also going to be a later lecture where I'm also going to explain how to navigate the API references for yourself. Because in the end, it is definitely something that you also need, but that is something for another day. Right now, we have successfully finished this player versus character dichotomy lecture. And yeah, if there any questions, of course, like always, feel free to ask and I'll be sure to respond. And yeah. 29. (Roblox) Adding a Spawn Location: All right, welcome back. Roadblocks course. And in this lecture, we're gonna talk about spawn locations. Now the spawn location is a type of prop, is an asset. So an instance that we can add into our workspace, if we press the plus button here, can see spawn locations. And then this is going to be set down as this little platform which you might have seen in some games already. And this, we can then simply move. And the idea is that before what happened was we spawned at 000 or not 000, like 0100. So we spawned in the sky and then fell down a lot. We spawned at 00. And we can see if we spawn now. We actually spawn at this spawn location here, right? So with this type of object, we can actually make it so that our players spawn in a specific location. And then, you know, going from last time when we had touch, when we can actually spawn here. Now, the big question that comes up is, well what happens? So I can duplicate this by the way, by selecting and pressing Control D or on Mac it would be commands D. And then I will duplicate something that I'm currently currently selecting. And then we can have a second one. And now the question that comes up a lot of times as well, what do I have to spawn locations in and setup nothing on the properties. We're going to look at the properties sooner, but right now, I've said nothing up and just like that. And what happens now? Well, say well, maybe what happens is that I'm always spawning in the first one. Nope. What's going to happen is if you have multiple spawn locations, then it will be randomly chose. So if there are multiple small locations that are, let's say, eligible so that I actually could could spawn at because there are some things that we could, there's some properties that we can change though, that maybe one of them is not eligible for me, then it will change it. But as long as every spawn location is eligible, you would choose a random one, right? So as we can see, we've now spawned here. And if we spawn again, let's hope that the randomness blesses us. Well, it didn't, it didn't let us now, but Let's just go in again. And now we were blessed because now we want at the other one, right? So this is the basic idea. If you have multiple spawn locations, they are chosen randomly. Now, if we look, take a look at the properties here, those are actually really important and interesting. So parents is just normal, data is just normal and then behavior is just normal. But then we get to something called teams. Now, teams is something that is really interesting because this basically makes it so you can have different teams, right? So there is something called a team service, which we can use in order to basically separate our players and teams. And if we can, for example, say loud team change on touch. And what happens then is that as soon as the player touches this specific spawn location than it would, of course change the player. And the neutral in this case, simply means exactly this, that any player can spawn at this location regardless of their team. And this is the default way that this is set up. And then you have a team color, which right now is just medium stone gray. And this is something that would need to be set once the when you actually use the game, right? So, yeah, there's also a force field that is activated when you spawn in there, which you can set the duration of. And there's also just the part that we've already seen, but that's not important for this fornication and itself. So those are the interesting ones here, the team, you can of course, also hover over this and see the example here. As well. As there are description, I guess there's no tooltip, Orissa. That's a real shame. Anyway. So what I wanted to also say is that the, when it comes to the teams, because we haven't yet touched on the surfaces yet. This is something we're going to look at in a later lecture because there are still one or two things we need as a groundwork. Just wanted to set this up as a sort of introduction to the spawn location. That first of all, if you have multiple ones, they're going to be random. And if they're set to neutral, that's also important. And yeah, and yeah, we're gonna see in a future lecture how this would work with different teams, for example. Or with, you know, also changing it on touch, right? So that was it for the spawn locations. There's a short lecture on that and yeah, if there any questions for us feel free to ask and I'll be sure to respond. And yeah. 30. (Roblox) Click Detector: All right, welcome back to the roadblocks course and in this lecture we're gonna talk about clicked detection. So click detection is basically a way in which we can make a certain part clickable. And this can then be detected by the server. And what we can then basically have just a function be called after the click. So let's just see what is involved in that. So first things first, we're going to create a new part inside of our workspace. And we're gonna call this one, let's say liquor just to make sure that we know which part it is. And then we're going to add something to the part that's going to be the collect detector here. And well, that's almost all that we need inside of the click detector. By the way, we can also specify the activation distance. So how far can we actually be away from this in order for to click this. So I personally think that it 32 is a little bit much. So let's just do 16 for the sake of argument right now. And then let's add a new server in your script, in our server script service. And we're gonna call this the click, click detection. And then add a header. Will click detection versus not necessarily needed, but I do like it. So let's add a local public debt, TOR, heart and a party. Well, no, it so just support not a click detector party, although that would be pretty cool. Workspace dot no, it's actually a clicker. We hold a clicker and then we can just say dot click detector. So now we actually, yeah, so let's just immediately get the click detector instead of the detector part. That's even easier. And what we can add is, we can add, we can say click detector, dot, mouse-click another event here. We can actually also by the way, have mouse hover enter, mouse leaf and mouse and right mouse click. So those are other events that we could, for example, the Kinects. Alright, now we're gonna just connect to the mouseclick event. And what we're going to say is we're going to write a new function here called On Mouse lick. It is going to pass in the player. And then we're gonna say you're on a mouse-click because that is the, that is the function that we want to call it. A very important when we have one of these connects here, the function that we wouldn't call here, we actually have to specify or defined beforehand. Otherwise it will throw an error. So let's just print out, for example, you clicked me. And let's see, let's see if that works. Let's, let's just go in and see if I can click this. So I'm going to spawn here and, well, nothing appears. And let's see if I go. If I am at a reasonable distance, there is already. So this is sort of the distance that you need to be a way to actually click it. So that's what we did in the beginning with the 16. And then let's click, and there you go, you click me. And this is also on the server side. The server actually knows that I clicked it. And the great thing about it is that because the player is passed in here, I can actually say You clicked me. And then for example, say player, right? So I actually know who click me. So if we go in here and I go in, I can see you click me cut window, right? So he, the server knows that it was me that clicked. So that's actually also very important because you could imagine that you maybe have a screen with a touchscreen elements, so to speak. And then you can click on there and maybe you need to know what Player click this or you want to have something else. So in a future lecture, we are going to see that we're gonna make a click detector that adds sort of goals to your character. And then of course, it's really important that you know which character it actually is. So yeah, that's actually already all I wanted to show you for the click detector. It's actually very easy to implement this. So most of the, these things are, as the name suggests, basic, this is of course why we're in the basic part of this robot scores. But it's very important to see each of these basic building blocks because just like let's say with Legos right there, or really like all of the same blocks. But the more you have, the more you can build insanely complicated things. And it's exactly the same in scripting and programming and in roadblocks, studio is exactly the same. Each little tool you can add to your toolbox is another way you can solve a problem. And you can add a new functionality to a game that you want to make. This is why these basic things are really important and that's why it's also important. If there are any questions that you are, you know, you always feel free to ask. Of course, you can always look forward if there's a topic that you like. Ah, I want to learn about this. You can always look forward into the, into the future lectures and I'm sure that a lot of the topics are covered, but there might be something that's not covered. And then of course you can feel free to ask and if I find it that is valuable for applicable for the general audience of the dental students, then it's going to be added and yeah, that's that's sort of the idea. So like I said, if there are any questions, of course, feel free to ask and I'll be sure to respond. And yeah. 31. (Roblox) Making a Leaderboard: All right, welcome back to the roadblocks course. And in this lecture we're gonna take a look at how to add a leaderboards to our game. Now, we're going to look at this leaderboard with, let's say two things. We're going to add a, two variables to it. Let's say a gold variable and a level variable. And the idea is that once again, this is just sort of as an introduction to how this might look. There are so many ways in which you could use the leaderboard. It's insane. But the great thing is that row blocks actually has so many, you know, added like things already in there. It's great to use instead of having to build your own. So first things first, we're going to add a new script, once again into our server script service. And this is going to be renamed to leaderboard. We're just going to rename this leaderboard and worse, because I can't live without them. A nice head line, your hold leaderboard, say local players. So what we want is we actually going to get the first surface. Now what exactly services and a brief overview over surfaces is going to be talked about in, I think, in two lectures. While, let's say in the next few lectures, we're gonna talk about specifically services, what they are, how they work, and what type of services there. We we won't get to every service because they're like a 100 services or something like that. It's an insane amount of things that we can use. And this is also why it's so great that there are so many, there are so many ways that we can do things. So as you can see here. So those are all of the services that are in here. It's nice. Not quite a 100 I guess, but it it's still, it's a lot of services. And the one we want is the player's service. Now, we have seen this done a little bit differently last time. And what we have done this is we have done this by using game dot players. And this also gets us the player surface. So this is just something that I wanted to mention quickly because this is another way that we can do this. Now, what we want is we want a local function here, which is going to be called leaderboard. Leaderboard setup. Let's just call it setup. And it's going to take a player as a, as a parameter. And what happens is, we're going to actually put this in. We're going to connect this and I'm going to do this immediately. So we're gonna do players, dot player added. And we've already seen this event. This event is fired each time that a new player is added to the game. And we're just going to call the leaderboard set of them. And the idea here is that when this happens, we simply add this leaderboard to the player. So we're gonna have a leaderboard stats and this is going to be a or we're just going to also correlator stats, that's fine. This is going to be instance, instance dot new. So we're gonna create a new instance of something, making sure that we actually write instance correctly. And this is going to be a folder, so we're just going to make a new folder. And we're going to call this that name is going to be well, leaders stats, I guess, right? Something like that. And then leader stats dot parent is going to be the player. So this is going to be the player that we actually that happens to connect to our game. And then the way we can create new variables here is, or variables for the, for the leader board is going to be something like this. It's going to be a local gold. So we're going to create gold first. There's going to be Instance got new. And this is going to be an integer value. So this is just an integer, basically Gold dot name or a number, let's say name. This is the name that is displayed in the leaderboard, gold. Then we're going to have a goal dot value. This is the default value that it takes. So every time a new person comes on, this is the default value that it gets, that they get. And then gold dot parent is going to be a leader stats. And then we're going to add another one. And the way we can do this, we can simply copy this and then change this up. It's going to be level. The name is going to be level. And then level here as well. Making sure to copy this. And then just quickly pasting it in. And we're going to start at one, let's say just for the sake of argument, right? And that's basically all that we need to do in order for this to work. So each time a new player connects, this is gonna be rotten to this function. And it's going to create a new folder inside of our player called leader stats. Now what is very important is that this is actually something that needs to be the right name. This is the, this name cannot change this y, this has to be leader. Says if this is not Leader sets, the leaderboard will not be created and roadblocks will not be able to actually use this. So that's very, very important. A leader sets is the name that it has to be, right. Let's just create it and see what happens. And when we join in, look at this, we have 0 Gold and one level. Isn't that amazing? Right? Because it's very boring to just have a leaderboard and you can't do anything with it. I thought that what would be the most interesting thing that we can do right now is we have added the click detector last time. And why not? Try and just, you know, each time you click it, you get one gold out of it. How does that sound? I think that that is a brilliant idea and we're gonna do this. Now, the great thing about this is because the player is passed in here, what we can do is we can just get the leader stats by simply playing player stats. And because we know that each player inside of our game has the leader sets folder, we can just get it. And then what we can do is we can say, well, what we want is we want the gold standard. So this is basically the gold, the statistic or the stat, the value of gold. And this is going to be done by doing leaders stats. And then we're gonna say leaders stats, find child called gold. Right? And by doing this, this basically allows us to ask and this gold standard and if statement, okay, if this actually exists, then we can simply say gold stat dot value plus equals one. So the idea is that this is just a way of making sure that this actually exists and that this is a child that exists inside of the leader stats, right? Because if it doesn't, well then we can't add one to it. So let's then play this and see what happens. So first things first we can see players. And then there is a folder called leader stats. And inside of it you have the Int value gold, and the value level. Now we could of course change it here, but that wouldn't be very fun. That would be cheating solid. See, when we click this, we would, should get one gold. And there we go. And we'd still get the you click me of course. But we also get one gold, and each time I click it, I will get another gold. That's pretty cool. I would say, this is some way of doing this. Now of course we're not storing this anywhere. So if I join again, we're going to have 0 Gold again. But storing as something that's way more advanced, that is definitely in something for the intermediate section. But yeah, that's a, that's a rough overview of leaderboards. Like I've said, they are really good and they're all one of the services, let's say that can be used, you know, fresh out of roadblocks. We don't have to almost we almost have to do nothing to facilitate good leaderboard. And yeah, that's really good. So if learned questions, of course, always feel free to ask. And if you found this insightful and informative, I would of course, really appreciate a review or a rating. And yeah. 32. (Roblox) Adding a Trail to the Player: All right, welcome back to the roadblocks course. And in this lecture we're gonna talk about a trails and how to add them to the player. So first things first, what are trails? So trails are basically when you move you get like a little color trail following you. And I'm going to show this as an example By this position part here. Actually we're gonna create a new part. Why not? Let's just create a new port. And we're going to call this the trail part. And what's going to happen with this is we will actually need two more things in here. And those are gonna be attachments now. And because there are so many things that we could add, an insane amount of things that we could add. It's best to go into the searcher object here and then just click or search for attachment. And this is going to add an attachment. Now it used the attachment right now is inside of the inside of the part and not really visible to us. So what we're gonna do is we actually have to get this out of here. So something like this. And then we can do something like this. And now we have it positioned somewhat properly right here. Oh, let's do this. And then we can simply duplicate this attachment and then attachment here. And if we then make sure to select both of them by holding Control and then selecting the other one. We can actually see both of them here. And I think that as this is fine. So the idea is that a a trail that needs to attachments and then the trail is going to be drawn between those attachments. And then it's going to be a flat lets, you can imagine it as a flat piece of paper that is moving with the piece. We're going to see this. So we can add here under the trail part a new trail, right? And then under the properties, we have attachment 0 and attachment one. And this is exactly what we need to do. So we need to click in here and then specify which attachment should be there. And then even inside of the inside of the well, not with the game not started yet. We can actually see this already. As you can see, there is the trail and if we move this direction, nothing has happened but this is gonna work. And then we basically do something like this crazy raising us. Now this is going to look a little bit weird, but this is simply because of the fact that there are somethings. So the maxlength right now is 0. So there is no maxlength or this, or this for this trail. So as you can see, it's going to be, you know, as long as it wants to be. This happens when the trail has a max length of 0. I would say, let's make the maxlength about 16 here. And the great thing about the color is that we can, so we can just choose a color. Let's say for example, sofa like oh my god, let's go with a red rate. And then if we move with the part, as you can see now, the trellis red. Now if I go really fast as you can see, it actually follows me sort of because the max length is 16 and it doesn't just extend forever. We can also look at the lifetime. This is basically how many seconds it's going to stay. Active, right? Maxlength, minlength, and then there's a scale as well. But I think the lifetime, you can also say, well it's, it's, it's almost, it basically never there and then you're not giving them a C at basically. So I think that a lifetime of T2 is going to be pretty good. That's pretty nice. And whoever the color, I actually think, think that what's really cool is you can click those three dots here. And then you can actually make this color gradient, right? So you can say, well, here, right now, I wanted red, right? That's OK. And then here I actually wanted a little bit more. Maybe like, you know, maybe you'll make it sort of like the rainbow, right? So there are one pink and an year. I sort of want it to be blue and then your, I want it to be green. And then here in the end, I wanted to yellow. And then you have like a crazy color rainbow, and then you just close this. So this would be a color sequence. And then if we take a look at this, then as you can see, it's actually going to change its color. Now, it's not long enough to display the entire color. So this is what I've seen. So what you need to do is you can just set, let's say for example three to making the maxlength 32. And if we now press this now you can almost see the entire color here. It, it still hatched the catch up a little bit. So we've probably added a few, too many colors, but this is sort of an idea of a trip. And now we're going to see how to add this to the player. So this, what we do is we can just duplicate this trail just for the sake of argument. And we're going to add this to the server storage in this case. And then a new script in the server script service. Of course, and we're going to call this the player trail. And this is also going to have this one player trail. And then let's see what we need to do. What we need to do is we need to get the players again. So this is going to be simply game dot naught archival, but players. And then what we're gonna do is we're gonna say player's dot, player added. This is of course what we've already seen. We're going to connect it to the player, added event and add a function here with a player. And then inside of here we're gonna say player dot character added event. Now that the character Edit Event. And we're going to connect with this as well. And this is going to have a function with a character because we will have to add it to the character. Has Rector, the ego. Because once again, the character has the model, right? So first of all, we're gonna get the trail and by we're gonna use, we're gonna get this by going to the server storage and then going to the trail. So we're going to do trail Diego. And then we're going to clone this. We've already seen the clone function once before. And in this case we're actually going to use it with something. And then this trail is gonna get a new parent and the permanent is gonna be the character dot head for the sake of argument right now. And then we need to add two attachments, right? So we need to add the first attachment. So attachment 0 is going to be an instance of new attachment. And this is going to be at Character dot head. So this is just the parent was we were going to supply the parent immediately. That's why not. And then it's good practice to actually give it a proper name because my not so we're just gonna save trail attachment 0. And then the second attachment, we can just copy this. That's gonna make it a little bit quicker right here. So we're gonna change this to attachment one. And this is still going to be in attachment and this is going to go to humanoid routes part. Now, there's something to be said about putting the attachment somewhere else. I would say right now, it really doesn't matter if you want to play around with it a little bit. Put it somewhere else in the character. But right now that's going to be fine. And yeah, so then we're going to say Trail dot attachment 0 is going to be equal to attachment 0. And then we'll just copy this and replace the zeros with ones, right? And now this, each time a new player gets added, and then each time a new character gets added, we're going to add this trail to it. And let's just see what happens. I mean, why not rate? So we're in and nothing has happened yet, but as soon as I start moving, we're going to have a trail. And this looks pretty cool actually. So like I said, there is something to be said about maybe putting it somewhere else, right. Like lower down and not as high up or something like that or maybe you want it as the, as the shoulder. So it looks like sort of a cape. Of course, that's something you could do in theory. The only thing that you would need to change is where this attachment is, will attach to basically read on the character. We get that is it for the trails? It's a short little something that you can play around with a little bit. And the trail is just a fun little thing that can be added to a game. Basically for the player or even for objects in theory. So in one example was that when you swing a sword, you know, you could maybe have a trail that's and that's the color of the source. So it looks like it adds motion blur or something like that. So yeah. Yeah, that was it for trails. If there are any questions, of course, always feel free to ask and I'll be sure to respond. And yeah. 33. (Roblox) Make Parts that the Player can collect: All right, welcome back to the roadblocks course. And in this lecture, we're going to look at creating parts that you can pick up. So those are not going to be things that you pick up with your hands, but rather sort of healing pickups and damaging pickups and also something like golden nuggets, let's say. So let's just go inside of our workspace and read a new part. And we're gonna work with this. So first of all, when I scale this down a little bit, we're going to make something like this. That's fine. And then let's make it like a block almost. Yeah, I like that. That's good. Okay. And we're gonna call this, we're going to pull this part a pick up. And we're going to duplicate this three times. Before we're gonna duplicate it, we're actually going to create a folder in sort of a workspace. And we're going to call this pickups because our workspace is getting really cleared at this point in time. And yeah, so let's duplicate this three times and then let's let's just make it so that one of them is sort of golden. Let's, let's make it this one scholar. And then we're gonna make one that's red. And we're gonna make one that's gonna be read. Now we're gonna take this green shirt. So it's almost like a traffic sign. But not quite, right. And what's gonna happen is, so first of all, we're going to add a new script to this. So this is going to be the gold script. This was called the gold script y naught, right? So this is called Script, Script. And well in here, what we're gonna do is we're gonna get the players again. So we're gonna save players equals workspace. No, it's game dot players, of course came the players. Then we're gonna say local gold nugget, let's say, or gold coin. It could be a gold coin or it could be a gold box or a gold. What will you say? Cube, whole cube. Let's call it gold. Gold cube. It's gonna be this script dot parent. So the parent of this, which is of course this pick apart. And then we're going to add this gold cube, gold cube dot touched. So we're going to use the Touched event and connected with on part touched. This is going to be a function that we're going to define here. Instead of this. This is going to be a local function on part touched and then other part. So we know what, who touched us. And the idea here is that we're going to check whether or not this is a player or a humanoid. So first of all, we're going to say, okay, we're gonna get the parent of the other part. So we're gonna say other part, dot parent, right? And then we're going to say, well, you know, if you have a humanoid, then we're going to be fine. So if we have parent and the parent dot, dot, dot colon, the find first child, which, which is a humanoid, right? Because the idea is that if we have a humanoid, so if the parent has a child that is a humanoid. We can, then we're making sure that this is the player who touched it. This is sort of the idea. And the first thing that we're gonna do is we're gonna say gold cube. Once again, colon destroy. So we're just going to destroy the gold cube because we wanted to pick it up, so sort of speak, right? So like in Mario Brothers for example, if you put two Dutch gold coin, it also disappears. And then we're going to get the player. And what's going to happen here? How are we going to do this? Is we're gonna say, well players. And then we say it gets player from character, right? And because the parent here, this is our character. Actually, we can just pass this in. And this is going to get exactly the player that has touched us. So that's really good. And because we have added the liter stats, we can also get the leader sets by doing player dot leader stands because this is a, this is the folder that we have created in the leaderboard one. And then we can say exactly the same thing that we've set with the clicker. So we can actually go, we put in theory go to the liquor example. Where is it? Click detection, right? And we could just say this code and then just put this in here. Well, we need this one. They go like this, right? You can just copy this code and use it here, again, inferior. Now that's also something to be said about possibly making a function somewhere else. We're not gonna deal with this right now. This is, this is gonna work however, right? So this is one of the things that we can do. And yeah, so this, what's going to happen is when we pick up this gold block here, we're gonna get another gold, add it to our leaderboard. Now the other two are actually going to be something else. And this is going to be the yield script, right? So this is going to be a hill. And the great thing is that because we've used this already, we can just quickly copy this over. And we're going to not call this a gold cube or let's say he'll cube, right? And then just make sure that the references here are okay. Then instead of actually this, we are getting the leader sets and all that. We are going to say. We actually don't even need the player because the parent is already the, the character. We can just say parent dot humanoid, humanoid. Well in theory, we should also be able to say just humanoid, humanoid dot health, because the health is stored in the humanoid and then we're going to say minus 25. So, well actually this would be plus 25 because we want to heal. And then I've taken something a little too quickly. The other pickup, this is a red one. This is going to be hurt. And this then is a third part. And this when this one is going to player. So this is the basic idea here, just three examples of what you could do. Let's just do something like this. So let's just set them up, sort of in well, let's actually set them up like this just because just because I do want the traffic lights to be there. And then we can just copy them a few times, maybe. Let's do this and then make sure that they are inside of the pickups folder. And let's duplicate them. And that's going to be fine. I think that that's fine just for demonstration purposes right now. And let's see if this works. So it should actually work. Everything should be fine. So if we now get this one, we should get a gold and it gets destroyed. Exactly what happens. So as soon as we touch it, we get a gold and it does get destroyed. Now if you touch this, we should get hurt. I see other way around. Ha that's kinda funny. Okay, well, that's that's unfortunate, but there you go. So that's of course, well, so much for that one. So much for that one. Really read, let's take really Greenland and let's delete those because that's that's a blunder I would say, but that's fine. Nothing to worry about. And this of course also happens when you just name them pick up parts. So better naming scheme of course would be hurt part and then maybe your healing part, her part healing kit. The other thing, I don't know, Spike. I mean, not really spike but something like that. So now if I get those, as you can see, I'm getting damaged. And then if I pick up the other ones, I'm actually getting healed. Right? That's that's really cool. So those are sort of like what would you say? It's not really pick it is a pickup, but it's not a pickup in the sense that you get something that you'll inventory. Sort of like, you know, yeah, pick up like a coin or something like that. That's how you create those and how those parts automatically get destroyed and that happens with it. Yeah, so as you can see, we're starting to stack up a few of the things that we've learned in the past lectures and stacking them on top of each other, right? So we have the idea of the getting the players. We have the Touched event, we have the humanoid, we have the leaders stats. So we're starting to put together a few of those things and see how they can work. Interconnected, let say. And yeah, so like always, if there are any questions, always feel free to ask and I'll be sure to respond. And yeah. 34. (Roblox) Services Brief Overview: All right, welcome back to the roadblocks course. And in this lecture we're going to take a look at services. Now, we're not actually going to do anything really with services. I just want to provide a brief overview of what services there are and then sort of go into why should we even use services, what they're for and sort of in that direction. So this is also going to be a more theoretical approach and a more theoretical lecture. Well, yeah, let's just dive in. So as you can see, we are currently on a website, so we're at roadblocks fandom.com. And this is a really good site for an overview of surfaces. Now some of those services are no longer in-game and some of them are silane game. But it is a good idea to just take a look. So as you can see, there are quite a few services are listed here. And if we, for example, say, Well, let's take a look at the Batch service, right? So the Batch service, you've probably played a game whether our badges that you can earn, right, sort of achievements. And the batch services used to sort of track how, who gets certain badge when they get a batch and so on. And if we take a look at the site for example, and as you can see, they have a brief description here, right, can be used to get information about badges and to give batch to a user. So this is sort of a, an idea here. And then you can also see what functions there are, what events there are that can be used there. And the great thing about the list here is that it has a, well at least a short description of what the individual service map does. And well, let's just switch over to row blocks again. And I've prepared a little something. So we've already seen that you can either take, get the player surface by just you doing game dot players. Because all of those objects here in, inside of the Explorer, they are also all services. Some of them even have the name service, right? So the script as a service Script service which we've been using for our scripts that has the name service and an sound surface. We have not used that test or localization service. We've also used that, right? And as an example here, I have the players in the player service, right? Which is this one, like I said. And if we just run this and let's see what's a good sprint out? Well, we can see that players and players gets printed out because like I said, both of those things are exactly the same. So it is equivalent if you write game dot players or if you write game and then get service players. However, of course, this one then yields two or you can also get services that are not inside of the Explorer. For example, let's just say, for example, a variable and then say game. And then we a service. You've already seen that when I then put in the string variable, that we actually get the suggestion for all services that are in the game. And there are, like I've said, a whole bunch of them. There are really a lot of services. And what's going to happen is during the, let's say evolution of this course. What I wanna do is each time that a, another service is needed, I am going to go into. Service, you know what, before we needed, so before we actually apply this. And some of them might be the marketplace services, one of them that I definitely want to talk about. So especially when we go into the more intermediate and advanced topics in roadblocks programming. So right now we're just covering a little bit of the basics, like I said. And as we go into that, then we start to need more and more services because the services, the idea of them is that they are, you know, they have events, they have functions and properties that just make it way easier to deal with certain things. So for example, the marketplace service rate, you only need to supply a when we have democratized servers. Let's see for example, right? And then we can do example dot as you can see. So first of all, there are some of the events here. So prompt bundle purchase finished, we have a prompt purchase finished. So there are some of the events are the finished purchases. And then there's also some methods. For example, we can get the product info, we can get the developer product. And that's an asynchronous coal. We can also say, hey, prompter bundle purchase of prompt, a game past purchase. And that is, that simply then makes a GUI appear that says, Hey, for who does that. You can supply a player basically. And then for that player, it's gonna say, hey, how about you purchase a game pass and then you just have to put in the game pass ID. And then this can of course be called, for example, when someone joins the game. Or it could be called when someone goes to an NPC and talks to them or satellite that. So there's really a lot of ways you can do it in this example for the marketplace. But once again, this is something that we're going to look into when we really needed. I just wanted to give a brief overview, summary of services. So they are just incredibly useful. And instead of just going through each of the surfaces and just saying, okay, the services for this the services for this. First of all, I would argue at least half of the services are very rarely needed ever because they're just, you know, there are so many services that they're basically for almost every eventuality, right? So I think that not every Services always needed, but some services, of course, like the marketplace service if you want to put in game passes, or the Batch service, if you want to put in badges. Those services are of course, well needed very often. And if we, for example, look back at this, as you can see, there are some services which might of course be a really interesting. So for example, here we have the game past service as well, right? All we can look at the, let's say the localization service writes something that's actually inside of the Explorer as well. And with that, for example, we can make it so that, you know, certain strings are actually localized certain languages, because of course, maybe not everyone speaks English and so our game should be accessible in different languages as well, like I said. And most of the services will be going through when we are actually using them. Right. So that was basically a just short little overview of the services, like I said, more theoretical right now. And then when we really get into the intermediate stuff, we're going to see more and more services come up and we're actually going to use more and more of them services. Because, you know, the more advanced the topics or the more advanced the things we want to actually do, the more services we might need. And yeah, that's basically it. So if there are any questions, of course, always feel free to ask and I'll be sure to respond. And yeah. 35. (Roblox) How to navigate the API References on your own: All right, welcome back to the robots course. And in this lecture we're going to take a look at the API references over on the roadblocks developer, the manual basically. And the idea here is that I wanted to give you sort of the autonomy to actually look up some of the issues before you ask questions that could be easily answered by looking at this API reference manual. Because in the end, you know, you can't always rely on questions. Sometimes, of course there are useful, but I would argue that if you can use this, this makes you at least ten times more powerful in terms of programming for roadblocks than if you don't have any of this material at hand. So first things first, I've of course included this as a, as a resource here. And this is what you're going to see first. So this is basically the API reference manual. So it has all sorts of classes, data types and functions and all of that that are used for roadblocks creation. So for roadblocks games. And the first thing that might stand out is, for example, the part, right? So let's just look at the part. And we've all seen what a part is. We've instead instance dot nu apart. Like here. We have created parts in the Explorer. We've resized them and all that jazz. And here there is a short description. So we've always had a very short description of what this particular object basically is, right? So as you can see, right? Part is a physical object and it's when it's in the workspace, you can move it, interact with it. We've all seen that. How can you edit a part? That is how you create a new part. We can, there are different types of parts. We've not seen that yet, but we have seen normal parts. And then we can also see the properties here for the specific part or also inherited from the base part. And then we can also see down here the, the functions right from, that are inherited from base part. And then completely down we have events and we've already seen the Touched event, for example, right? Fired when a part comes in contact with another part. So this is, we've all seen that before. And a, Well, actually like in-game and we've actually seen how this operates. So this is pretty cool, right? So we can actually look at what these things do. And if we go back to the API references, there are of course, some other things that we can also take a look at those, basically the frequently used clauses and services. And we can also look at the lower references down here. So we've seen some of the libraries with the math library. We've done, uh, at an actual lecture on string library, we've seen a few things of that, the tables and coroutines. So the other things we have not taken a look at because I didn't deem them as important right now, but you could, of course, look into them as well. And then what's really good is you can filter clauses here. So for example, if we say looking at the last lecture where we looked at the services and we're like, well, I don't know what about the players? And you just type in players and as you can see, we don't hear, we get gameplay players. So this is the service that we might take, okay? And that is also play a scripts and startup players scripts. So we can also take a look at that, but let's click on players and let's see what this is. And you can see this is a service. So it always says, okay, what, what, uh, services or whether or not as a class as a service. And then it also says, hey, you can't use the instance dot new to actually create this object because, well, it's a surface, right? And the idea is that a service cannot be created. There is always only one service of each type, so to speak. So there's a player service that was the server script servers, and each of those is only there once. So there can't be two players services because that doesn't make sense. And yet that we can see, for example, the properties of this particular service and then some other functions of this particular surface. And yeah, all of that. So the idea here is that there's a great resource and I really highly recommend that if you ever want to know something about a particular class or how does this work? I don't, I don't understand that. You can always go in here and look at this. So for example, I don't know, maybe you want to know what the terrain is about, right? We've not taken a look at that yet. And then you can see that a few things there, you can see the properties that are there with a short little description. So I'm actually, every time I look at the API reference, I'm always impressed because it will actually really well done and it documents a lot of things really well. And so I really recommend if there's a certain topic that you maybe doesn't work, that you first go into the, into the API references and look at it a little bit, and play around with it a bit. And then if it still doesn't work, of course, you can always ask a question and I'll be short respond. However, like I said, it does make sense to give you a little bit of autonomy year to basically make you even more powerful with your knowledge, basically, yeah. Right. And as a last thing, if you, for example, want to look at some of the other services that there are, you can of course type instruments here. And then you're gonna get basically also a list of all the services that are in here. So for example, we could take a look at the marketplace service right here, right? So this is under the monetization, a group and the marketplace service, we can actually see some other things as well, the properties and functions. And the great thing here is that all functions here have a very nice description to them, right? Sometimes those descriptions are available inside of robot studios and sometimes not. So it is not a bad idea to actually go in here and look at those descriptions because they can save you a lot of hassle because usually the name of the function is, has, is very descriptive. But sometimes a description of course, is insanely valuable in this case as well. So yeah, that is just a basic overview over the API references. I highly recommend checking them out and just looking at them a little bit. Especially if you have a certain thing that you wanna do, they might actually yield an answer to your conundrum. Yeah, so that was it for this lecture, and I hope you enjoyed it. If there are any questions, of course, always feel free to ask and I'll be sure to respond to and yeah. 36. (Roblox) Screen GUIs in Roblox: All right, welcome back to the roadblocks course. And in this lecture, we're going to take a look at GUI's. So GY stands for graphical user interface, is basically the interface that you see displayed where you can click buttons or you have text displayed on your device, on your screen. Basically. Now there are three types of GUIs that are available in roadblocks. There is the screen July, there is the billboard Gy and that there is the surface July. Now in this first lecture, we're going to take a look at the screen GUI. And then we'll have two more lectures where we take a look at the billboard GUI and the service July. However, if you can manage one, so if you know about one GUI, you actually know about all three of them. They are very similar, right? So to start with this, we're gonna go to starter GUI here. And as you can see, it actually already is in GUI mode up here. And we're going to use the Explorer here. We're going to press the plus and we're gonna make a new screen GUI. Now, if we go to the swings UI, we can. First of all, we're not gonna see anything right now. But if we then make a go to the Plus Again, we can actually insert a framework for text button or some other things. We're going to use a frame for now. As you can see, something appears in the top left corner. Now we can actually click it, click and drag this. So this is the great thing and white, so unbelievably powerful. The gy is very easy to modify and actually create. So it's very easy to create good-looking GUIs and also just to test out GUIs in general. So that's a really well-done in robot studio. Now, what we can do is we can write, resize it here. Now if we hold shift and sorry, if we hold. So this sometimes happens, right? So now I'm back in the normal mode here, right? So there's normal select mode is important if you want to go back to then modifying the GUI, you actually have to go back your interframe, for example. And then we can move around or you can just click in screen GUI. And then we can continue modifying this. So as you can see, sometimes you can't really do that. So then we select frame again and then we can modify it again. So if we hold shift and move it, then it's going to stay in its ratio. So the ratio is going to stay the same. And then when we use it, as you can see, there are also some helper lines. So we can actually centered into the center of the frame. So let's just say we want something like this and we want it centered in both directions, so something like that. So now it's actually in the center of this July. Now we can add stuff to this frame. So as you can see, there is also a scrolling frame. This simply means that there is a bar and that you can scroll with the mouse wheel. When over it, there is a text label. It text button, it text box. So the text label is just a basically something that were Texas written that you cannot change. A text button is precipitant button with text. So we're gonna add this. As you can see right now, it's added here at the same position as frame. So as a child of the screen Guido. But actually, let's make it a child of the frame. And as you can see that it moves into the frame immediately. Then we can basically put it here, for example, have a button down there. And we're gonna take a look at the properties very soon. But let's just create a simple GUI and then we're going to see what the properties hold for us. So let's also add a label. So instead of doing it up here, I do think that this makes more sense. So for example, text label, then it actually added that the frame immediately. So let's put this label no sort of here. And let's just let it be called label for now. That's fine. And images are a little bit more complicated. So for us to use and our own images, we actually have to publish the game first, but we're not going to worry about that right now. Rest assured that the images, or actually not as hard to use as one might think. But there are some other things that are important. So let's, for example, say that, Well, actually, this size window, is that, is that normal? Well, I mean maybe but no one really plays like that. Most of the people probably playing full-screen rate. So if we actually scale this as it were, make it smaller. As you can see, this stays sort of the same, right? So the, so the size here say sort of the same if we do this, now it's sort of stays the same as well. So let's kinda good, right? If we go into this little button here, we can actually change to the view that we would have with this GUI in mobile mode. It's OK, it's right, it's not, it's not the worst thing, but it's also not the best thing. And what we can do is, and now we actually go into the properties and this is one of the most important properties in G wise. If you take nothing else from this video except for this fact, I've done my work basically because the gy is there is one important thing that we need to look at and that is going to be size. And there are two ways that size works. So there is a scale and an offset. And the offset is the size in pixels. So currently this, the frame here is 455 pixels in this direction and 25056 pixels in this direction. So this is the size of the, of this frame. Now that's ok. However, the debts means that the frame doesn't scale. So as you have seen, the frame stays the same size would ever my size of the window is right. So then you might say, well that's basically what I want. But I'm telling you this is definitely not what you want because if we now scale it a little bit bigger, and this wouldn't be an insane lee big, let's say GUI for the PC, right? So if you have this, okay, it's above most of the screen, but it's not insanely big. Well, if we now switch to mobile, as you can see that this is just not working, right. So this takes up almost a 100% of a frame. So that really doesn't work. And this is because the scale here is set an offset once again now if scaled it up, and so now it's actually 723 in the x direction and 355 size in pixel size in the y direction. And what we want to use is we want to use scale because then it actually scales in percentages with the screen size. So let's first, first of all, set the offset to 0 and then it is going to be 00. And then the scale is basically percentages. So 0 is 0%, 1 is 100%. So if we set it to 11 here, then it would basically take up the entire screen. Now, there's a, this doesn't sit in the middle right now. So there you go. So now it actually takes up the entirety of the screen here. And that's of course not what we want. We want MRC maybe something like arrow, maybe 55% in the x-direction, sorry, it's 0.5 the ego, and then maybe something like 0.0025. Well, I made a little bit more. Let's say let's say 0.35. Yeah, that's okay. Right, and then we can move it around. And now what happens if we actually scale this, as you can see, actually scales with the size of the screen. And we actually need to do exactly the same thing for the children here. And we can do this by also using scale. So for example, instead of 200, we're going to save somebody 0.2. That's maybe a little much, maybe one, that's fine. And then 0 on the offset. So that's actually do 2.2 at 0.2 is fine. And then we're gonna do scale here as well, and that's going to be 2.5 maybe. And then of course, let's now it actually is also point to five. Yeah, that's actually okay. That's fine. Now the button is actually kinda nice and under the label, of course, needs the same treatment as well. Let's do 00 first and understood 2.52.25. And then we can also center it again, something like this and like this. And now when we resize this, as you can see, everything sizes with it properly. And if we look at it inside of the mobile view, it looks great. But instead of having this thing be giant, We actually have it in a relative size to the screen. And this is basically the most important thing that you need to take away with. You want must always use scale or the size otherwise. Well, it's just gonna, it's just, it's just a bad idea to use the, the not the scale, but the offset and determine the size of each of the GUI elements in pixels. It's not a good idea. You know, people have varying different screen sizes. And so it is very, is a very good idea to use this because that's gonna save a lot of headache in the future, right? But let's take a look at a few other properties here of, for example, the texts label right now. So one of the important things is, of course, down here in, under texts. So we can choose a font, right? So we control, for example, say arrows of the like, legacy or you know, Oswald or know, well, maybe rubato robot was pretty good. And we can have a line height. So if we do three, then it's a little bit higher up. Or we can just say, keep it at one. And then we can also make it do rich text if you don't know what that means, it's not an important basically just means that you can. Sort of set the, the formatting a little bit differently. And then here we have the text variable or the sex property, and this is what is written as a label. So, so for example, we can say hello, player. Please enter your, enter your name, right? And then we send that. Then as you can see, now the label actually has that in there. And what's also important, as a quick thing, we've changed the size of coarse, and if we now resize this, it's not going to use the pixels again, but it's actually going to resize it based on the percentages. So this all works perfectly well. Now, sometimes as you can see, in this case the actually overflows the over the label. We can change this by saying text scaled. And now the text actually scales with the, with the size of the label as well. So that's, that's amazing that this all works basically out of box, right? We don't have to do any scripting for that whatsoever. It's really nice. We can actually say, also say the alignment, whether or not it should be centered or no left aligned or right aligned. Right here. And yeah. And then, well, let's actually, let's skip it centric, Yeah, let's go. We also can add a stroke, so the stroke color right now, of course, doesn't make sense because the text is black. So maybe let's say we make the text something like notice or blue. And then the stroke, we can make this red with just, just for demonstration purposes. And then we can say the text stroke transparency is 0. And then of course we are going to get sort of a, an outline for the text. And this of course, doesn't look very good just for demonstration purposes only in this moment of time. And well, let's take a look at the properties for the button. The properties for the button have a similar texts property because of course this is a text button. So we can actually have a text in here as well. So let's just say send rate and then turns to send. We can also say here text scaled would also agree that that makes sense in this case. And then there is not really a whole lot more for the button in the properties. However, what we can do, and we're gonna do this pretty soon. We're just going to resize this a little bit. We're going to add a, another thing to the frame here. And this is going to be text box. And a text box is basically a way for the user to enter text. So when a player joins your game and there are going to see this Gy than they can actually enter something in here. And as you can see, I've actually written right, hello player, Please enter your name. So this is going to be the textbox. We're actually going to look into what's written in there when the player hits send. And then we're going to output this into the console. Now for that to work, we actually want to create a new script under the button. And you can see it actually already says local script. And this is of course something that needs to be a local strip because Not right now we're inside of the GUI. So we want to use a local script and we just added this under the button. And so we're just going to say, you know, Example button script, there's going to be r. Example buttons, script, and we need a few things. And so the first thing we want is the button itself. And we can actually get this by using scripts dot parent. So the script simply refers to itself. So in this case, script would be our local script and the parent of that as of course, the button. So this would yield the button. And if we then say local screen because we also want the swinger UI, then what we can do is we can say button dot parent, dot parent. And why is that the case? Well, because the parent of the button is the frame and the parent of frame screen Gy. And we want, in this case, the screen GUI. So yeah, that's the two things that we need. And we want to use a Kinect, so we want to connect to a, an event again and the event is button dot activated. As you can see, that's an event and we just connect this with a, let's call this function on a button, activate, activated a ego. And what? Let's create this as a local function on button activated. And inside of here, we're just going to first of all, printout clicked rate. And then we're going to say screen dot enabled, enabled, the Ego equals false. So this simply turns off the screen in July here. So I mean, let's just, let's just try this and see what happens if we now actually start the game. So when we start the game now, what's gonna happen is that we're going to see this GUI here and we can hit send and then it's going to disappear and we're going to print out button clicked. So let's try this. And of course it didn't work, so button clicked and that the GUI disappear. So this is what happens. Oops, that's not what I wanted to. So this is basically what happens here when we print button click with them. That makes sense. And then screen January, July, or screen enabled equals to false simply turns off the screen. And now what we want is we want to print out hello player or hello and then the name that you put into this box here, right? So the name that we put into this box, we actually want to print out. And they can do that by saying, well local text. And then we say, well screen, we know that we can get the screen by using the screen variable. And then if we move down here, we can go to the frame, so we can say frame. And then we can go to textbox, text box. And as we have seen, or we can see, we can just select a textbox, look into the properties and see, well, what would this be cold? Well, it actually is also called dot text because it's, it's empty right now. And so we can say, well, okay, dot text. And then we can simply say print hello. Let's say hello, and then just text. Right? So let's just try this. Let's save this and try whether or not this works. So what we would expect right now is we want it to print out button clicked, then the screen should disappear. And then it's also going to say hello and then whatever I put into this box. So let's just start it. And let's say for example, I click into this box and here, as you can see, I can write in. So I'm just going to say hello. I'm going to say come due. And if we send it, we would expect, first of all, button clicked and then also hello cotton Joe. Let's see. And of course it worked perfectly. So first button click was called or executed and printed out. And then hello, calvin Jew was also printed out. So that's actually how easy it can be to go in and play around with the GUIs. I really say this. I would definitely advise to go in and just play around with a Jew eyes for a little while and just, you know, tamper with it a little bit. Look at look at what you can do. So yeah, the most important thing, however, that I have to say is really the size. I cannot, I cannot. I emphasize this enough really, because the size is so important that you always put it to scale instead of offset. And if this is like I said, the only thing that you take away with this GUI lecture are unhappy because the, the size, the recyclability in its, you know, when you do it on automatically. It's amazing and this is one of the hardest problems in game development, let's say in general, to make sure that every screen size is accounted for. And that robots just does it out of the board so that robot students just, this works with it. Amazing. So this is two a, it is actually basically amazing feature, a great feature. And I really advise you to always use this and never to use the pixels. The pixel size, yeah, yeah. So that's that's basically it for the screen Gy. And it was a little longer, has lecturer. But I think that it's important that you actually get to know every bit of the GYE functionality. And yeah, so that was it for the screen July. I hope that was informative for you. And if there are any questions, of course, always feel free to ask and I'll be sure to respond. And yeah. 37. (Roblox) Billboard GUIs in Roblox: All right, welcome back to the robots courts. And in this lecture we're gonna take a look at the billboard Gy. So we've seen the screen GUI, but now let's take a look at the billboard GUI. And first of all, what we're gonna do is we're going to actually disable the screen July. And we can do this by just hitting the enabled and setting it to false. That's basically all we need to do. And now the UI is gone. Now the billboard GUI is basically something that appears above, let's say a certain part. So let's just create a new part here in our workspace. And let's call this part the school. It's the how about billboard example so that we know where it is. And we're going to just click on the plus and then we can just search. So if he searched GUI, as you can see, there's a billboard UI, the screen GUI under the surface July, right now, we've already seen this mean GUI in the last lecture. And now we're gonna take a look at, at the Bellagio. If we actually hover over it, you can see that a GUI that adorns an object in the 3D world. And then we're just going to add it and see what happens. So as you can see right now, nothing happened. Now that's perfectly normal B, we need to add a new frame for this. And then as you can see, we've already have something in here. So once again, the frame, it's important that we actually scale this thing properly. So let's just do 101 for the scale right now. And let's also take the billboard jy and go to E is going to be the size offset. And let's actually put this to, let's say one. So it actually hovers over the order a bit. You can also do 1.5, something like that. I think that that's fine. Now as you can see, this actually also, this gets bigger as the further we go away. But we're gonna, we're gonna take a look at that soon enough. So the frame inside of a frame, this works exactly the same as the the other GUI works. So inside of the frame we can add a text label. And this text label, of course, once again, I definitely advise to look at the scale, scaling one more time. And then let's say for example, instead of your weekend, save the text property, we can say, for example, this is the, this is the nonpolar part. Let's call it like this. And then we also scale the text is a little bit, but that's, that's going to be fine. And let's just see how it looks in game. So if we go in, we can see example part Now it's quite big and as you can see, the further I go back, bigger it gets. Now that is, of course, that is of course ridiculous. Not quite what we want because especially if you have it like here, maybe this is, you know, maybe this is a shop or something and you want to have it be that everyone sees, oh, there, there's a shop there. You know, that's really, you don't really want it to be, get bigger as you go back and you can also see it here. So that's definitely a scaling thing that we don't want. And we can change this by once again, changing the size parameter. So now I would add 11. So the scale at 11 is a little small, I would say. But if we scale it 12, maybe a little bit. Let's say something like a. Let's say 87. I think seven is fine, and then 22 in this direction. Let us that's pretty good. I think that that's a thing that that's fine. And then all of a sudden, once again, we don't use the pixels, but we use the scale. And then it actually works out very well. So there you can see that it's gets smaller and smaller. And at some point of course you can read it anymore because it gets so small. But that's a very good port for the billboard GUI. It always faces the camera as you can see, right? So if I turn the camera here, it faces the camera always, in whatever way I turn the camera. And what's also important when we have the billboards UI, there is this max, max distance. Now this is currently a very big number. This is basically infinity. So we can always see it and we can say, well actually, I only want it to be seen from 64 studs away. So if you do that, then what's going to happen is as we go further along and all of a sudden it disappears. And if we go back and we are in 64 radius, then it's going to be up here, right? So that's also a very useful thing to know. So that's a very useful property to actually actually use, right? So overall, this is the basic, let's say, billboard GUI. When it comes to the frame and the text labels and all that, it works exactly the same as the, as the normal GUI would. And yeah, so this is a quick, let's say overview or example of a billboard GUI. If there are any questions, of course, always feel free to ask and I'll be sure to respond to and yeah. 38. (Roblox) Surface GUIs in Roblox: All right, welcome back the robots course. And in this lecture we're gonna take a look at the surface Gy. Now, we've seen the billboards UI, we've seen the screeners UI. And now off to the surface Gy, we're just gonna create a new part again instead of our workspace here. And we're going to call this the screen. Now that's actually the surface yet it's a surface sample. And the surface example is, let's actually resize this a little bit. So make it like a like a toll brick Yeah, like that. And then we're going to add, of course, the gy and there's going to be the surface Gy. Now, we're going to immediately go for the surface UI. We're immediately look into the sizing here is little bit different as you can see, those pixels per study. We're just going to keep it like that for now and we're gonna take a look at what that means later. So right now, let's just add a frame again. And as you can see, all of a sudden, we actually have a frame here on this part. So if we look at this, there is a frame there. And if we then put in a text label into the frame, then it's going to be inside of it. Once again, a frame should probably be resized to somewhat like this. So we can actually use as a 201. And now it's going to be the size of the entire surface. And instead of here, we can also do 11 for the label and then it's going to be half the entire size. Maybe x is only going to be 0.25 and the y is going to be 0.25 as well. Something like that. That's actually do it like this so that it's sort of a, you know, a heading. I like that. And then inside of the text label, which is going to also make it so that the text scales. So the text is actually bigger. And then we're also going to change the text to something like Nanoblock or I'm apart, I guess makes more sense on part. I like it. Yeah. So I think that the surface UI should almost be self-explanatory in what it does. It's basically just a GUI that as displayed at a certain surface of a part, we can of course change the surface by changing the face. So at this moment in time, it's face is a front. We could also say, for example top and then it going to be displayed at the top here. So as we can see, now it's displayed at the top. But think that the front is actually fine. Rate, that's pretty good, right? So there are a, there are two sizing modes, pixels per slot and fixed size. Now, I would personally say that pixels per study is actually the better sizing mode for us right now. Yeah, I think that that's better. Let's just quickly go in game and let's see how it looks. So as you can see, we have the example part and then I am apart and then it gets smaller and smaller as well. But you can still see that there is something written there. As we got closer. It doesn't really scale anymore because it is scaled towards the size of the part. But yeah, so that's I mean, almost basically it or if the surface July, it's basically just a GUI on a surface. While the billboard GUI is something that floats above a part, I would say. And the screen gy is of course a GUI for the entire screen. Just to give a short overview of both the surface and the billboard GUI. And yeah, that was basically it. And I'm hope that this was informative to you. If there are any questions. Of course, always feel free to ask and I'll be sure to respond. And yeah. 39. (Roblox) Introduction and how this Section is build: All right, welcome back. Roadblocks course. And in this lecture we're just going to take a quick look and overview over the ABI we're gonna build in the coming lectures. So this is already the finished RB, So it's going to be a little bit of spoiler heavy in this case. But just to show you, what are we going to do? Where are we going to create and what is the idea here? So the idea is that we're going to create an RB that has a few different stages, which so just some parts strewn about. And some of them are moving, some of them are rotating. And in here we actually have a lineup of cannons that are gonna shoot a different parts of us that we have to evade. We have different checkpoints. So each of the stages here has a checkpoint associated with it, and we also have a timer. So we're just going to quickly run this RB. And as you can see here, immediately I'm in team one in this case and I have a time of 0. And when, once we step onto the first platform, you're, the timer is gonna start. So as you can see now the timer has started and now it is a race against the clock to finish this RB. And in the background as you can see, you can see the Ken's already firing of your touched this spawn platform, then we are going to be at T2. So this is a checkpoint and this is now going to be a really hard part to get through this without getting hit. As we can see, we've actually mastered it beautifully. Now we have a moving platform that's moving up and down. So we actually need to get on that. I was kinda lucky. And then after we've gone on that, actually have to have a little bit of a wait and go here. Now we have this rotating platform. I'd like to take the right way here because it is makes more sense now we have to wait for this one. Right now we respond at this spawning location because this is the checkpoint that we've done. And I believe that that is it for showing it, that's kind of the fine. If we go back here, you can see that these are also moving platforms. The last part here, after the rotating platform here, It's just this. And once we hit this finish line, then we have one RB and we're through, then the timer will stop and then that is it. Yeah, this is just a little thing that we're gonna do. First, we are going to model it. So the first lecture is going to be modelling the ABI. Second lecture is going to be adding the, the moving platform scripts. Then we're going to add the cannons back here. And after we added the canvas, we're going to add to the check points, which is not that hard. And then in the end, we're also going to add to the timer and the leaderboard that you have seen on the top, right. So this is just the short little overview for this section. And yeah. 40. (Roblox) Modelling the Obby: All right, welcome back to the roadblocks course. And in this lecture we're going to start creating our own first game is going to be ABI simply because of the fact that they are very easy to create. Of course, to create a great and fun RB is gonna take a lot more knowledge that we actually need to acquire. But I think that in this case, starting with an ABI is a very smart idea. Now the first thing that we're gonna do is we're actually going to just delete the base plate or just straight out. And we're gonna create a new part. You're just going to just float in the air. And we're gonna rescale it to something like, let's go down here to the size. And we're going to say 25125 is going to be at position 000, like that. And then I want to add a spawn as well. We can, of course, just add this by pressing the plus on the workspace and then adding a spawn location. And let's just actually add this, add zeros 00 as well. I think that that's fine. Great. So now if we, when we spawn, what's gonna happen is we're going to spawn right there. And oh yeah, of course that's going to fall down because it has to be anchored. That's one of the most important things, right? So people don't have a base plate. So of course, everything else is going to fall down. And so we're going to spawn looking into a certain direction. In that direction, I actually want to resize the plate here a little bit into that direction. So let us see. When we size it into there. That is not quite the way we are looking. So we're not actually going to size it into this direction and we're going to build, and we're going to build the I'm going to build this part out into this direction. We go, right? And, well, let's then just plane. And let's see. Yeah, now we sort of have a runway, right? So where we can go in and maybe a little bit too far in, let's say something like this. And then I'm just going to quickly make something. Let's add another part here. And we're going to do something like this. So we're gonna go to the park and we're gonna make it a little bit bigger sum, I've thought about doing something like this. And then we're going to start to actually rotated. But so this is something that happens. It's quite important. So if we want to rotate something and another part is in a way, then of course it doesn't work because they can collide. So this is E can collide behavior, a property here. We also want to set the anchor property. Otherwise it's just going to fall down again. And that's of course not something that we want. The max you're going to read you orientation. I'm actually going to reset it to 90. And then I'm going to also turn on the 45-degree rotation. So that right now are rotations, are. Fine. So let's just say something like this. And then we're going to copy this by pressing control c and control V to paste it in. And we can do some like sort of a, sort of some steps that are, have to be trespassed. And after quite a jumping puzzle, but sort of sort of way you have to jump from one to the other. And the good thing about it is that you can just play around with it a little bit. You know, use some of those, some of those parts and just copy and paste them now and now we can, for example, maybe rotate one of them so that we have something like this. And do something like that. Yeah. And then we, you know, what's important is to always try out the thing that you've created. So for example, at this moment in time, so this is a jump that we can make. This is all fairly easy, and this is a little bit of a harder jump, but not that hard, you know. And yeah, so this is something that you can do that then of course, we can also change some of the colors rates are there to make it a little bit more colorful. In this case, we're not going to create any new textures or anything, but we can of course, use the materials here to make it even more are something that we, we can call our own, let's say. And let's make this let's say a, you know, a yellow. Yeah, that's pretty good. Right? And then you can, for example, copy this again and then move all of the parts at the same time. Know something like this. And then we're going to also get them higher up a little bit here and then move them along a little bit further. And then let's move them on their own again. So maybe you can take this one and rotated as well so we can rotate it like this. So this is of course just, let's say you can just let your creativity. I completely just do anything that you want here. These are of course just examples I'm showing just so that you have sort of an idea of how to model it. Let's save. And well, that's maybe a little bit too high up. But I think that that's fine for, let's say the first part of this hobby. And let's see what we can see. So let's jump from one to the other and let's see if actually all of the jumps work. Let's see, that's, that's all. There you go. Okay, we're going to have to try this again. Now, I've actually thought about this before where it's like, well, how often am I going to have the have depths inside of the law was that was actually really close. This one. And then this one. Let's go OK. Well, it worked. So I'm going to count this. And then we can just copy that, say this platform here, and move it over into this direction so that it serves as a checkpoint system. And I think that that's going to be fine. And something like that. For testing purposes, what I would argue is the best thing is to just bring the spawn platform over because we've seen that this part works. And then the second part, we can just do it like this because we're always going to spawn from this location. It makes sense to actually move it over for testing purposes. And the next thing I thought about was actually mean something similar but a little bit different. So in this case we actually have a, let's say, straight line where we, where we have these blocks here. And we actually have to just, you know, jump from one to the other with no height variation. But what I want is I want to have like a line of, let's say cannons. You know, it could be Canons, it could be NPCs with something that are actually shooting, you know, parts towards you or maybe even rockets towards you. And you have to evade them while that's happening. Let's just add one more here. So something like this. I'm maybe something that and a little further out. And then one more. Let's say it's actually just straight jump. And yeah, and then add a new platform over here. And then we're going to add a new platform as well. So that's where the enemies are, enemies or canons. Basically it can rest on, right? So this is, should be sort of exactly what they are. And then we can also do something like a, like a wall at the back so that that you can see that there is something there, right, so that it's not just our platform, but you could also do Waltz on these sides. But of course, right now not necessary. So let's see. When we spawn here, everything's going to fall down. We'd love to see it. This is of course, once again, the anchored modifier or the anchored property. And then if we go in here, we're going to see that no, if we, so this jumps aren't the most difficult ones. He says just as he is about all down. No, of course not. And then we simply just need to add the let's say the things that shoot, we're gonna do that in the next lecture right now, we're just going to go through and design the entire course, let's say here the RB. And then we're going to see, so let's just also change the colors of these ports here so that we have a little bit of a variation in colors. I like that. Yeah, that's good. Then we have a say like a violet one. Yeah. And then down here, sort of like a red brick one. Yeah. That's good. Right. And then because we've seen we can do this, we can just take the spoon location over one again and then continue with the other one. Now in this one, we're actually thought about was doing something interesting. So let's just copy this part because this is going to be incurred already. Let's make it even by 15. Yeah, that's good. Let's move it over. Let's try to center it as best we can read. Of course, those little adjustments as well are, are things that you can always do. Your, when you publish a game, you can publish changes to it as well. So that's also kind of important to know. And what I was thinking here actually was I wanted this to work in such a way that we have a, so this platform actually goes up and down like a You know, like a lift on an elevator. And you actually have to get to this platform in a certain time. Otherwise the elevator is going to be out of sync. So we actually have to wait here. So you can imagine that trying to get the best time, you would then want to go through this as fast as you can or, you know, maybe weight at a certain point so that you get the perfect cycle here. And then there is going to be something else as well. So that's just gonna be a nother part which we're going to rotate like this. And this one is going to be sort of like a seesaw. So this one is going to center it, the ego. So this one is actually, what we're gonna do is we're gonna make it so that it constantly goes back and forth between this. Now not at such a stark angle, but like a little bit faster and a little bit more continuous, let say. And then you can make a choice whether or not you want to take one of three paths here. So for example, we have this path in the middle, which is going to be something like this. So it's gonna be a 45-degree angle. And then we have one in this direction. And we're going to copy this middle one. And we're going to have one in this direction. I'm gonna make it so that there are roughly the same the plane like this. And then this one's going to be a little bit higher up, and this one's going to be middle. This one's gonna be a little lower. And then to overcome this, it's actually going to be another moving part. So they are going to be a lot of moving parts right now. Once again, the functionality is added in the next lecture because I first want to model it and then basically add all of the scripts and the functionality. Because otherwise it's going to be like a 45-minute lecture. And I feel like, you know, splitting it up into the modelling, which might be interesting for some people, but might not be interesting for others. I think that that's a good idea, right? So those ones are just going to move up and down in a, in a certain pattern. And then we're going to just copy basically those three parts. So you can