#How to change the properties of serveral at once

20 messages · Page 1 of 1 (latest)

narrow tide
#

Use a for loop.

Assign “Lab” as a variable.

Then do:
for i, Light in ipairs(Lab:GetChildren()) do
— Change light property here
end

It’ll iterate through all the children inside Lab and change its property based on “Light”

#

i for Index, and Light for the variable of the children inside Lab

rich juniper
#

the lights also didn't turn off? there was no error at the same time though

polar hedge
#

you need to do Light.Light.Spotlight.Enabled = false

rich juniper
#

right

#

but i also need to be able to put it to change several parts at once with a certain name

#

wait so that will make it so if i just name it it'll work after light.--name--.material

#

?

#

so this'll work?

#

yep!

#

thank you so much!

#

thank you to everyone who help me!!!

#

erm it didnt work..

#

and theres no error message again

#

...

#

@gray talon ?

naive palmBOT
#

studio** You are now Level 14! **studio

rich juniper
#

oh okay