Number value and Bool value not changing

So i’m making a round based game and created a script that adds that mechanic but the script doesn’t change the inRound value and Time value, both values are located in replicatedstorage.

local inRound = game.ReplicatedStorage.InRound.Value
local TimeValue = game.Workspace.Time.Value

local intermissionLenght = 10
local roundLenght = 15

local function round()
	while true do
		inRound = false
		for i = intermissionLenght, 0, -1 do
			TimeValue = intermissionLenght
			wait(1)
		end
		inRound = true
		for i = roundLenght, 0, -1 do
			TimeValue = roundLenght
			wait(1)
		end
	end
end

task.spawn(round)

Any help is appreciated.

1 Like

Yo, just change your script to this and it should work:

local inRound = game.ReplicatedStorage.InRound
local TimeValue = game.Workspace.Time

local intermissionLenght = 10
local roundLenght = 15

local function round()
	while true do
		inRound.Value = false
		for i = intermissionLenght, 0, -1 do
			TimeValue.Value = i
			wait(1)
		end
		inRound.Value = true
		for i = roundLenght, 0, -1 do
			TimeValue.Value = i
			wait(1)
		end
	end
end

task.spawn(round)

because when you write for example:
local TimeValue = game.Workspace.Time.Value

it will only save a copy of it, so when you change it, it wont change because its only the copy varible, not the actual number value

1 Like

Almost …

local inRound = game.ReplicatedStorage.InRound

inRound.Value =

Just don’t add the .Value in the local … do that when you changing it.
Other than that you’re script looks fine.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.