Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Lots of lag in my script?

Asked by 9 years ago

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 answer

Log in to vote
2
Answered by 9 years ago

Is the script lagging in actual play mode (not in studio)? Sometimes that's the problem. I have a game that I have 5 different files for testing to keep the lag down, and a testing place for...well...testing, and it always runs perfectly fine in testing

0
i figured it out. thanks freerobux456 0 — 9y
Ad

Answer this question