--Button:WaitForChild('Backdrop')



Button.MouseEnter:connect(function()
	--Button.Icon.ImageColor3 = Color3.new(1,1,1)
	Button.Label:TweenPosition(UDim2.new(0,0,.75,-2),'Out','Quint',.2,true)
	Button.Icon:TweenPosition(UDim2.new(0.5,0,.4,0),'Out','Quint',.2,true)
	--Button.Backdrop:TweenPosition(UDim2.new(0,0,0,0),'Out','Quint',.2,true)
end)

Button.MouseLeave:connect(function()
	--Button.Icon.ImageColor3 = Color3.new(0,0,0)
	Button.Label:TweenPosition(UDim2.new(0,0,1,0),'In','Back',.2,true)
	Button.Icon:TweenPosition(UDim2.new(0.5,0,.5,0),'In','Back',.2,true)
	--Button.Backdrop:TweenPosition(UDim2.new(0,-2,0,0),'Out','Back',.2,true)
end)

Button.Toggle.MouseButton1Click:connect(function()
	if not Open then
		Open = true
		current = script.Parent.Parent.Menus[Button.Name]
		script.Parent.Parent.Menus[Button.Name]:TweenPosition(UDim2.new(0,0,0,32),'Out','Quint',.4,true)
		TransformTopBar(script.Parent.Parent.Menus[Button.Name])
	end
end)

Top:WaitForChild('Exit').MouseButton1Click:connect(function()
	if Open then
		if Purchasing == false then
		Open = false
		if current.Name == 'In' then
			current.RTypeBox.Selected.Value = ''
			current.UsernameBox.Input.Text = ''
			current.UsernameBox.Input.AutoFill.Text = ''
			current.UsernameBox.Label:TweenSizeAndPosition(UDim2.new(1,0,.7,0),UDim2.new(0,0,.5,0),'Out','Quint',.2,true)
		end
		if current.Name == 'Out' then
			current.UsernameBox.Input.Text = ''
			current.UsernameBox.Input.AutoFill.Text = ''
			current.UsernameBox.Label:TweenSizeAndPosition(UDim2.new(1,0,.7,0),UDim2.new(0,0,.5,0),'Out','Quint',.2,true)
		end
		current:TweenPosition(UDim2.new(0,0,1,32),'Out','Quint',.4,true)
		TransformTopBar(script.Parent)
		else
		script.Parent.Parent.Menus.Purchasing:TweenPosition(UDim2.new(0,0,1,32),'Out','Quint',.4,true)
		TransformTopBar(script.Parent.Parent.Menus.Help)
		current = script.Parent.Parent.Menus.Help
		Purchasing = false
		end
	end
end)

end

Top.Search.MouseButton1Up:connect(function()
	if current then
		current:TweenPosition(UDim2.new(0,0,1,32),'Out','Quint',.4,true)
		TransformTopBar(script.Parent.Parent.Menus.Help)
		if current.Name == 'In' then
			current.RTypeBox.Selected.Value = ''
			current.UsernameBox.Input.Text = ''
			current.UsernameBox.Input.AutoFill.Text = ''
			current.UsernameBox.Label:TweenSizeAndPosition(UDim2.new(1,0,.7,0),UDim2.new(0,0,.5,0),'Out','Quint',.2,true)
		end
		if current.Name == 'Out' then
			current.UsernameBox.Input.Text = ''
			current.UsernameBox.Input.AutoFill.Text = ''
			current.UsernameBox.Label:TweenSizeAndPosition(UDim2.new(1,0,.7,0),UDim2.new(0,0,.5,0),'Out','Quint',.2,true)
		end

	end
		current = script.Parent.Parent.Menus.Help
		TransformTopBar(script.Parent.Parent.Menus.Help)
		Open = true
		current:TweenPosition(UDim2.new(0,0,0,32),'Out','Quint',.4,true)
		Top.Exit.MouseButton1Up:connect(function()
			if Open then
				Open = false
				current:TweenPosition(UDim2.new(0,0,1,32),'Out','Quint',.4,true)
				TransformTopBar(script.Parent)
			end
		end)
end)

script.Parent.Parent.Menus:WaitForChild('Help'):WaitForChild('buy'):WaitForChild('Toggle').MouseButton1Up:connect(function()
	if current == script.Parent.Parent.Menus.Help then
		script.Parent.Parent.Menus.Purchasing:TweenPosition(UDim2.new(0,0,0,32),'Out','Quint',.4,true)
		Purchasing = true
		--current = script.Parent.Parent.Menus.Purchasing
	end
end)
