Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't this value go down every second?

I have a money GUI where the text depends on the amount of the value, and I want the cash to lower by 5 every second but nothing happens.

local cash = game.StarterGui.Cash.Cash.cash

while true do
cash = cash - 5
wait(1) 
end

Thank you if you can help!

1 answer

✓ Accepted answer

You should try using cash.Value as cash is an instance which has the property Value.

local cash = game.StarterGui.Cash.Cash.cash

while true do
	cash.Value = cash.Value - 5
	wait(1) 
end

This discussion is preserved as it was. New answers, comments, and votes are closed.