Greetings! I have a UI Framework, and for some reason, my settings UI works just fine, but not my Shop or Inventory UI.
Basically the issue is that the shop doesn’t want to close the UI when I switch the UI, but the Settings does even though the systems are very similar.
Settings:

Shop and Inventory:
The LocalScript inside of UI > Sidebar > Selection are identical. They are:
local TweenService = game:GetService("TweenService")
local FadeInfo = TweenInfo.new(0.2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false)
for _, Buttons in script.Parent:GetChildren() do
if Buttons:IsA("TextButton") then
Buttons.MouseButton1Click:Connect(function()
for _, Buttons2 in script.Parent:GetChildren() do
if Buttons2:IsA("TextButton") then
if Buttons2 ~= Buttons then
TweenService:Create(Buttons2, FadeInfo, {BackgroundTransparency = 1}):Play()
end
end
end
for _, Frames in script.Parent.Parent.Parent.Frames:GetChildren() do
if Frames:IsA("Frame") then
Frames.Visible = false
end
end
script.Parent.Parent.Parent.Frames[Buttons.Name].Visible = true
TweenService:Create(Buttons, FadeInfo, {BackgroundTransparency = 0}):Play()
end)
end
end
Not sure what my issue is.
If you need more info, that will be appreciated.
Thanks in advance!



