I'm trying to get the children of two models into 1 variable, I tried this, but won't work. Any help?
reds1 = elfins.ElfinFlower1.Lights.Red1:getChildren() and elfins.ElfinFlower2.Lights.Red1:getChildren()
You can assign each child to a single array with this script
local flowerCount = 2 -- If you have more flowers, change this. local reds1 = {} for i = 1, flowerCount do for _,v in pairs(elfins["ElfinFlower"..tostring(i)].Lights.Red1:GetChildren()) do table.insert(reds1, v) end end
Or, after reading your comment on Spongocardo's answer, you can
--Change: table.insert(reds1, v) --To: v.SurfaceGui.Enabled = true
You can't use "and" when assigning a variable, you have to assign separate variables to each value.
red1_1 = elfins.ElfinFlower1.Lights.Red1:GetChildren() red1_2 = elfins.ElfinFlower2.Lights.Red1:GetChildren()