Player dies when part touches head

Is it possible to make a part kill a player when it touches the player’s head specifically? Generally the player would die when any part of the Humanoid touches the Kill-Brick, but is it possible to make the kill brick only function when it touches the player’s head?

1 Like

Since the Touched parameter returns back the HitPart that it hit, couldn’t you just check if the HitPart’s name is equal to what you want to detect? (Or the Character’s Head in this instance)

local Part = script.Parent

Part.Touched:Connect(function(HitPart)
    local Character = HitPart.Parent
    local Player = game.Players:GetPlayerFromCharacter(Character) --Remove if you want other non-players to die from this
    
    if Player and HitPart.Name == "Head" then
        Character.Humanoid.Health = 0
    end
end)

4 Likes