Hey so I just started scripting yesturday and I can make kill bricks now but I was wondering if a specific part of your body touches the kill brick then you die instead of the whole humanoid touching it. Here's my code so far:
local function onTouched(player) local humanoid = player.Parent:FindFirstChild("Humanoid") if humanoid then humanoid.Health = 0 end end script.Parent.Touched:Connect(onTouched)
You can check the part name
local function onTouched(player) local humanoid = player.Parent:FindFirstChild("Humanoid") if humanoid then if player.Name == "Head" then -- Check the part name, for example: Head humanoid.Health = 0 end end end script.Parent.Touched:Connect(onTouched)