#Kill brick
10 messages · Page 1 of 1 (latest)
part.touched:connect(hit) will always be ture it doesn't make sense as a condition
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)
Oh what it returns a boolean? Isnt it an event
It returns a connection to be disconnected later
local connection = part.Toucher:Connect(OnTouch)
task.delay(10, function()
-- disconnects the function OnTouch from the touch event after 10 seconds
connection:Disconnect()
end)