It's supposed to make a weapon's projectile go through the brick, but it isn't working.
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid == nil) then -- if there is no humanoid in the thing that's touching it...
script.Parent.CanCollide = false -- make the brick passable, or go-through (not working)
wait(3) --wait 3 seconds
script.Parent.CanCollide = true -- make the brick into a full brick again (not working)
elseif -- or if
(humanoid ~= nil) then -- a humanoid exists, then
humanoid.Health = 0 -- kill the player
end
end
script.Parent.Touched:connect(onTouch)

5 comments
Actually, it still isn't working. The brick is not going Dis-collideable.
The problem might be that the projectile is moving too fast.
well, it works once, then when the wall Can Collide it doesn't let my projectile pass through again.
There is a wait(3) in there. Are you waiting for at least 3 seconds?
it doesn't let my projectile pass ever again.