#Kill brick

10 messages · Page 1 of 1 (latest)

craggy flare
#
local Part = script.Parent

if Part.Touched:Connect(Hit) then
    Hit.Parent.Humanoid.Health = 0
end
``` try this
delicate trench
#

part.touched:connect(hit) will always be ture it doesn't make sense as a condition

lost wren
#
local Part = script.Parent

local function OnHit(hit)
local char = hit.Parent
local hum = char:FindFirstChild("Humanoid")

if hum then
hum.Health = 0
    end
end

Part.Touched:Connect(OnHit)
tight tapir
spiral roost
#
local connection = part.Toucher:Connect(OnTouch)

task.delay(10, function()
  -- disconnects the function OnTouch from the touch event after 10 seconds
  connection:Disconnect()
end)
tight tapir
#

Oh i see

#

Something for memory leak

spiral roost
#

Not really

#

Yes but the main thing is for example when you don't want to detect touch anymore