Hello guys and i have a simple brick that fades away when touched, and fades back. The fade part works fine, but there is a 2-3 second delay until it changes the canCollide
script.Parent.Touched:connect(function(hit)
if hit.Parent and hit.Parent.Humanoid then
for i=10, 0, -1 do
script.Parent.Transparency = script.Parent.Transparency + 0.1
if script.Parent.Transparency == 0.9 then script.Parent.CanCollide = false break end
wait(0.1)
end
wait(2)
for i=10, 0, -1 do
script.Parent.Transparency = script.Parent.Transparency - 0.1
if script.Parent.Transparency == 0.1 then script.Parent.CanCollide = true break end
wait(0.1)
end
end
end)
Any help is appreciated.

1 comment
i figured it out. thanks