Hey guys, first of all i know the title is totally different thing from this but the site does not let me to write any title about UI idk why its not request and its clear enough but yah... so... im making UI for my game and i have a few buttons with a few frames. When you click the buttons the frames tween their position and appear on the screen. I made a variables that used to "check" if some UI is opened then close it and open the new one, but here started the problems. I tried a few different ways to do it with variables but it aways had some problems for example you have to click 2-3 times untill it close or it closes and never opens again until you open the other Ui, close it and then try to open the first one again. Sounds confusing so i will put a gif to show you what i mean
Some dude told me to put the frames into a table and then loop the tweens this way
local current
for _,button in pairs(folder:GetChildren()) do
if current == nil then
current = button.Name
--open the frame
elseif current == button then
current = nil
--close the frame
else
current = button
--close all the frames
--open the wanted frame
end
end
but i have no idea what is that supposed to mean for example what is "button" how switch between the buttons because there is not only one button there are a few buttons, also the first "if" argument
if current == nil then
current = button.Name
--open the frame
doesnt that mean that the ui will open nonstop even if player wants to close it?
