Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't this value go down every second?

Asked by 6 years ago

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

Log in to vote
1
Answered by
Z_DC 104
6 years ago

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
Ad

Answer this question