the title explains it all it times out the game, also dont test this it WILL crash yur computer
function touch() while true do for i = 1, 100 do if script.Parent.Transparency + 0.1 then script.Parent.CanCollide = false if script.Parent.Transparency == 0 then for i = 1, 100 do if script.Parent.Transparency - 0.1 then script.Parent.CanCollide = true if script.Parent.Transparency == 1 then wait(1) end end end end end end end end script.Parent.Touched:Connect(touch)
I'm assuming that you need a brick that changes its transparency from 0 to 1. (I am not too sure what is the value for opaque and transparent.)
Also, I assume that there is no wait in the for i
and while true do
loop.
So here is the script, I assume.
function touch() for i = 1,100 do script.Parent.Transparency = script.Parent.Transparency - 0.01 wait(0.05) end
If you want CanCollide to be turned off, you can add it before the loop. :>
The loop seem not good at all, you should add wait(5)
to anti-lag.
function touch() while true do for i = 1, 100 do if script.Parent.Transparency + 0.1 then script.Parent.CanCollide = false if script.Parent.Transparency == 0 then for i = 1, 100 do if script.Parent.Transparency - 0.1 then script.Parent.CanCollide = true if script.Parent.Transparency == 1 then wait(1) end end end end end end wait(5) end end script.Parent.Touched:Connect(touch)
That's all.