So what I'm trying to do is make a leaderboard that calculates the distance from the player to a certain point and displays the higher distance. So if I'm a user and I walk 100 paces from a point but then I walk 50 paces back towards the point, the leaderboard would still display 100. So far, I have this as my leaderboard script.
function onPlayerEntered(newPlayer) local stats = Instance.new("IntValue") stats.Name = "leaderstats" local c = Instance.new("IntValue") c.Name = "Distance"
spawn(function() while(true)do c.Value = print(onPlayerEntered():DistanceFromCharacter(Vector3.new(-208, 0.5, 1018))) end end)
c.Parent = stats stats.Parent = newPlayer
newPlayer.Changed:connect(function(property) end) end game.Players.PlayerAdded:connect(onPlayerEntered)
Can someone explain to me how to correctly make my leaderboard? Thank you.

4 comments
Thank you so much! I really appreciate it. It works just swell.
I hope you learned something :D
Haha. Sure did! Thanks again
No problem!