Is it possible to make a script that applys it on all parts in the model?

Hi! Im pretty new with scripting, but heres my issue:

I am basically working on a power outage script, but I got so many light parts in the game and I grouped all of them, is there a way to make a script to applys it to all lightning parts, lets say all the light parts brightness go to 0. I searched for many solutions on youtube, didnt find alot.

Yes.
You can use collectionService or simply a for loop to change all the parts.

3 Likes

How do I use it? I dont really know about it.

for i, v in ipairs(childrens) do
   -- v represents the current children its iterating.
   -- i represents the index of the table
end

Put some checks and run it in the console :wink:

1 Like