Skip to main content

Stage 9: Key-and-Door Mission

Roblox Studio · Creator QuestStage 9 of 10
~70 min0/4 proofs0 XPRookie Builder
Stage 9 goal preview: Build a hidden key and a door that remembers
Quest objectiveBuild a hidden key and a door that remembers

Your arena spins fair, saved at Checkpoint_09. Ahead, something no obstacle so far could do: your game learns to remember. A locked door, a hidden key — and a player who has to explore.

Narration transcript
  1. Stage Eight made rotation fair, saved at Checkpoint zero nine. Keep that tested checkpoint open. Stage Nine begins there.
  2. Build a locked door and a hidden key, learn how a boolean remembers, and ship a mission players solve by exploring.
  3. Spoken bridge: Mission ready. First, understand the idea that makes this stage work.
Build

a locked door and a key worth finding

Learn

how a boolean remembers and a condition uses it later

Ship

a mission players solve by exploring

Idea

Narration transcript
  1. A boolean is a variable that remembers yes or no. hasKey starts false, flips true when the key is touched, and a condition lets the door open only after. Names matter again: the script finds Key and Door by name inside your stage folder.
  2. Spoken bridge: Turn that idea into three small Logic Cards.

A game needs memory when one action affects a later action. The boolean hasKey begins as false. Touching the key flips it to true. The door asks an if question before opening. Input → memory → condition → result.

Two names matter more than anything else today: the script finds the key with stageFolder:WaitForChild("Key"), so Key and Door must be spelled exactly and sit as siblings in your stage folder.

One more thing: your game is a solo adventure — it remembers one key, for the one player testing it. Games where every player carries their own backpack come later, in a multiplayer course.

Sample goal
A blue locked door on the main route and a golden key on a short side route
Build toward this: One way Stage 9 can look: a locked door on the main route, a key on a side branch. Your paths, your key — what matters is the memory.

Logic Board

Logic board

Finish these cards from left to right. Each card becomes a Code Quest below.

  1. 1Card A
    Narration transcript
    1. Remember the key with a boolean.
    2. The key disappears once and memory becomes true.

    Remember the key

    Remember the key with a boolean.

    Done when: The key disappears once and memory becomes true.
  2. 2Card B
    Narration transcript
    1. Ask the condition at the door.
    2. The door stays shut without the key.

    Ask at the door

    Ask the condition at the door.

    Done when: The door stays shut without the key.
  3. 3Card C
    Narration transcript
    1. Prove the mission and save the checkpoint.
    2. Finding the key opens the way and Checkpoint zero ten saves.
    3. Spoken bridge: The plan is complete. Pick your Build Mode on the page and build one card at a time — pause after every Studio action.

    Prove the mission

    Prove the mission and save the checkpoint.

    Done when: Finding the key opens the way and Checkpoint_10 saves.

Build

Pick your Build Mode for the mission layout — the memory script is the same for everyone. Watch the two exact names.

Build Mode

Every builder plays this stage in their own mode. Which sounds like you?

Not sure? Start with Guided — you can level up on any stage, and your pick follows you through the whole course.

The wiring

Names that must match

Build inside Workspace → Course → Stage09, from Checkpoint_09 to Checkpoint_10. Scripts find objects by name — these spellings are the wiring. Everything else about each object is your call.

  • MainPathThe main route the door blocks.
  • DoorBlocks the main path until the key is found. The exact name matters.Must have: Script: DoorController
  • KeyPathThe side branch that leads to the key.
  • KeyThe pickup that opens the door. Must be Door's sibling with this exact name — the script calls stageFolder:WaitForChild("Key").Must have: CanCollide false
  • Landing_10The landing that ends the stage — Checkpoint_10 stands here.
Reference buildStuck, or just want to copy ours? Here is exactly how we built this stage.

These values always work together. Copy them as-is, or borrow a few and keep the rest of the stage yours.

Build this part

MainPath

Part · Block
Open recipe
Size
12 × 1 × 28
Anchored
✓ Yes
Orientation
0 × 0 × 0
CanCollide
✓ Yes
Place
Position [0, 3.5, 536] inside Workspace → Course → Stage09
Build this part

Door

Part · Block
Open recipe
Size
12 × 10 × 1
Anchored
✓ Yes
Orientation
0 × 0 × 0
CanCollide
✓ Yes
Place
Position [0, 8.5, 550] inside Workspace → Course → Stage09

Children: Script: DoorController.

Build this part

KeyPath

Part · Block
Open recipe
Size
6 × 1 × 18
Anchored
✓ Yes
Orientation
0 × 0 × 0
CanCollide
✓ Yes
Place
Position [9, 3.5, 532] inside Workspace → Course → Stage09
Build this part

Key

Part · Block
Open recipe
Size
2 × 2 × 1
Color
Bright yellow
Material
Neon
Anchored
✓ Yes
Orientation
0 × 0 × 0
CanCollide
✗ No
Place
Position [9, 5.5, 540] inside Workspace → Course → Stage09
Build this part

Landing_10

Part · Block
Open recipe
Size
12 × 1 × 14
Anchored
✓ Yes
Orientation
0 × 0 × 0
CanCollide
✓ Yes
Place
Position [0, 3.5, 557] inside Workspace → Course → Stage09
Key-branch topology: Key and Door are siblings inside Stage09 so one script can find both reliably.
Checkpoint_09 → MainPath
Required branchKeyPath → Key
Locked routeDoor → Landing_10 → Checkpoint_10
Course → Stage09 → Key + Door

Code

Build quest · Card A

Build the remembered state

Narration transcript
  1. Build your mission per your track: a main path, a Door that fully blocks it, and a side branch leading to a floating Key — Key and Door named exactly, siblings in the stage folder. Then insert DoorController inside Door and type the key-memory handler. Collect the key once in Play mode.
  2. Spoken bridge: Card A now matches its success check. Continue to Card B.

A — Remember. Build your mission per your track. Then insert a Script inside Door, rename it DoorController, and type the key-memory handler. Press Play and collect the key — it should disappear exactly once, and the door should change color.

local door = script.Parent
local stageFolder = door.Parent
local key = stageFolder:WaitForChild("Key")
local hasKey = false

key.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and not hasKey then
hasKey = true
key.Transparency = 1
key.CanCollide = false
key.CanTouch = false
door.Color = Color3.fromRGB(80, 220, 100)
end
end)
Build quest · Card B

Ask the door condition

Narration transcript
  1. The door asks two questions at once: did a player touch me, AND was the key collected? That is a condition reading memory.
  2. Continue the script with the door's Touched handler and its double check.
  3. Spoken bridge: The behavior passed its focused test. Finish the checkpoint handoff.

The door asks two questions at once: did a player touch me, AND was the key collected? That's a condition reading memory.

B — Ask and reward. Continue the same Script with the door's complete handler — the double check and the reward. Then test twice: walk into the door without the key (it refuses you), then restart Play, collect the key, and try again (it opens).

door.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and hasKey then
door.CanCollide = false
door.Transparency = 0.75
end
end)

The two checks on one line mean "a player touched me AND the key was collected."

Build quest · Card C

Open the rewarded route

Narration transcript
  1. Finish the handler so the door opens when hasKey is true. Test twice — locked first, then a fresh run collecting the key. Then add Landing zero ten and complete the Checkpoint zero ten recipe.
  2. Spoken bridge: The next checkpoint saved. One designer check before you style it: does your stage pass?

C — Save the win. Add an anchored Landing_10 flush against the path past the door (reference: [12, 1, 14]), then complete the checkpoint recipe. Touch it and reset.

Compare your finished script
local door = script.Parent
local stageFolder = door.Parent
local key = stageFolder:WaitForChild("Key")
local hasKey = false

key.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and not hasKey then
hasKey = true
key.Transparency = 1
key.CanCollide = false
key.CanTouch = false
door.Color = Color3.fromRGB(80, 220, 100)
end
end)

door.Touched:Connect(function(otherPart)
local humanoid = otherPart.Parent:FindFirstChildOfClass("Humanoid")
if humanoid and hasKey then
door.CanCollide = false
door.Transparency = 0.75
end
end)
Checkpoint recipeSave progress at Stage 10

Using the voice guide? It reads one recipe step, waits while you work, then continues when you choose Done — hear next step.

  1. Insert one SpawnLocation in Workspace and rename it Checkpoint_10. Set Size to about [6, 1, 6] and Anchored to true. Centered on the landing that ends Stage 9, with its top just above the landing surface. (Our reference build puts it at Position [0, 4.5, 557].)
  2. Set Neutral to false, Enabled to true, and AllowTeamChangeOnTouch to true.
  3. Set the SpawnLocation TeamColor to Really red. Set its visual BrickColor to the same named color. TeamColor controls respawning; BrickColor only controls what the pad looks like.
  4. Point at Teams in Explorer, select its +, and insert one Team named Stage 10. Set its TeamColor toReally red and AutoAssignable tofalse. Never reuse this TeamColor on another checkpoint.
  5. Press Play. Climb to and touch Checkpoint_10, then reset your character and confirm you respawn there. Press Stop before editing again.
Explorer checkWorkspace → Checkpoint_10Teams → Stage 10 (Really red)

Does It Pass?

Narration transcript
  1. Time for the designer check. Play your mission and walk the pass list: the door blocks every angle until the key, something hints where to explore, the unlock feels earned, and a fresh run starts locked again. A rule that fails is just the next thing to tune.
  2. Spoken bridge: Your stage passes — it is a real level now. Time to make it feel like your game.
Designer check

Does your stage pass?

Play your stage and check each one. A rule that fails isn't a mistake — it's just the next thing to tune.

  • Nothing moves, falls, or drifts — every part stays exactly where you put it.Check: Press Play — everything stays put.Tip: Anchored on for every part, and CanCollide on for anything players stand on.
  • The door fully blocks the main path — no squeezing past its edges.Check: Try every angle before finding the key: you stay stuck.
  • The key waits on a side branch a curious player can spot from the main path.Check: Stand at the door and look around: something hints where to go.
  • Touching the key opens the way, and the route to it and back is a fair walk.Check: Grab the key, return, and pass the door in one clean run.

Make It Yours

Narration transcript
  1. Decide what a key IS in your world — a crystal, a gear, a spellbook, a golden gummy. Restyle Key and Door to match; their names stay exact for the script, but their look belongs to your game.
  2. Spoken bridge: That is your stamp on the stage. Now explain what made it work.

What is a key in your world? A crystal shard, a brass gear, a spellbook, a golden gummy? Restyle Key and Door to match — their names stay exact for the script, but their look belongs to your game. A player should recognize your key as special the moment they see it.

Help Ladder

Stuck? Choose what went wrong

Pick the problem that matches. Open one clue, try it, then return only if you still need help.

My parts overlap or miss the next checkpoint

Clue 1: small hint
Narration transcript
  1. Stop Play mode and check one part against the stage rules before touching anything else.
Stop Play mode. Fix one part at a time instead of dragging the whole stage.
Clue 2: where to look
Narration transcript
  1. Check Workspace, Course, Stage zero 9, and keep both checkpoints directly inside Workspace.
Find the stage parts in Workspace → Course → Stage09. Find Checkpoint_09 and Checkpoint_10 directly inside Workspace.
Clue 3: worked answer
Narration transcript
  1. Walk your stage rules top to bottom and fix the first rule that fails. If you want a layout that always works, open the reference build and copy its values.
Rebuild the connection one part at a time: check each part against the stage rules, or re-enter its reference Position from the matching recipe card if you want the layout that always works. Then playtest again from Checkpoint_09.

the door never opens

Clue 1: small hint
Narration transcript
  1. Prove the key changes memory before debugging the door.
Prove the key changes memory before debugging the door.
Clue 2: where to look
Narration transcript
  1. Add a print of hasKey after setting it true, and read Output.
Add print("hasKey", hasKey) after setting hasKey true and read Output.
Clue 3: worked answer
Narration transcript
  1. Door and Key must both be direct children of Stage zero nine. Both event handlers and the single hasKey variable belong in DoorController inside Door.
Door and Key must both be direct children of Stage09. Both event handlers and the single hasKey variable belong in DoorController inside Door.

Learn What Happened

Narration transcript
  1. One boolean remembered the pickup, and one condition used that memory at the door. This stage stays intentionally solo: each player's game remembers only their own key.
  2. Spoken bridge: Use one small prediction to transfer that idea.

hasKey is your game's memory. not hasKey prevents double collection; the door reads the same variable later. Stopping and restarting Play resets it — which is exactly how you tested the locked state fresh. One boolean, one condition, one mission.

Try This

Narration transcript
  1. Predict what happens if hasKey starts as true, compare with the real locked start, and connect the result to the condition.
  2. Spoken bridge: Finish with four proof checks. Each check must match something you can observe or explain.
Learning beat

Try this

Three short thinking checks. Use evidence from the stage you just built.

Predict first
What happens if hasKey starts as true?
Compare
Place the key in plain sight, then off a side route. Which feels like a mission?
Connect
Trace input → memory → condition → result through your Logic cards.

Prove It

Narration transcript
  1. Spoken bridge: Final proof. Confirm one result at a time.
  2. Your door fully blocks the main path, and the Key waits on a branch a player can discover.
  3. Locked, unlocked, and fresh-session states all work.
  4. Checkpoint_10 saves progress and reset returns you there.
  5. You can explain hasKey, its condition, and the solo scope.
Mission check · finish all 4

0 of 4 proof checks complete

Narration transcript
  1. Stage Nine complete. Your game remembers now, and you earned one hundred XP. Stage Ten is launch day: the final puzzle, the full playtest, and your game going live.

Go Further (Optional)