I am attempting to add 2 values, however though it wont work. No specific errors show up on the output that are related to the script, may someone help?
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
At the beginning of the game, the starterGui is duplicated into every player, just like the starterpack. By writing the code inside of a script will only change the player’s gui value, not the gui in ‘starterGui’