Im trying to make a tool open/close, code is below
open = script.Parent.Parent.Parent.Open
while true do
if open.Value == true then
local c = script.Parent:GetChildren()
for i = 1, #c do
if c[i].ClassName == "UnionOperation" then
if c[i]:FindFirstChild("LeftFlang") ~= nil then
c[i].Transparency = 0
elseif c[i]:FindFirstChild("RightFlang") ~= nil then
c[i].Transparency = 0
else
local c = script.Parent:GetChildren()
for i = 1, #c do
if c[i].ClassName == "UnionOperation" then
if c[i]:FindFirstChild("LeftFlang") ~= nil then
c[i].Transparency = 1
elseif c[i]:FindFirstChild("RightFlang") ~= nil then
c[i].Transparency = 1
wait()
end
wait()
end

2 comments
There should be an end between line 11 and 12 and line 19 and 20. I would recommend using "for _,c in pairs(script.Parent:GetChildren()) do". Otherwise, yes, you are using "GetChildren" correctly.
if statements need to be closed by an 'end'