How do I make a global leader board show the smallest value at the top?

So in my game: Timed Obby, your goal is to complete different short obbys in the smallest amount of time and i want to make a global leader board that shows who completed it in the shortest amount of time.

The issue is that the person who took the longest to complete it will show up at the top, because its the highest value.

I already have a made the best time and a system to check if your current time is better than you best time and if it is it will change it.

Is there a way to invert the global leader board to make it show to smallest value at the top?

This is the global leader board code(I got the global leader board from a youtube named HowToRoblox):

--bgt means Best Green Time
local ds = game:GetService("DataStoreService")

local bgtODS = ds:GetOrderedDataStore("BestGreenTime")


local timeUntilReset = 10


while wait(1) do
	
	
	timeUntilReset = timeUntilReset - 1
	
	script.Parent.Parent.ResetTime.Text = "Resetting in " .. timeUntilReset .. " seconds..."
	
	
	if timeUntilReset == 0 then
		
		timeUntilReset = 10
	
	
		for i, plr in pairs(game.Players:GetPlayers()) do
			
			bgtODS:SetAsync(plr.UserId, plr.leaderstats.BGT.Value)
		end
		
		for i, leaderboardRank in pairs(script.Parent:GetChildren()) do
			
			if leaderboardRank.ClassName == "Frame" then
				leaderboardRank:Destroy()
			end
		end
		
		
		local success, errorMsg = pcall(function()
			
			local data = bgtODS:GetSortedAsync(false, 50)
			local bgtPage = data:GetCurrentPage()
			
			for rankInLB, dataStored in ipairs(bgtPage) do
				
				
				local name = game.Players:GetNameFromUserIdAsync(tonumber(dataStored.key))
				local BestGreenTime = dataStored.value
				
				
				local template = script.Template:Clone()
				
				template.Name = name .. "Leaderboard"
				
				template.PlrName.Text = name
				
				template.Rank.Text = "#" .. rankInLB
				
				template.Coins.Text = BestGreenTime
				
				template.Parent = script.Parent				
			end			
		end)
	end
end

Any help will be appreciated.

You could just sort all of the players data and compare with everyone elses data. (If you have a datastore or something)

I have a datastore for the players best time but how would i sort them with others?

Wait is this all players, or just everyone in the server?

The global leader board is for all players that have joined the game.

So are you talking about this?

The global leaderboard also shows the people who have left.

Change the false to true to make the sort order ascending. Smallest to largest.

When i did that nothing showed up.

How about you do table.sort? Since that gets you the smallest amount first and goes on to larger numbers as it goes.

https://www.lua.org/pil/19.3.html

Why is me changing the boolean value to true not making it show up?