Changing a property of multiple instances at once

Hey developers, in my game i have a bunch of lights to light it up, and now i need to make a script to turn all the lights off at once, can anyone help me with it?


I have an idea how to do it but i don’t know how to make it, can someone help me make it? :slightly_smiling_face:

Thanks!

PS: All lights are inside a folder

Loop through the parent with GetChildren()

local Inst = -- The Instance that contains the lights

for _, v in ipairs(Inst:GetChildren()) do -- Iterates through all the children
    v.PropertyHere = ValueHere
end
1 Like