So I have searched over the internet for a tutorial, that shows the topmost player of the leaderboard after the round is over. But not a single website brings me satisfaction. So I thought that this website can help. Can you please teach me how to make the code? Thank you!
this is the way I like to do it, by putting everyone's score in a table, sorting the numbers in the table from least to greatest, and checking to see whose score matches the highest score
local allScores = {} -- empty for now so that we can fill it later for i, player in pairs(game.Players:GetPlayers()) do table.insert(allScores, player.leaderstats.Points.Value) end table.sort(allScores) -- now we have a table with all the scores in the game, sorted from least to greatest, so we can see what the highest score in the game was by finding the last value in the table for i, player in pairs(game.Players:GetPlayers()) do if player.leaderstats.Points.Value == allScores[#allScores] then -- #table is the last index in a table, so we can find the value at that index with table[#table] -- this person won so do whatever code to reward them, and this will also work if people tie end end