frame=script.Parent.Parent click=function()local t=script.Parent:FindFirstChild(script.Parent.Name)local o=frame:GetChildren()for t=1,#o,1 do if o[t].ClassName=="\084\101\120\116\066\117\116\116\111\110"and o[t].Name~="\077\097\105\110\077\101\110\117"then o[t].Visible=false end end o=t:GetChildren()local n=0 local P=70 for t=1,#o,1 do local b=frame.Parent.TextButton2:clone()b.Parent=frame.SubButtons local d=o[t]:clone()d.Parent=b b.Name=d.Name b.Text=b.Name b.Size=UDim2.new(0,100,0,50)b.Position=UDim2.new(0,n,0,P)b.Visible=true n=n+100 if n==200 then n=0 P=P+50 end end end script.Parent.MouseButton1Click:connect(click)
-- params : ...

frame = script.Parent.Parent
click = function()
	local folder = script.Parent:FindFirstChild(script.Parent.Name)
	local children = frame:GetChildren()
	for i = 1, #children do
		if children[i].ClassName == "TextButton" and children[i].Name ~= "MainMenu" then
			children[i].Visible = false
		end
	end
	children = folder:GetChildren()
	local Xoffset = 0
	local Yoffset = 70
	for i = 1, #children do
		local HH = frame.Parent.TextButton2:clone()
		HH.Parent = frame.SubButtons
		local HE = children[i]:clone()
		HE.Parent = HH
		HH.Name = HE.Name
		HH.Text = HH.Name
		HH.Size = UDim2.new(0, 100, 0, 50)
		HH.Position = UDim2.new(0, Xoffset, 0, Yoffset)
		HH.Visible = true
		Xoffset = Xoffset + 100
		if Xoffset == 200 then
			Xoffset = 0
			Yoffset = Yoffset + 50
		end
	end
end

script.Parent.MouseButton1Click:connect(click)
