You know-how in all Roblox simulator games the numbers are compressed and turned into instead of 10,000 its 10K and instead of 1,000,0000 its 1M. How can I implement that into my script?
local plr = game.Players.LocalPlayer local value = plr.Character:WaitForChild("LeftHand").Drinkies.Part.Value value.Changed:Connect(function() if value.Value == value.Parent.MaxValue.Value then script.Parent.TextLabel.Text = value.Value.."/"..value.Parent.MaxValue.Value script.Parent.Parent.FullBag.Visible = true else script.Parent.TextLabel.Text = value.Value.."/"..value.Parent.MaxValue.Value end end)
It's really simple, all you need to do is check if it is divisible by a thousand/million/billion and then handle it accordingly:
function check(num) if (num/1000000)>1 then print("$"..num/1000000 .."M") elseif (num/1000)>1 then print("$"..num/1000 .."K") end end check(2000000)
Your number would be the num, but in my case, it would turn that 2000000 into $2M. Also take note that you will want to check if it is larger first, if I switched those, it would print $2000K.
If this answers your question, then mark it as the accepted solution.