DESCRIPTION
So I’m making a plugin for UI Designers to have to make their designing life easier, and what I’m trying to do is make a Search Filter for the plugin to make finding the assets easier for the person using the said plugin.
MY PROBLEM
This script only runs correctly ONCE, and then it completely bugs out and stops working.
MY SCRIPT
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
WHERE I THINK THE PROBLEM RESIDES
Even with my minimal scripting knowledge, I can still take a guess on where the problem comes from:
Here ↓
Even More Specifically Here ↓
Maybe it’s as a result of the open value not returning to true or something? I really don’t know.
VIDEO
EXPLORER PICTURE
Thank you to everyone who responds!
IF ANYONE HAS ANY QUESTIONS, COMMENTS, OR CONCERNS, I’D BE HAPPY TO ANSWER THEM!