xxxxxxxxxx
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health = 0
end
end)
xxxxxxxxxx
local killBrick = -- index your kill brick here
local function onTouched(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid == nil then return end
humanoid:TakeDamage(humanoid.MaxHealth)
-- doesn't kill if a ForceField is guarding the Character
end
killBrick.Touched:Connect(onTouched)
xxxxxxxxxx
function kill(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
humanoid.Health = 0
end
end
script.Parent.Touched:connect(kill)