Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Possible to change countdown value? Keeps reverting to original value.

So when the game time counts down, when I try to change the value, it immediately reverts back to what it was, further continuing the countdown.

local GameTime = game.ReplicatedStorage.GameRequirements.GameTime

for v = 60, 0, -1 do
		wait(1)
		GameTime.Value = v
		print(v)
wait(5)
game.ReplicatedStorage.GameRequirements.GameTime.Value = game.ReplicatedStorage.GameRequirements.GameTime.Value -game.ReplicatedStorage.GameRequirements.GameTime.Value

So I am trying to make it so that after 5 seconds, the game time will subtract its current value, ending with a value of 0. Say it was at 45 and the script would change the value to 0, it would revert back from 0 to 45. Any reason why this happens? Thanks for the help.

1 answer

✓ Accepted answer

I see you either have some experience with python or it's just a mistake.

local gameTime = game.ReplicatedStorage.GameRequirements.GameTime

for i=60,0,-1 do
	wait(1)
	gameTime.Value = i
	print(i)
end
wait(5)
gameTime.Value = 0

3 comments

0

The script still attempts to change the value, but it will immediately revert to the previous number and continue the countdown

0

It's either another part of the script or another script entirely that's reverting it.

0

it would most likely be happening because of the countdown, thanks anyways.

This discussion is preserved as it was. New answers, comments, and votes are closed.