Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Despayr 505 Moderation Voter
6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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
0
The script still attempts to change the value, but it will immediately revert to the previous number and continue the countdown Despayr 505 — 6y
0
It's either another part of the script or another script entirely that's reverting it. Meltdown81 309 — 6y
0
it would most likely be happening because of the countdown, thanks anyways. Despayr 505 — 6y
Ad

Answer this question