Hi! I´m developing a racing game and I have a leaderboard with the laps and Points that each player is getting when they touch some invisible checkpoints that I spread all over the track.

I created this code and placed it in the ServerScriptService so that when Player 1 has more points than Player 2, the leaderboard moves him upwards but it´s not doing anything, can I have some help please?

wait()
local allPlayers = game.Players:GetPlayers()
local points = game.Players.LocalPlayer.leaderstats.Points


	
 while true do
	    wait(1)
	print(".")
	table.sort(allPlayers,function(a,b)
		return a.points.Value > b.points.Value
	end)
end