I am making a game where if you click people, they will die after a bit. Main script is made but, I wanna know, how do I know which player has the most time in-game? I have made a leaderstats for it.
local Players = game:GetService("Players")
local function leaderboard(player)
local leaderstats = Instance.new("Folder", player)
leaderstats.Name = "leaderstats"
local timeD = Instance.new("IntValue", leaderstats)
timeD.Name = "Time"
timeD.Value = 0
while true do
wait(1)
timeD.Value = timeD.Value + 1
end
end
Players.PlayerAdded:Connect(leaderboard)
Please help.

1 comment
https://devforum.roblox.com/t/how-do-i-sort-numbers/295682