Hey, Cookie Tech!
I’ve recently been working really hard on my panel project, Admino. So far, I’ve been focusing on some minor scripting and revamping the UI design, but I came across some unfinished scripts that I need help with.
Essentially, in my panel, all the UI components for each of the sidebar categories is placed in a folder under a “MainUI,” as shown below;
As you can imagine, within each of these folders, there are a lot of UI elements, such as these folders shown below (It’ll make sense with my scripting query soon).
Now, there obviously needs to be a sidebar button to make the contents of each folder become visible - and invisible - whenever the button is clicked. Under StarterGui > MainUI > SidebarFrame, I have all the sidebar buttons, such as the examples below (the layout in the “Explorer” tab as well as the actual sidebar appearance on the Admino panel project itself).
So, as you can see, every single sidebar button has a script called “BtnLS” (LS stands for LocalScript). For example, in “CmdsBtn,” this is the code I have;
local folder = script.Parent.Parent.Parent.MainFrame.CmdsContents
local button = script.Parent
local sound = script.Parent.BtnSound
button.MouseButton1Down:Connect(function() --When button is pressed ...
-- ...then make these two elements within the folder visible, or invisible.
folder.CommandTypesSidebarFrame.Visible = not folder.CommandTypesSidebarFrame.Visible
folder.ModerationList = not folder.ModerationList.Visible
sound.Playing = true
Of course, this script works perfectly fine, but there is an issue you might’ve already caught onto …
These local scripts - within each of the sidebar buttons - will toggle the visibility of their respective folders (under the same name as the button, of course).
However, this means that whenever I click a button for a folder’s contents to become visible, whichever folder contents are already visible will be overlapped, resulting in - well, annoying overlaps.
I haven’t currently found a good solution for this issue, which is why I hope someone here on Cookie Tech will be able to offer some suggestions or assistance with changing up the BtnLS script a bit.
Thank you, and I hope this made sense!
ICONS DISCLAIMER
All the icons used in the Admino panel, such as the ones shown in the sidebar, are belongings of Flaticon and all credit for the icons (filled and 3D) goes to them.