BETA mahshid.de is still being built – things may change or wobble.Still under construction. Feedback
DE
Lesson 7 of 11 · Obby pro

Lava blocks and checkpoints

Now your obby becomes a real game: lava blocks send players back, checkpoints remember their progress.

What you’ll learn

  • script a lava block (kill brick)
  • build checkpoints with SpawnLocation and RespawnLocation
  • put scripts directly into a part

Lava block

Put this Script directly into the part (click + next to the part in the Explorer). script.Parent is then the part itself. Make it neon red so players see the danger.

local brick = script.Parent

brick.Touched:Connect(function(hit)
  local humanoid = hit.Parent:FindFirstChild("Humanoid")
  if humanoid then
    humanoid.Health = 0   -- back to the last checkpoint
  end
end)

Checkpoints

Insert another SpawnLocation as a checkpoint and put this Script inside it. Whoever touches it respawns there from then on:

local checkpoint = script.Parent   -- a SpawnLocation
local Players = game:GetService("Players")

checkpoint.Touched:Connect(function(hit)
  local player = Players:GetPlayerFromCharacter(hit.Parent)
  if player then
    player.RespawnLocation = checkpoint
  end
end)

Fair games

Make the first jumps easy and increase the difficulty slowly. A checkpoint before every hard part keeps players happy – just like in our Block Parkour.

🛠️ Try it

Add two lava blocks and a checkpoint in the middle of your obby. Test: after the lava, do you respawn at the checkpoint?

🧠 Mini quiz

What is script.Parent when the Script is inside a part?

What does humanoid.Health = 0 do?

🤖 Practise it in the code adventureLevel 14: The maze →

Roblox and Roblox Studio are trademarks of the Roblox Corporation. mahshid.de is not affiliated with Roblox. All links to Roblox lead to the official sites.