My Code:
local MainFrame = script.Parent.Parent.Parent.MainFrame
local drop = script.Parent
local menu = drop.Menu
local open = menu.Open.Value
local selection = drop.Selection
local Frame1 = script.Parent.Parent.ButtonsDropdown
local Frame2 = script.Parent.Parent.FramesDropdown
local Frame3 = script.Parent.Parent.LightingDropdown
local Frame4 = script.Parent.Parent.IconsDropdown
local Open1 = Frame1.Menu.Open
local Open2 = Frame2.Menu.Open
local Open3 = Frame3.Menu.Open
local Open4 = Frame4.Menu.Open
local function closeFrames()
for _, item in ipairs(Frame2:GetChildren()) do
if item:IsA("Frame") then
item:TweenSize(UDim2.new(1, 0, 0, 0), "Out", "Sine", 0.15, true)
wait(0.01)
item.Visible = false
end
end
for _, item in ipairs(Frame3:GetChildren()) do
if item:IsA("Frame") then
item:TweenSize(UDim2.new(1, 0, 0, 0), "Out", "Sine", 0.15, true)
wait(0.01)
item.Visible = false
end
end
for _, item in ipairs(Frame4:GetChildren()) do
if item:IsA("Frame") then
item:TweenSize(UDim2.new(1, 0, 0, 0), "Out", "Sine", 0.15, true)
wait(0.01)
item.Visible = false
end
end
end
function trigger()
if not open then
menu:TweenSize(UDim2.new(1, 0, 6.238, 0), "Out", "Sine", 0.15, true)
for _, button in pairs(menu:GetChildren()) do
if button:IsA("TextButton") then
button.Visible = true
end
end
wait(0.001)
open = true
else
closeFrames()
wait(0.001)
for _, button in pairs(menu:GetChildren()) do
if button:IsA("TextButton") then
button.Visible = false
end
end
open = false
Open2 = false
Open3 = false
Open4 = false
end
end
selection.MouseButton1Click:Connect(trigger)
for _, button in pairs(menu:GetChildren()) do
if button:IsA("TextButton") then
button.MouseEnter:Connect(function()
button.BackgroundTransparency = 0.8
end)
button.MouseLeave:Connect(function()
button.BackgroundTransparency = 1
end)
button.MouseButton1Click:Connect(function()
script.Parent.Parent.Parent.CurrentPage.Text = button.Text.." Buttons"
trigger()
end)
end
end
I want this to close out all of the frames