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

Repeat Wait until value isn't empty?

So I have a stringvalue, and I don't want the script to move on until that value isn't blank. the stringvalue is called winner. I have:

msg.Value = "Game in Progress" until winner ~= "" or " "

It's in a while true do loop.

1 answer

Syntax for repeat loops is like this:

repeat [code] until [conditions]

To use it to your advantage, you would do:

msg.Value = "Game in Progress"

repeat wait() until winner ~= "" and winner ~= " "

_______________________________________________________________________________

######remember: compound conditions with mutual values still require the value's reference for each condition. Moreover, until winner ~= "" or " " should be: until winner ~= "" and winner ~= " " _______________________________________________________________________________


You can also use the # operator, which returns the length of the given array or string.

Use this to determine if 'winner' isn't a blank string.

msg.Value = "Game in Progress"

repeat wait() until #winner > 0

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