PPristone AcademyLearn · Mentor · Build
The Roblox Builder's Quest · Events · Mission 2 · +100 XP · ⏱ 20 min

The trap — a brick that defeats anyone who touches it.

Eight lines of Lua and the most famous mechanic in Roblox history is yours.

Win condition

You touch a brick and your character is instantly defeated. 💀

200,000 FT
The Big PictureCode that waits

Games aren't scripts that run top to bottom — they're traps that wait.

Mission 1's print ran once and finished. Game code is different: it sets up and waits for the world to do something — a touch, a click, a player joining. That waiting code is called an event, and it's the single most important idea in Roblox scripting.

An event is a mousetrap. You set it once, walk away, and it fires by itself the instant something touches the trigger — no matter when that happens.
30,000 FT
The BuildPart, script inside it, eight lines

Build it.

1

Stop the game if it's running.

2

Home tab → Part. A brick appears — drag it somewhere you can reach.

3

In Explorer, hover over your Part → +Script. The script must be inside the Part — this matters.

4

Type this:

local part = script.Parent

part.Touched:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    if humanoid then
        humanoid.Health = 0
    end
end)
5

Press Play and walk into the brick. 💀

UNDER THE HOOD · LINE BY LINE
The UnderstandingWhat each line does

Every line, decoded.

script.Parent

"The thing this script lives inside" — your brick. This is why the script had to go inside the Part.

Touched:Connect(...)

"When ANYTHING touches this brick, run my function." The event. `hit` is whatever touched it — usually a body part like a leg.

hit.Parent + FindFirstChild

`hit.Parent` is the character that leg belongs to. `FindFirstChild("Humanoid")` searches it for the Humanoid — the object that owns Health.

if humanoid then

A ball or a falling brick has no Humanoid, so FindFirstChild returns `nil`. Without this check, the next line would crash. The check is armor.

The character is a bag

A Roblox character is a container holding Head, Torso, arms, legs, and a Humanoid. `FindFirstChild("Humanoid")` reaches into that bag by name. Found it → you got a player or NPC. `nil` → it was something else, leave it alone.

Make it look dangerous: click the Part and in Properties set BrickColor to Really red and Material to Neon.

0 FT · WHEELS DOWN
Repair Shop + DebriefIf it didn't work

The Repair Shop.

🔧 Nothing happens when I touch the brick

Is the Script inside the Part in Explorer? `script.Parent` must point at the brick.

Did you add a LocalScript by accident? This quest uses regular Script everywhere.

Is the game actually running?

🔧 Red error: attempt to index nil with 'Health'

The `if humanoid then` check is missing — something without a Humanoid touched the part and the code tried to hurt nothing. Put the armor back.

Events wait, then fire

Touched:Connect is set once and fires forever after. Most Roblox code is events all the way down.

Check before you touch

FindFirstChild then `if ... then` — find the thing, confirm it exists, only then act. This habit is what separates code that works from code that crashes.

Mission complete

+100 XP. Instant kill is fun once — Mission 3 turns this into a real damage brick, and hands you your first real bug.

THE TRAP · THE ROBLOX BUILDER'S QUEST · MISSION 2
Events wait for the world · script.Parent is the brick · FindFirstChild + if-check is armor · make it look dangerous.
Next: the upgrade — damage, cooldowns, and your first real bug.