Hello, i have the following issue.
my game allows player to get a very large score having 10 digits in the leader board looks ridicules so i came up with the following solution
if n > 1000 then
return math.floor(n / 1000) .. "K"
elseif n > 1000000 then
return math.floor(n / 1000000) .. "M"
else
return n .. ""
end
the issue is where should i place the statement?
should i make it into a function then call it every time a script changes to score value? or is there a way to run something everytime a value is changed?

2 comments
You can make a NumberValue (an actual physical object) that contains the player's score and use the the Changed event on that. I don't really use dataStore or leaderboards much so I couldn't tell you exacty where to store the NumberValue, that's up to you.
Slightly off topic but you need to check for n > 1000000 first instead of n > 1000 because if the score is 100000000 for example it still uses K instead of M.