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

What is the problem on my intermission script ? The Message (StringValue) Doesn't Change !

local message = game.Workspace.Message.Value
while wait() do
	local player = game.Players:GetChildren()
	if #player >= 2 then
		local sutart = 20
		for i = sutart,0,-1 do
			message = "[Intermission] ".. i .." Secconds Left."
		end
	else
		message = "Waiting for Players ..."
	end
end

Message doesnt changing pls help :))

2 answers

✓ Accepted answer

There is no wait() in the for loop so I'd imagine that it counts down faster than you are able to catch and a lot faster than you think.

Try adding a wait(1) in the for loop to simulate a 1 second change in between each message.

EDIT: I would also like to acknowledge xInfinityBear's answer as that is also correct. Setting a property to a variable stores a hard-copy rather than a reference. You will need to index the property whenever you want to change it.

local message = game.Workspace.Message
while wait() do
    local player = game.Players:GetChildren()
    if #player >= 2 then
        local sutart = 20
        for i = sutart,0,-1 do
            message.Value = "[Intermission] ".. i .." Secconds Left."
            wait(1)
        end
    else
        message = "Waiting for Players ..."
    end
end

1 comment

0

uh TYSM

Try removing the .Value from line 1 and add .Value at the end of 'message' on line 7 and 10 and see if it fixes it.

1 comment

0

OMG IT WORKED TYSM !!!!!!

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