Hello! I've been experiencing this error with NumberValues and IntValues, I was wondering if anyone can help I guess.
local BuyAndSellAmount = script.Parent local number = math.random(1,6) while true do wait(5) if number == 1 then local numb = 1 print("+1") BuyAndSellAmount = BuyAndSellAmount + numb elseif number == 2 then local numb = 0.1 print("+0.1") BuyAndSellAmount = BuyAndSellAmount + numb elseif number == 3 then local numb = 2 print("+2") BuyAndSellAmount = BuyAndSellAmount + numb elseif number == 4 then local numb = 1 print("-1") BuyAndSellAmount = BuyAndSellAmount - numb elseif number == 5 then local numb = 0.1 print("-0.1") BuyAndSellAmount = BuyAndSellAmount - numb elseif number == 6 then local numb = 2 print("-2") BuyAndSellAmount = BuyAndSellAmount - numb end
Also note that im currenently trying to add/subtract 2 numbers every few seconds.
This is because numb is a number while Buy and sell amount is not a number and is an instance. You should use .Value to get the value of the instance. for example
BuyAndSellAmount.Value = BuyAndSellAmount.Value - numb