Master the Kill: How to Make a Kill Part in Roblox Studio

Master the Kill: How to Make a Kill Part in Roblox Studio

To make a Kill Part in Roblox Studio, place a Part in your level, add a server-side Script beneath it, and use the Part’s Touched event to find and defeat a player’s Humanoid. The setup below includes a player-only check, a simple cooldown, and a ForceField check so the trap will not remove spawn protection.

This Roblox kill brick works for obbies, hazard rooms, and other experiences where touching a surface should reset a player. You can also make the part invisible or adapt it to damage players instead of eliminating them.

Before you build the kill brick

  • Open Roblox Studio and create a new place or open an existing one.
  • Make sure the Explorer and Properties panels are visible. You can enable them from Studio’s View menu if they are hidden.
  • Use a test place or a private copy while you build and playtest the trap.

The script belongs inside the hazard Part in Workspace. Roblox’s standard Script runs on the server from Workspace; a LocalScript is the wrong choice for this setup. See Roblox’s guide to script types and locations.

Step 1: Create and configure the hazard Part

  1. Insert a basic Part from the Home or Model tools. In Explorer, rename it something recognizable, such as KillPart.
  2. Move it to the hazard location. Use the Properties panel or Studio’s scale tools to set a size that players can clearly see and reach. For example, a wide, thin tile can cover an obby landing.
  3. Set Anchored to true so the trap stays in place. Keep CanTouch enabled; the touch event will not work if touch detection is disabled.
  4. Choose a color and material that communicate danger, such as red or orange. If the block should stop players, leave CanCollide enabled. If it is a hidden trigger volume, you can turn CanCollide off while keeping CanTouch on.

An anchored kill brick can still detect a moving character. Roblox notes that two anchored parts do not trigger Touched against each other, so test by moving a character across the part rather than by placing two stationary blocks together. The BasePart.Touched reference explains the event’s behavior and touch requirements.

Step 2: Add a server-side kill script

  1. In Explorer, right-click KillPart, insert a Script, and confirm that the Script appears as a child of the Part.
  2. Open the Script, remove its starter code, and paste this version:
local Players = game:GetService("Players")
local trap = script.Parent
local hitCooldown = {}

trap.Touched:Connect(function(hit)
    local character = hit:FindFirstAncestorOfClass("Model")
    if not character then
        return
    end

    local player = Players:GetPlayerFromCharacter(character)
    if not player then
        return -- Remove this check if the trap should also kill NPCs.
    end

    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid or humanoid.Health <= 0 then
        return
    end

    -- Keep Roblox spawn protection intact.
    if character:FindFirstChildOfClass("ForceField") then
        return
    end

    if hitCooldown[humanoid] then
        return
    end
    hitCooldown[humanoid] = true

    humanoid.Health = 0

    task.delay(1, function()
        hitCooldown[humanoid] = nil
    end)
end)

Touched passes the specific body part or accessory that made contact, not the character model itself. The script therefore walks up to the containing Model, looks for a Humanoid, and uses Players:GetPlayerFromCharacter() to limit this version to players. The cooldown prevents multiple body parts from processing the same contact repeatedly.

The script checks for a ForceField before setting health to zero. Directly setting Humanoid.Health can bypass ForceField protection; the explicit check preserves spawn protection for this trap. For ordinary damage that should respect a ForceField, use humanoid:TakeDamage(25) in place of the health assignment. Roblox documents these health behaviors in its Humanoid reference and ForceField reference.

Step 3: Playtest the Kill Part

  1. Start a Studio playtest with the Play control and walk your character into the hazard.
  2. Confirm that the character is eliminated and respawns according to the place’s spawn settings.
  3. Stop the test, adjust the Part or script, and test again. Check the Output panel for script errors if nothing happens.
  4. If the experience is multiplayer, use Studio’s server-and-client testing options to confirm the result from a client session too. Roblox’s Studio testing modes guide describes the available test setups.

Test both the visible block and the character’s actual path through it. A trap can appear to overlap the floor while being positioned slightly above or below the route, so adjust its position if the character walks through without contact.

Useful variations

Make an invisible kill zone

Set Transparency to 1 and CanCollide to false, but leave CanTouch on. This creates a hidden trigger volume without making an invisible wall. Place it carefully and playtest from the player’s viewpoint so the zone feels fair.

Allow the trap to affect NPCs

The sample script intentionally ignores NPCs by returning when GetPlayerFromCharacter() finds no player. Remove that player check if NPC models with Humanoids should also trigger the trap. Keep the Humanoid and health checks so unrelated objects are ignored.

Use damage instead of an instant elimination

Replace humanoid.Health = 0 with humanoid:TakeDamage(25) to make the part a damaging hazard. Adjust the amount to fit your game, then test it with a player who has a ForceField so you can verify that spawn protection behaves as intended.

Kill Part troubleshooting

What happensWhat to check
The trap does nothingConfirm the Script is under the Part, the object is a Script rather than a LocalScript, CanTouch is on, and the character physically touches the Part.
The Output panel shows an errorCheck spelling, quotation marks, and that the code was pasted into the Script under the hazard.
Players pass through an invisible trapFor a trigger zone, CanCollide may be off, but CanTouch must stay on. Check that the zone spans the player’s route.
NPCs are unaffectedThe sample is player-only. Remove the GetPlayerFromCharacter check if NPCs should be included.
Players survive the trapThey may have a ForceField. The sample intentionally leaves ForceField-protected characters unharmed.

Frequently asked questions

Does the kill script go in Workspace or ServerScriptService?

For this beginner setup, put the Script directly inside the hazard Part in Workspace. Workspace is a server container for the default Script run context, and keeping the script with its Part makes the trap easy to move or duplicate.

Can I use a LocalScript for a kill brick?

Use a normal server-side Script for this example. The server should own gameplay outcomes such as changing a character’s health so the result is applied consistently to players in the experience.

Once the basic Kill Part in Roblox Studio works, duplicate it for additional hazards, give each a clear visual purpose, and playtest every placement before publishing.

Leave a Comment

How to Turn Off Stage Hazards in Smash Ultimate Quickplay

How to Turn Off Stage Hazards in Smash Ultimate Quickplay

Set Super Smash Bros. Ultimate Quickplay to prefer hazards-off stages. Follow the Preferred Rules menu steps and learn why matchmaking may not always honor them.

Best Warzone Telemetry Overlay Settings for Ping and Packet Loss

Best Warzone Telemetry Overlay Settings for Ping and Packet Loss

Enable Server Latency and Packet Loss in Warzone to monitor connection quality, read the overlay, and use recurring spikes to guide troubleshooting.

Master Mid Lane Roaming: How to Carry in League of Legends

Master Mid Lane Roaming: How to Carry in League of Legends

Learn how to carry from mid lane in League of Legends by setting up waves, choosing safe roam windows, reading side lanes, and converting pressure into objectives.

How to Fix the Minecraft Evoker Spell Error in Modded Worlds

How to Fix the Minecraft Evoker Spell Error in Modded Worlds

Fix Minecraft Evoker spell problems with a safe vanilla test, version checks, log review, and a step-by-step way to isolate mod or datapack conflicts.

How to Fix PUBG Stuck on “Initializing” on Steam

How to Fix PUBG Stuck on “Initializing” on Steam

Fix PUBG stuck on Initializing on Steam with a focused checklist for PC service notices, launch options, game files, downloads, and connection issues.

How to Fix Brawl Stars Stuck at 92% Loading

How to Fix Brawl Stars Stuck at 92% Loading

Fix Brawl Stars stuck at 92% loading with an ordered checklist for service notices, network tests, safe updates, Android cache, and account-safe reinstalling.

Best Dead by Daylight Visual Filter Settings for Spotting Survivors in Dark Maps

Best Dead by Daylight Visual Filter Settings for Spotting Survivors in Dark Maps

Best Dead by Daylight visual filter settings start with a small Gamma lift, neutral color and contrast, and a quick check for dark corners, fog, and bright lights.

How to Enable Launch Options for Autoexec in Apex Legends

How to Enable Launch Options for Autoexec in Apex Legends

Find the Steam and EA app fields for Apex Legends launch options, use EA’s documented FPS command, and see why +exec autoexec.cfg remains unverified.

How to Reduce Input Lag on a Docked Nintendo Switch for Smash Ultimate

How to Reduce Input Lag on a Docked Nintendo Switch for Smash Ultimate

Reduce input lag on a Nintendo Switch dock for Smash Ultimate with TV Game Mode, a direct HDMI test, controller checks, and online-latency troubleshooting.

Best Audio Settings to Hear the Referee Whistle Clearly in EA SPORTS FC

Best Audio Settings to Hear the Referee Whistle Clearly in EA SPORTS FC

Find the best EA SPORTS FC audio settings for a clearer referee whistle: tune Stadium Ambience and Commentary, then troubleshoot output or timing issues.