Repeat Until Help

I am trying to make a repeat until statement that repeats until another RemoteEvent is fired. Is there a way I can tell it to repeat something until another RemoteEvent is fired? I am doing this in a local script if that changes the response. Any help is appreciated.

Note: I have tried to solve this by looking it up on Forum.

just break the loop when the remote is received

What do I say to make it do that?

repeat
    child.Visible = false
until game.ReplicatedStorage.Interactions.Client.ShowPlayerOnList:Wait()

Would this work?

False. repeat until statement does not support break statement.

For @OP, you could do something like this:

local fired = false
RemoteEvent.OnClientEvent:Connect(function()
    fired = true
end)

repeat
    — do your repeat thing
until fired == true

This is called polling, which is bad for codes.

You don’t need to continuously make it invisible since it already is invisible.
Unless something is changing it back.

When a new player joins, the list refreshes causing me to become visible. This is why I want it to do this until I do the command to make myself visible again which is another remote event.

repeat until is a loop that functions similar to a while loop, therefore it should support break. I just wrote a 3 second code block to test, break does work in a repeat until loop.

Please do not call out solutions as false if you can’t even take a few seconds to test your claims

2 Likes

I had to switch to a while statement and insert a wait because otherwise, the game would break.