Exercise 2.1 – simple elevator
In this exercise, we will create a simple elevator to enable us to practice more with loops. We will create a simple part that we will move upward. When players stand on this part, they will automatically go up, resulting in an elevator effect happening.
To create our elevator, follow these steps:
- Open Roblox Studio and create a new Baseplate.
- Create a new part in the Workspace named
Elevator
. - Create a new script in ServerScriptService.
- Make a reference to the
Elevator
part in the Workspace. - Create a loop that increases the height of the part by changing the Position property of the part. Once the loop is done, the part should be
100
studs higher. If the original position was{0, 0, 0}
, then the new position should be{0, 100, 0}
. The position should increase every second.
Tip for 5: If you cannot figure out which loop to use, read the Programming loops section again. Our elevator should increase its height by...