Hello. I'm trying to make a script that while touched, turns the color of all the lights in a game red, and the point lights inside them red as well. I tried to use "GetDescendants" and "GetChildren", but they didn't seem to work. The light parts are all in a model called "lights" in Workspace. Is there even a correct way to change the properties of all parts in a model at once without having to address them all individually? Any help would be greatly appreciated. Thanks!
local lights = game.Workspace.lights:GetDescendants()
local part = script.Parent
local pointlights = lights:GetChildren():GetChildren("PointLight")
part.Touched:connect(function()
lights.BrickColor = BrickColor.new("Bright red")
pointlights.Color = Color3.new(1, 0.109804, 0.109804)
end)
script.Parent.TouchEnded:connect(function()
lights.BrickColor = BrickColor.new("Institutional white")
pointlights.Color = Color3.new(1, 1, 1)
end)

2 comments
While yes, this does answer his question, I personally believe he has a more underlying problem. That being TouchEnded being so finicky and so useless. I swear I had this typed before you sent your comment on my post lol*
I swear I didn’t copy yours, ours are different