Hello! So i have a currency system in my game… and the code within the gui that shows it looks like thie: Note that the name of the currency is “Aires”
local player = game.Players.LocalPlayer
local CharVals = player:WaitForChild("CharacterStats")
local Aires = CharVals:WaitForChild("Aires")
local CopperIcon = script.Parent.Copper.NumberRing.Number.Nuum
local SilverIcon = script.Parent.Silver.NumberRing.Number.Nuum
local GoldIcon = script.Parent.Gold.NumberRing.Number.Nuum
CopperIcon.Text = Aires.Value
SilverIcon.Text = math.floor(Aires.Value/100)
GoldIcon.Text = math.floor(Aires.Value/10000)
Aires.Changed:Connect(function()
CopperIcon.Text = Aires.Value
SilverIcon.Text = math.floor(Aires.Value/100)
GoldIcon.Text = math.floor(Aires.Value/10000)
end)
This works great! 100 copper = 1 silver, 100 silver = 1 gold
However, i’d like to make it so that if you reach 100 copper, instead of continuously adding more of the copper aires, it resets to 0 or whatever denomination is left over between the silver aires, and likewise with silver to gold… so that if you have 100 Aires, it will display as 0 copper, and 1 silver. Or if you have 145 Aires, it will display as 45 copper and 1 silver.
Any thoughts? THANKS!