So in my game I’m planning to have a round system that will pick a winner based on the greatest amount of a leaderboard value. How would I go about picking the player with the highest number? I have this piece of code so far, and I’m not sure if this is the wrong way to go.
local timer = script.Parent.Parent.Parent.timer.timer.Text
local winner = script.Parent
while true do
if timer ~= "0" then
winner.Active = false
elseif timer == "0" then
winner.Active = true
for _, v in pairs(game.Players:GetDescendants()) do
if v.Name == "leaderstats" then
end
end
end
wait(1)
end