I really have know idea of how to make this. The other people arent LISTING WHERE TO PUT IT.
Is it like: If i. Leaderstats.value = 1000 do text = "1k"
Hey dude i don't know if this works anymore cause i used it a long time ago, but here give it a try:
local function comma_value(amount) -- Stolen from here http://lua-users.org/wiki/FormattingNumbers local formatted = amount while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2') if (k==0) then break end end return formatted end local function formatTokens(amount) if game.Players.LocalPlayer.leaderstats.Tokens.Value > 100000000 then return comma_value(amount/1000000).."M" elseif game.Players.LocalPlayer.leaderstats.Tokens.Value >= 100000 then return comma_value(amount/1000).."K" else return comma_value(amount) end end local function refreshTokenText() --[[if game.Players.LocalPlayer.leaderstats.Tokens.Value > 99999 and game.Players.LocalPlayer.leaderstats.Tokens.Value < 1000000 then script.Parent.Text = comma_value(game.Players.LocalPlayer.leaderstats.Tokens.Value/100000) .."K" end if game.Players.LocalPlayer.leaderstats.Tokens.Value > 999999 then script.Parent.Text = comma_value(game.Players.LocalPlayer.leaderstats.Tokens.Value/1000000) .."M" end if game.Players.LocalPlayer.leaderstats.Tokens.Value < 100000 then script.Parent.Text = comma_value(game.Players.LocalPlayer.leaderstats.Tokens.Value) end]]-- script.Parent.Text = formatTokens(game.Players.LocalPlayer.leaderstats.Tokens.Value) end repeat wait() until game.Players.LocalPlayer:FindFirstChild("leaderstats") and game.Players.LocalPlayer:FindFirstChild("leaderstats"):FindFirstChild("Tokens") refreshTokenText() game.Players.LocalPlayer.leaderstats.Tokens.Changed:Connect(function() refreshTokenText() end)
Of course you need to change things inside, example as "Tokens" and other stuff."
if worked or helped please accept, comment if there's a problem.
Literally just check the lenght of the number and in case it has more than a number then just keep first numbers and add a "k"