Roblox Kill Brick Script: Instant Reset and Lava Damage
A Roblox kill brick script is usually the first script a new developer writes. Here you get two versions: a classic instant-reset brick and a safer lava part that deals damage with a cooldown.
- Classic kill brick in 10 lines of Luau
- Lava version with debounce and damage over time
- Tips for using kill bricks fairly in an obby
Step by step
Create the kill brick
Insert a Part, name it KillBrick, and colour it bright red so players can see the danger. Turn on Anchored so it stays in place, and leave CanCollide on so players land on it.
Add a Script inside it
Hover over KillBrick in the Explorer, click the plus button and choose Script. Delete the print line and paste the classic kill brick script. The script must be a direct child of the brick.
Playtest the classic version
Press Play (F5) and walk onto the brick. Your character should fall apart and respawn. If nothing happens, open the Output window and look for a red error message.
Build the lava part
Insert another Part, name it Lava and make it wide and flat. Anchor it, add a Script inside and paste the lava version. When you press Play the script changes its material and colour for you.
Tune the damage
Change DAMAGE and COOLDOWN at the top of the lava script. Try DAMAGE = 10 and COOLDOWN = 0.25 for a slow burn, or DAMAGE = 50 for dangerous lava. Playtest after every change.
Place kill bricks in your obby
Duplicate finished bricks with Ctrl+D (Cmd+D on Mac) so each copy keeps its script. Put them where players can see them coming and keep a checkpoint close to every hard jump.
The script
-- Script inside the KillBrick part
local killBrick = script.Parent
killBrick.Touched:Connect(function(otherPart)
-- otherPart is the body part that touched us (a foot, a hand...)
-- its Parent is usually the character model
local character = otherPart.Parent
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if humanoid then
humanoid.Health = 0 -- instant reset
end
end)
-- Script inside the Lava part: damage over time instead of instant death
local lava = script.Parent
local DAMAGE = 20 -- health removed per hit (players start with 100)
local COOLDOWN = 0.5 -- seconds before the same player can be hurt again
-- Make it look like lava
lava.Material = Enum.Material.CrackedLava
lava.Color = Color3.fromRGB(255, 90, 0)
local recentlyHurt = {} -- debounce list: characters on cooldown
lava.Touched:Connect(function(otherPart)
local character = otherPart.Parent
local humanoid = character and character:FindFirstChildOfClass("Humanoid")
if not humanoid or humanoid.Health <= 0 then
return -- not a character, or already knocked out
end
if recentlyHurt[character] then
return -- still on cooldown, ignore this touch
end
recentlyHurt[character] = true
humanoid:TakeDamage(DAMAGE)
-- remove the character from the list after the cooldown
task.delay(COOLDOWN, function()
recentlyHurt[character] = nil
end)
end)
Not working? Common mistakes
Select the part and turn on Anchored. Unanchored parts are affected by gravity.
Make sure the Script is directly inside the part, that CanTouch is on in Properties, and that the Output window shows no errors.
That is the spawn ForceField. Set the SpawnLocation's Duration to 0, or use Health = 0 for that part.
How the Roblox kill brick script works
Every obby has them: red or glowing parts that send you back to the last checkpoint. A roblox kill brick script uses one event, Touched, which fires whenever another part bumps into it.
The event gives you otherPart, the exact part that touched the brick, for example a player's left foot. The foot's Parent is usually the character model, and every character has a Humanoid inside. The Humanoid stores Health. Set Health to 0 and the character resets.
Notice the safety check: if humanoid then. Lots of things can touch a kill brick, like a falling part or a thrown ball, and those have no Humanoid. Without the check the script would error every time a random part touched it.
We use FindFirstChildOfClass("Humanoid") instead of looking for a child named Humanoid, because it finds the Humanoid by type even if someone renamed it. This is a small habit that makes your scripts sturdier.
Why the lava version is safer
The classic Roblox kill brick script is fine for a simple obby, but it has two problems. It is instant, which can feel harsh, and Touched fires many times per second while a player stands on it. The second script fixes both.
- Debounce per character: the recentlyHurt table remembers who was just hurt. For the next 0.5 seconds extra touches from that character are ignored. task.delay removes them from the list afterwards.
- TakeDamage instead of Health = 0: the player loses 20 health per hit, so they can jump out if they react quickly. TakeDamage also respects ForceFields.
- Looks like lava: the script sets the CrackedLava material and an orange colour automatically.
One thing to know: a SpawnLocation gives players a ForceField for 10 seconds after spawning by default, and a ForceField blocks TakeDamage. If players respawn right next to lava and do not get hurt, set the SpawnLocation's Duration property to 0.
Kill brick ideas for a fun, fair obby
The kill bricks and lava players remember are the fair ones. Players should always see the danger before it hurts them. Try these ideas:
- Moving kill bricks: use TweenService to slide a brick back and forth. Our door tutorial explains tweens step by step.
- Neon warning colour: set Material to Neon so danger glows even in dark stages.
- Lava floor with platforms: a big lava part under a jumping section, combined with our double jump script.
- Checkpoints nearby: never make players repeat a long section after one mistake. The obby tutorial shows a checkpoint script.
Tip: to make many kill bricks, finish one with its script, then select it and duplicate it with Ctrl+D (Cmd+D on Mac). The script is copied too.
Parent note: small script, big ideas
A Roblox kill brick script is a classic first lesson for a reason. In a few lines your child meets events (Touched), the object hierarchy (part, parent, character, Humanoid), nil checks and, in the lava version, tables and timers.
The kill brick is also where many kids first see a bug on purpose: the brick hurting a player 30 times a second. Fixing it with a debounce teaches them that code must handle what really happens, not only what they expected.
If your child is younger or new to typing, pasting the script and then changing DAMAGE, COOLDOWN and the colour is a perfectly good start. Understanding comes with repetition, and that is what structured lessons are for.
Want your child to build full games like this?
Want your child to build full games like this? First 1-on-1 lesson free.
Excklusive-IT is a kids coding school running since 2020. In live 1-on-1 Zoom lessons, Vlad Pomazanets teaches Roblox Studio and Luau to students aged 8–17, starting from kill bricks and moving on to complete games with checkpoints, coins, shops and user interfaces.
The first 60-minute lesson is free. Then it is CA$280 for 4 lessons, and unused lessons are refundable within 14 days. Lessons are available in English, Ukrainian or Russian, and we will match a time in your time zone.
Book your free Roblox lesson or explore the Roblox course program.
Questions parents ask
Where do I put a Roblox kill brick script?
Put a normal Script directly inside the part that should kill players. The script uses script.Parent to find the brick, so if you put it in ServerScriptService or Workspace instead, script.Parent is the wrong object and the Touched event never fires on your brick.
Why doesn't my lava hurt players right after they respawn?
Players get a ForceField for a few seconds after spawning on a SpawnLocation, 10 seconds by default. TakeDamage does not hurt a character protected by a ForceField. Set the SpawnLocation's Duration to 0, or use the classic script, which sets Health to 0 directly.
How do I stop the kill brick from killing NPCs?
Check that the character belongs to a real player. Get the Players service and call Players:GetPlayerFromCharacter(character). If it returns nil, the character is an NPC and you can return early without changing its Health.
What is a debounce in Roblox?
A debounce is a variable that stops code from running again too soon. Touched can fire many times while a player stands on a part, so the lava script remembers who was just hurt and ignores them for half a second. The same idea stops doors, coins and buttons from glitching.
Is Health = 0 or TakeDamage better?
Health = 0 always resets the character, even through a ForceField, which suits classic obby kill bricks. TakeDamage removes a set amount of health and respects ForceFields, which suits lava, spikes and traps where players should get a chance to escape.
Want your child to build full games like this?
Start with a free 1-on-1 Roblox lesson on Zoom. 60 minutes with Vlad, ages 8–17, English, Ukrainian or Russian. We'll match a time in your time zone.
Book a free lessonBook a free lesson
No commitment. No payment. Just your child's first coding class.
5 / 5 · 1 review
“We were looking for coding classes for kids in Hamilton and a friend recommended Exclusive-IT. My 11-year-old started the Roblox course one-on-one and built his first real game in a few weeks. The mentor is patient, the lessons are in plain English, and my son actually looks forward to them. Highly recommend for any parent who wants their child to learn to code.”
Or message us directly
Tap a messenger — the chat opens with a ready greeting.
- +1 (289) 44-28-698
- excklusiveit@gmail.com
-
Working hours — Hamilton, Ontario (ET) Mon–Fri: 9:00–18:00 Sat–Sun: 8:00–16:00
- Online worldwide · classroom in Hamilton: 170 Parkdale Ave N, Hamilton, ON L8H 5X2