oh yep it works now but insdead of not shortening it to 1t or something it says this:
so try this:
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
local formatNumber = require(replicatedStorage:WaitForChild("FormatNumberAlt"))
local player = players.LocalPlayer
local gems = player:WaitForChild("leaderstats"):WaitForChild("Gems")
local gemsLabel = script.Parent:WaitForChild("Gems"):WaitForChild("Label")
local textGems = formatNumber.FormatCompact(tonumber(gems.Value))
gemsLabel.Text = textGems
while true do
wait()
local text = formatNumber.FormatCompact(tonumber(gems.Value))
gemsLabel.Text = textGems
end
if this is not work so the “FormatNumberAlt” module in replicated storage is not working
yea it aint working now, i wonder whats wrong with formatbumberalt
so what should i do now about the script?
im making new script maybe its take some time
I completely missed the fact that you were using the older, alternative API of the FormatNumber module. Using the same code I provided earlier, remove .Simple
in this line:
local formatNumber = require(replicatedStorage:WaitForChild("FormatNumberAlt").Simple)
The linked post is updated.
I reckon you use MoneyLib. It’s good and reliable
um the line is kinda crossed out…
It was intentional, as I have updated my post I was mentioning. Have you tried running the code again, with the change I made?
oh wait did you edit it again?
ok yea i have now, but it doesnt work and im starting to think that its formatNumberAlt
Have you checked your Output? Are there any errors displayed?
ah ha its in one of the formatnumberalt scripts
Strange. What Value are you using for the leaderstats? NumberValue
or IntValue
? Something else?
And what value did you exactly place in the object?
i’m using an int value and what object?
Before calling FormatCompact()
, can you print the value of Gems
?
local gemsLabel = script.Parent.Gems.Label
warn(`I have {gems.Value} gem(s)`) ------ Here
local textGems = formatNumber.FormatCompact(tonumber(gems.Value))
gemsLabel.Text = textGems
local function update() -- Callback function separated to its own block.
warn(`I now have {gems.Value} gem(s)`) ------ Here
textGems = formatNumber.FormatCompact(gems.Value)
gemsLabel.Text = textGems
end
ok so which script shall i plop it in?
ok which script though im kinda confused?
It’s the same script. Do not replace all of its code with the one I provided, rather replace the portion of the code that’s identical to it.