Make Text in TextLabel Equal to Value of IntValue

Hello, I am trying to make a Wallet and Bank system. I have ran into a problem though, when I try to make the Text in a TextLabel display the Value of an IntValue, it doesn’t work. I am not sure what could be missing.

I’m pretty new so if it’s a stupid reason I’m sorry.

image

image

the currentBank and currentWallet variables are not objects but strings. Changing their values do not update the object property of BankAmount and WalletAmount.

You can fix this easily by indexing the object directly:

script.Parent.BankAmount.Text = BankValue
script.Parent.WalletAmount.Text = WalletValue
2 Likes

You can use the tostring() function, it converts anything into a string.

e.x,

local value = 5
local text = tostring(value)

print(text)

I changed my script to this,

image

And it worked. Both values are set to 0.

Thank you!