local u=game.Players.LocalPlayer local r=u.leaderstats.Gold local m=script.Parent local function S()local u=r.Value if u>999 then if u>=1000000 then m.Text=string.format("\037\046\049\102\077",u/1000000)elseif u>=1000 then m.Text=string.format("\037\046\049\102\075",u/1000)end else m.Text=tostring(u)end end r.Changed:Connect(S)S()
-- local script inside a TextLabel
local player = game.Players.LocalPlayer
local goldValue = player.leaderstats.Gold
local textLabel = script.Parent

local function updateText()
	local gold = goldValue.Value
	if gold > 999 then
		if gold >= 1000000 then
			textLabel.Text = string.format("%.1fM", gold / 1000000)
		elseif gold >= 1000 then
			textLabel.Text = string.format("%.1fK", gold / 1000)
		end
	else
		textLabel.Text = tostring(gold)
	end
end

goldValue.Changed:Connect(updateText)
updateText()
