if script.Parent.Parent.Main.PenumbraShadow.Visible = false then script.Parent:TweenSize(UDim2.new(0, 411,0, 345), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 0.5) end
the other gui closes everything and the shadow is the last one so I took it
Whenever you call a if statement you are going to use
== (means is equal to)
~= (means not equal to)
Also I think this is not in a fired function or anything so I applied a function when the Shadow gets invisible
script.Parent.Parent.Main.PenumbraShadow:GetPropertyChangedSignal("Visible"):Connect(function() if script.Parent.Parent.Main.PenumbraShadow.Visible == false then script.Parent:TweenSize(UDim2.new(0, 411,0, 345), Enum.EasingDirection.Out, Enum.EasingStyle.Quart, 0.5) end end)