I’m trying to add to a value in replicated storage from the server, then fire the client to update the gui with that value. The gui updates fine, it’s just that the number I want to add to is staying at 1, no matter what I do.
Here is the script:
repl = game.ReplicatedStorage
values = repl:WaitForChild("CrashValues")
prog = values.GameInProgress
amount = values.CrashAmount
rem = repl:WaitForChild("UpdateCrash")
rem2 = repl:WaitForChild("EndCrash")
function crashround(number)
number *= 10
math.floor(number)
number = number / 10
end
if prog.Value == false then
prog.Value = true
actualamount = math.random(10, 100)*.1
crashround(actualamount)
local value = true
print("Crash will stop at "..actualamount.."x")
wait(5)
rem:FireAllClients()
while value == true do
if amount.Value <= actualamount then
amount.Value += 0.1
print(amount.Value)
rem:FireAllClients()
wait(0.3)
elseif amount.Value >= actualamount then
print("Crashed!")
rem2:FireAllClients()
value = false
amount.Value = 1
wait(10)
end
end
end
In the output, it just keeps printing one. Any help is appreciated.