Variables:
local MPM = script.Parent.MPMValue -- number value local CM = script.Parent.CMValue -- number value local CMText = script.Parent.CurrentMoney
Code:
while wait(5) do CM.Value = (CM.Value + MPM.Value) end
There are not problems on your script. You just cannot see the value property change directly on the Value instance. To get the new value, use the output. Once you have number values and you need a string one to call print
, you should call tostring
function over print
.
local MPM = script.Parent.MPMValue -- number value local CM = script.Parent.CMValue -- number value print(tostring(CM.Value)) -- prints the initial value while wait(5) do CM.Value = (CM.Value + MPM.Value) print(tostring(CM.Value)) -- prints the new value end
Now see...