So, basically I was trying to make a script that changes a value randomly every few seconds. However though, it doesn't really work.
The value doesn't change, however it prints something on the output acting like the value has changed.
The script:
local BuyAndSellAmount = script.Parent
local number = script.RandomizeValue
while true do
number.Value = math.random(1,6)
wait(5)
if number.Value == 1 then
print("+1")
BuyAndSellAmount.Value = BuyAndSellAmount.Value + 1
elseif number.Value == 2 then
print("+0.1")
BuyAndSellAmount.Value = BuyAndSellAmount.Value + 0.1
elseif number.Value == 3 then
print("+2")
BuyAndSellAmount.Value = BuyAndSellAmount.Value + 2
elseif number.Value == 4 then
print("-1")
BuyAndSellAmount.Value = BuyAndSellAmount.Value - 1
elseif number.Value == 5 then
print("-0.1")
BuyAndSellAmount.Value = BuyAndSellAmount.Value - 0.1
elseif number.Value == 6 then
print("-2")
BuyAndSellAmount.Value = BuyAndSellAmount.Value - 2
end
end
