Start building

Roblox Kill Brick Script (Single Part & CollectionService Tag)

Instead of copying 100 scripts into 100 lava bricks, tag any part 'KillBrick' and let one clean server script handle all of them.

Type: ScriptExplorer: ServerScriptServiceLevel: Beginner
ScriptServerScriptService
-- Script in ServerScriptService
local CollectionService = game:GetService("CollectionService")

local function attachKill(part: BasePart)
	part.Touched:Connect(function(hit)
		local model = hit.Parent
		local humanoid = model and model:FindFirstChildOfClass("Humanoid")
		if humanoid and humanoid.Health > 0 then
			humanoid.Health = 0
		end
	end)
end

for _, inst in ipairs(CollectionService:GetTagged("KillBrick")) do
	if inst:IsA("BasePart") then
		attachKill(inst)
	end
end

CollectionService:GetInstanceAddedSignal("KillBrick"):Connect(function(inst)
	if inst:IsA("BasePart") then
		attachKill(inst)
	end
end)

How to install in Studio

  1. Insert a Script named KillBricks inside ServerScriptService and paste the code.
  2. Select any lava or hazard Part in Workspace.
  3. In the Properties panel under Tags, add the tag KillBrick.

Tips & customization

  • Duplicate tagged parts freely — new copies automatically inherit the KillBrick tag.
  • Check model:GetAttribute('Invincible') before setting Health = 0 if your game has spawn shields.

Common questions.

Why use CollectionService instead of putting a script inside every kill brick?

One script in ServerScriptService uses less memory and lets you edit kill behavior in one place instead of 100 separate scripts.

More free Luau scripts.

All 16 scripts

Skip manual wiring.
Let Revix code & playtest it.

Start building free

Free to start. No card needed.