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

Is there a way to yield the script other than wait()?

Asked by
Mr_Pure 129
5 years ago

i want something to update guis in real time, but while using a remoteevent. The problem i come across is remote events have a delay every time you use it. Wait() without second delays seems to be to slow to be considered real time so, I'm asking if there's anything faster than wait() but with a delay.

0
@MCAndRobloxUnited what do you mean by that? tick() is just a clocked time since 1970. even then how would i use it to delay the script? Mr_Pure 129 — 5y
0
wait i think i see what you're saying, use tick to delay the script for a little less than a frame, causing the script to yield for that second. Smart... Mr_Pure 129 — 5y
1
tick() is not for yielding the thread. Just stick with wait(). No need to reinvent the wheel. User#24403 69 — 5y
0
Have you tried using the `RenderStepped` (client only) event of `RunService`? It will fire every time a player's frame changes, or 1/60 of a second if a player's FPS is 60. https://developer.roblox.com/api-reference/event/RunService/RenderStepped TheeDeathCaster 2368 — 5y
View all comments (3 more)
0
@incapaxx the time it would take for the gui to update would be insanely slow while using wait() Mr_Pure 129 — 5y
0
@TheeDeathCaster I'm looking to yield a script just enough to the point where remoteevents can handle using Renderstepped or heartbeat would only cause errors. Mr_Pure 129 — 5y
0
Have you tried using the `:Wait` part of events where it'll yield the script until the event fires? `Event:Wait()` TheeDeathCaster 2368 — 5y

Answer this question