highscoreValue = "Max" hiscore = 0 hiperson = "" hint = Instance.new("Hint") hint.Text = "High Score: Nobody!" hint.Parent = game.Workspace function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local max = Instance.new("IntValue") max.Name = highscoreValue max.Value = 0 max.Parent = stats wait(1) stats.Parent = newPlayer end game.Players.PlayerAdded:connect(onPlayerEntered) function getDistance(player) local stats = player:FindFirstChild("leaderstats") if stats ~= nil then return stats[highscoreValue].Value end return 0 end while true do wait() players = game.Players:GetChildren() for i=1,#players do if getDistance(players[i]) > hiscore then hiscore = getDistance(players[i]) hiplayer = players[i].Name end end if hiplayer ~= nil then hint.Text = "High Score: "..hiplayer.." with ".. hiscore.."!" end end