Roblox Heist: Build a Level

Planning
Step 1
In this lesson you will be building a Map for your players to explore
Temp1532042159

I will be providing some direction, but don't just copy me! Make your own obstacles and platform

Challenge
Step 2
Create some obstacles for the player to get around
Temp1532042248

Here I have a section the player must carefully jump across

Challenge
Step 3
Include sliding doors from the previous lesson
Temp1532042316

Your doors don't have to look like mine! They don't even need to be made of glass!

Challenge
Step 4
Include coins for the player to collect
Temp1532042404

Maybe your player is collecting something besides coins

Planning
Step 5
Before moving on to the next lesson, we're going to take the time here to create a RestartLevel Script

Right now if a player explodes a bomb and comes back, the bomb is still gone...

Similarly, Doors remain open, Coins remain collected, etc

Step 6
We're going to make a folder to hold every object that we want to respawn when the player dies
Temp1532124601

Name this folder Respawn

Temp1532124625

You may notice I put all of the permanent objects such as walls and floors into a folder as well.

Step 7
Drag and drop all objects that need to "reset" once the player dies
Temp1532124883

These objects includes things such as

  • Doors need to close
  • Coins need to reappear
  • Bombs needs to un-explode!
Check Your Work
Step 8
You should now have two sets of organization for your levels, objects that reset, and objects that are permanent
Temp1532125063

(You do not need a Walls folder like I have)

Planning
Step 9
We're going to make a Script to restore the objects in the Respawn folder when the player dies

First we Duplicate the Respawn folder when the game starts

Temp1532126301

When the player dies we Destroy the Respawn folder

Temp1532126369

Finally we put the duplicate of the Duplicate and put it back in the Workspace

Temp1532126530
Step 10
Go to the StarterPlayerScripts folder and add a new local script, "Reset"
Temp1532125407

All players will automatically start with this Script attached to them

Step 11
Start the Script by referencing the player
Temp1532126025

The Player can be found by getting the Script's Parent's Parent

Step 12
Make a Clone of the "Respawn" folder and store it in "ReplicatedStorage"
Temp1532126660

WaitForChild() means the script will wait until the "Respawn" folder loads before we duplicate it.

Step 13
Add a function named Reset
Temp1532126844
Step 14
When this function is called it Destroys everything inside of "Respawn", then duplicates our saved mapData
Temp1532126951

In order to see the mapData clone, we need to parent it to the Workspace

Planning
Step 15
In order to check if the player has died, we need to refer to the "player object" in the Workspace (red)
Temp1532127254

Our player variable refers to the player data

We need to make another variable for the Workspace's player

Step 16
Make a variable for the Workspace's player object, then connect it's death event to the reset function
Temp1532127382

The death event is named CharacterRemoving.

Check Your Work
Step 17
Now when the player dies, everything inside the "Respawn" folder will come back
Planning
Step 18
Include an area to hold a treasure the player is going to try to steal
Temp1532056138

In the next lesson we will be making this treasure for the player to try to steal

Roblox Heist: Build a Level Info

Account

MVCode Clubs

Created By

Newprofile jamie

Course:

Roblox Heist Game

Access Level

premium

For Teachers and Schools

Teach coding to your students with MVCode Teach

MVCode offers an integrated product designed to teach coding to students.

Learn more about MVCode Teach