What would be an ideal way to handle an Admin Panel’s commands?
I have one idea for it but I’m not sure if it might be ideal for PlaceMemory, Script Memory and generally optimized code. Basically, the first idea was to have the Main LocalScript to setup the buttons and panel options.
local function setupPanel() : nil
local PanelButtons = Panel.Options
local PanelPages = Panel.OptionFrame
for _, Button : TextButton in ipairs(PanelButtons:GetChildren()) do
if Button and Button:IsA("TextButton") then
local Menu = PanelPages:FindFirstChild(Button.Name)
Button.MouseButton1Click:Connect(function()
PanelPages.Placeholder.Visible = false
if Menu and Menu:IsA("Frame") then
Menu.Visible = not Menu.Visible
end
end)
end
end
end
Then I would require the command’s module and everything would run in there.
My goal is to make a working optimized admin panel, so please feel free post your ideas! I don’t exactly need code snippets, just ideas.