So this is a GUI script that should open and close the frame named FRAME when clicked, but it also needs to always have a frame called ScrollingFrame visible. This script seems like when clicked it doesn't recognize ScrollingFrame as a child so it just makes all of the frames Visibility false. To sum up the objective of the script it is to toggle "FRAME"'s visibility when the button is clicked, but leave ScrollingFrame (one of the children of ITFRAME) visible at all times. thanks for any help guys!
local BUTTON = script.Parent
local ITFRAME = BUTTON.Parent.Parent
local FRAME = ITFRAME.Hull
local NAME = BUTTON.Text
local ITEMNAME = FRAME.Itemname
local ScrollingFrame = ITFRAME.ScrollingFrame
FRAME.Visible = false
function on_button1_down()
for I,v in pairs (ITFRAME:GetChildren()) do
if v.Name == ScrollingFrame -- Most likely the problem, isn't recognizing the ScrollingFrame as a Child of ITFRAME?
then v.Visible = true
else v.Visible = false
end
end
ITEMNAME.Text = NAME
end
BUTTON.MouseButton1Down:connect(on_button1_down)
