The simplest way is to use if statements, but this also means you'll need two different values.
One will be either the IntValue or NumberValue for how much cash (or ore, experience, ) the player has. Put this probably inside the PlayerGui. The other should be the StringValue (since it contains letters in addition to numbers) that goes on the leaderboard.
Whenever the player gets cash, increment the IntValue. Next have something in the script kind of like this:
Cash = Player.PlayerGui.IntValue
AbbreviatedCash = YourLeaderStatsHere.StringValue
...
Cash = Cash+50
If Cash > 1000 then
AbbreviatedCash =math.floor (Cash/1000).."K"
elseif Cash >1000000 then
AbbreviatedCash = math.floor(Cash/1000000).."M"
elseif Cash < 0 then
AbbreviatedCash = "You're broke"
else
AbbreviatedCash = Cash
end
Something like that, hope this works and helps :D
1 comment
shortened: function Convert(n)local l=math.min(5,math.floor(math.log10(n)/3))return l==0 and n or math.floor(n/1000^l+.5)..({'K','M','B','T','Q'})[l]..'+'end