Most efficient way to go about this?

So I can’t imagine having 100 scripts with while true do running.

Or does it really matter? Is there a difference between 1 script with a while loop running (and you put all your code you want to run inside) vs creating 20 scripts with a while loop and them having separate things. Do these run both the same efficiency?

Like I want to create some spot light effects that run on a while loop. I’m wondering, is it better to have 1 script that changes all the lights at once. Or does it matter if each has a script constantly running a while loop changing their colors?

2 Likes

dude one time for one of my games i had a while loop for every instance, nothing really caused it any trouble and correct me but i am pretty sure robloxs thing for translating the scripts to the vm is optimized to handle this

1 Like

Couldn’t you use RunService? It works almost the same as while true do but faster!

I’m not concerned with faster. I’m wanting to make an efficient map (minimize lag and what not)

You should use CollectionService for this.

1 Like

Good to know thanks Good to know thanks