The trap — a brick that defeats anyone who touches it.
Eight lines of Lua and the most famous mechanic in Roblox history is yours.
You touch a brick and your character is instantly defeated. 💀
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.
Build it.
Stop the game if it's running.
Home tab → Part. A brick appears — drag it somewhere you can reach.
In Explorer, hover over your Part → + → Script. The script must be inside the Part — this matters.
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)Press Play and walk into the brick. 💀
Every line, decoded.
"The thing this script lives inside" — your brick. This is why the script had to go inside the Part.
"When ANYTHING touches this brick, run my function." The event. `hit` is whatever touched it — usually a body part like a leg.
`hit.Parent` is the character that leg belongs to. `FindFirstChild("Humanoid")` searches it for the Humanoid — the object that owns Health.
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.
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.
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.
Touched:Connect is set once and fires forever after. Most Roblox code is events all the way down.
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.
+100 XP. Instant kill is fun once — Mission 3 turns this into a real damage brick, and hands you your first real bug.