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

Repeat wait until not working?

Asked by 5 years ago

I've been working on this game for 1 week. And now I have a problem with repeat until. My code is like this:

while true do

wait(10)

***

workspace.Events.Start:Fire()

repeat wait() until game.Workspace.Events.END.Event

end

And it just ignored the loop. What happened!?

0
Is there another script using that event's Event property? DeceptiveCaster 3761 — 5y
0
use workspace.Events.END.Event:Wait() rather than the repeat loop if you want to stall the script until the event fires theking48989987 2147 — 5y
0
I could be wrong but I don't believe that code will wait for the signal to be fired (I'm guessing that's what you are trying to do), RBXScriptSignal's, or Events.END.Event in your case, have a function named Wait, it 'yields the current thread until the event is fired', which I think is what you're trying to do. Try and use game.Workspace.Events.End.Event:Wait() instead and check out this document pidgey 548 — 5y
0
Oh and I didn't see someone suggested the same thing, by bad https://developer.roblox.com/api-reference/datatype/RBXScriptSignal pidgey 548 — 5y
0
Use event.Fired:Wait() to wait for the event to fire. mc3334 649 — 5y

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
4 years ago

Because it's already exists.

Repeat loops until the condition is truthy. Your condition was truthy, so it "skipped" the loop.

Ad

Answer this question