--Hover and select home buttons

local hovering = nil
for a,b in pairs(pages.Home:GetChildren()) do
	if b:IsA("TextButton") then
		local fade = b.Fade
		local function pressButton()
			if guiDe then
				guiDe = false
				local pageIn = pages:FindFirstChild(b.Name)
				if pageIn then
					tweenPages(UDim2.new(-1,0,0,0), pageIn)
				end
				guiDe = true
			end
		end
		if main.device == "Mobile" then
			b.MouseButton1Up:Connect(function()
				pressButton()
			end)
		else
			b.MouseButton1Down:Connect(function()
				pressButton()
			end)
		end
		b.InputBegan:Connect(function(input)
			if not b.RankBlocker.Visible then
				main.tweenService:Create(fade, TweenInfo.new(0.2), {BackgroundTransparency = 0.8}):Play()
			end
		end)
		b.InputEnded:Connect(function(input)
			main.tweenService:Create(fade, TweenInfo.new(0.2), {BackgroundTransparency = 1}):Play()
		end)
	end
end
