Do alot of while true do loops create lag?

I want to know if alot of while true do loops create lag
Like if i have 50 while true do loops that each wait 0.1 seconds, does it create a lot of lag?

1 Like

Not necessarily, but if you’re spawning parts 50 times every 0.1 seconds then definitely.

1 Like

As @MikeartsRBLX said, if you are doing the loop that spawns a instance which the game needs to render( mostly BaseParts ).
doing something like calculating an easy math inside the loop, or making any number variables keep increase, these things doesnt make the game lag.
But spawning Instances, mostly BaseParts, makes the game very laggy.

1 Like

okay, so does that mean my loop that checks if a value is true every 0.1 seconds will lag the game?

I think you’d be better off with .Changed event if you want to check for an Instance’s value instead of having to set up a loop. I forgot to say that no it will not lag

1 Like

okay. I will do that instead of while true do loops

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.