Scripting Lesson 003: Basic Obby Levels

Welcome back all scripters to our third lesson. This lesson we will be talking about basic obby levels that you can make with the skills we've learned and a few new skills as well. We will talk about bricks that kill you, disappearing bricks, and much much more. This lesson is basically for you to understand a few basic scripts that you can add to most situations

Let's start with a kill brick. This is something new to us all so I will show a sample script that explains what each line is doing.

Now with line 2: Something we have not discussed yet is locals (or in other words: variables and values). That line basically just says that if anything in the script says humanoid, it actually means part.Parent:findFirstChild("Humanoid"). There will be a lesson on it later on. Now it's important that you do local because if you just do humanoid= part.Parent:findFirstChild("Humanoid") then that means every script in your game that says humanoid means that. And this can interfere with other scripts in a negative way.

Now let's move on to something we have talked about. How can we make it so the brick disappears and lets the player fall when he/she touches it. (That's right, not all Robloxians are dudes y'know...) Well we remember from previous lessons that all we have to do is do what I did in the following script. But since CanCollide has no number value, what do we do for that? Well if we want the checkbox in properties to be unchecked, that would indicate we want it false. We could also use the while true do function to make it automatically turn invisible after a certain amount of time being existant.

Now there is one more thing I wanted to talk about, and this is a difficult challenge for some of you. This is a script for a moving brick or...one that moves back and forth. This simple move script is incredibly helpful in many scripting situations in your future (Don't mind why it says curt, I use this script for something else)

So these are just a few of the things you can do when scripting obbies. Obviously I didn't tell you this for obbies specifically. I wanted to show all of you how you can use scripts in a variety of games. Next episode we will discuss how to make random things happen. For example, how to make a random number appear on the screen. Thanks for tuning in

-Domswolf