Stage 1: Ascending Walls
Prerequisites: Before You Dive In!
Before diving into the excitement of Stage 1, make sure you've completed these fun and essential steps!
1. Intro
Did you enjoy the grand introduction to Roblox Entrepreneur Part 1: Lua Coding and Game Scripting? We hope you're pumped up and ready to embark on this coding adventure!
2. Setup
Time to gear up! You've gone through the setup phase, getting everything ready for your Obby journey. From setting up your workspace to getting familiar with the tools, you're all set to unleash your creativity!
Now, let's dive into Stage 1 and start building your very own Obby masterpiece! Are you ready? Let's do this! ๐
Objective ๐ง๐ฟโ
Welcome to the first stage of our exciting Obby adventure! Get ready to climb to new heights as we conquer the Ascending Walls!
Description ๐๐ชถโ
Hey there, fearless coders! Are you ready to take on the ultimate challenge and show off your coding prowess? Get ready to conquer the Ascending Walls like never before!
We are going to create a script that makes a part in Roblox move up and down between two heights. Here's what we want to accomplish:
1. Start at a Position:
The part will start at a certain position.
2. Move Up and Down:
The part will move up to a maximum height, then move down to a minimum height, and keep repeating this movement.
3. Direction Change:
When the part reaches the maximum height, it will change direction and start moving down. When it reaches the minimum height, it will change direction and start moving up again.
4. Smooth Movement:
The part will move smoothly, pausing for a short time during each step of movement.
By doing this, the part will continuously move up and down in a loop, creating a nice animation effect.
Instructions and Code Logic ๐๐โ
Step 1 - Set Up Starting Variablesโ
-
Create a variable to hold the part by setting it to the
Parentof the script. -
Make a variable to remember the starting position of the part.
-
Create variables for the highest point (
maxHeight), lowest point (minHeight), and how fast it moves (speed). -
Create a true/false variable (
goingUp) to know if the part is moving up, starting withtrue.
Step 2 - Make an Infinite Loopโ
- Use a loop that runs forever. In Lua, this is done with
while true do.
Step 3 - Check the Directionโ
- Inside the loop, use an
ifstatement to see if the part is moving up. This is checked using thegoingUpvariable.