--flora manager-- local stage = 1 --growth stage-- while true do wait(4) if script.Parent.GrowthNum.Value >= 25 and stage == 1 then stage = 2 local prevchildren = script.Parent.Parent.Parent.Stage1:GetChildren() local nextchildren = script.Parent.Parent.Parent.Stage2:GetChildren() for p = 1, #prevchildren do if prevchildren[p]:IsA("Part") then prevchildren[p].Transparency = 1 prevchildren[p].CanCollide = false end end for n = 1, #nextchildren do if nextchildren[n]:IsA("Part") then nextchildren[n].Transparency = 0 nextchildren[n].CanCollide = true end end elseif script.Parent.GrowthNum.Value < 25 and stage == 1 then script.Parent.GrowthNum.Value = script.Parent.GrowthNum.Value + 5 end end
no error comes up but when both for loops run, only some parts get changed. the rest are untouched. this is not desired as all parts involved should be changed.
Getting Children does not make changes to any parts, unless you change the properties.
For example,
for i,v in pairs(game.Workspace:GetChildren()) do if v:IsA("Part") then v.Color = Color3fromRGB(255,255,255) end