I’ve been working on an auto updating script that shows the value of the number in the player’s GUI as k(thousand), m(million) and so on. This script is working on two values: one shows what the player currently has and one shows the maximum capacity the player can have.
The problem is that the part that shows the maximum capacity doesn’t update in the game. The script prints show that it’s updated but when checking the player gui and the values inside it’s still unchanged.
For testing i tried to manually change the text value in the player gui and see if the prints recognise the change to make sure that the text is defined correctly but no problem there.
This is the sample of my code.
while true do
updt = script.Parent
totaltext = script.Parent.Parent.Total.Text
--these are locally stored values. They will be modified by the server according to data storage
number = game.ReplicatedStorage.Coins.Value
total = game.ReplicatedStorage.TotalCoins.Value
--checknum just changes the number to the final text ex:100M.
visual = checknum(number)
vtotal = checknum(total)
updt.Text = visual
totaltext = "/"..vtotal
print(totaltext)
task.wait(0.2)
end
The updt part works correctly. My problem is with totaltext not updating.