Lots of lag in my script?
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
01 | script.Parent.Touched:connect( function (hit) |
02 | if hit.Parent and hit.Parent.Humanoid then |
05 | script.Parent.Transparency = script.Parent.Transparency + 0.1 |
06 | if script.Parent.Transparency = = 0.9 then script.Parent.CanCollide = false break end |
13 | script.Parent.Transparency = script.Parent.Transparency - 0.1 |
14 | if script.Parent.Transparency = = 0.1 then script.Parent.CanCollide = true break end |
Any help is appreciated.