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)
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