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

How to make an Indefinite wait until a button is pressed?

Asked by 7 years ago

I am trying to make a confirmation box (the typical box that contains some text, yes button and no button). I need to wait until the player press button yes or button no, so the code Indefinite wait until the player click a button.

Any help will be appreciated.

0
What have you tried? OldPalHappy 1477 — 7y
0
nothing, I mean, of course I can make a "repeat wait(1) until pressed", but I hope there a acctual code that do that LordSalchipapas 96 — 7y

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago

You can bind the wait() to an event instead of a :connect(), this will yield the thread until the event is fired like so:

Button.MouseButton1Click:wait()
Ad

Answer this question