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

How To Add To Value Of Int Value That's Divided? [EDITED]

So this script won't work and idk why. It prints everything, but it doesn't add to the IntValue. It's suppose to add 'number of chickens multiplied by(*) 0.25' to the 'money value' but it doesnt. What am I doing wrong??

Works! :D New Script:

while true do
	local waitTime = script.Parent.WaitTime.Value
	local money = script.Parent.Parent.Money
	local chickens = script.Parent.Parent.Chickens	
    print('1')
    wait(waitTime)
    print('2')
    money.Value = money.Value + (chickens.Value*0.25)
end

1 answer

✓ Accepted answer

Well, it seems to me like neither money nor chickens is ever updated in this script, which means it will remain the default value forever. Just move all of the variables into the loop and it should work fine. Just make sure to declare your variables before you use them.

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