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

Updating a value in replicated storage?

Ok I am getting very irritated, I have tried so many different things. There is no error message but the value I have stored in ReplicatedStorage just seems to hate me. Here is the code:

local status = game.ReplicatedStorage:WaitForChild("Status")

local function intermission()
for i = 5, 1 do
	status.Value = "Intermission " .. i .. " seconds"
	wait(1)
end
end

while true do
     wait(1)
     intermission()
end

The code is pretty self explanatory it is supposed to count down for an intermission and update the status value in ReplicatedStorage. The value is not updating. Any help is much appreciated :)

2 comments

0

remove the while true loop and just put one "intermission()"

0

I'm pretty sure that you can call functions inside of while loops, the reason im doing this is because I have 100+ lines of functions that are all being called in a while loop. Most of which work. This function is just simply not updating the value

1 answer

For anybody still wondering, I tested a few things out with print statements. This was the issue. The for loop was written wrong. Instead of:

for i = 5,1 do

you should use:

for i = 5, 1, -1 do

^ Answer for anybody who might have the same issue. Sorry it was a silly mistake

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