I am currently having an issue with a Ui script in my game that should be closing 1 ui when another one in the list is clicked. It was working with my other menu but I am having problems with this one now.
If anyone might know what I am doing wrong, it would be a huge help to get this figured out! Thank you!
local button = script.Parent
local clicked = false
local teams = script.Parent.Parent:WaitForChild("General")
local function onOpen()
teams.Visible = true
end
local function onClose(ui)
ui.Visible = false
end
button.MouseButton1Click:Connect(function()
if clicked == false then
onOpen()
for i,v in pairs(script.Parent.Parent.Parent.Parent.QCH.holder:GetChildren()) do
if v.ClassName == "Frame" then
if v.Name ~= "General" then
if v ~= teams then
onClose(v)
end
end
end
end
clicked = true
elseif clicked == true then
onClose(teams)
clicked = false
end
end)
