Right now im making a better bindable event alterative
Right now im stumpted how to make a :Wait() function without using another signal
how would I make it independantly from RBXSignalEvents
Right now im making a better bindable event alterative
Right now im stumpted how to make a :Wait() function without using another signal
how would I make it independantly from RBXSignalEvents
This is one way to do this
local function waitforsignal(signal)
local thread = coroutine.running()
signal:Once(function(...)
coroutine.resume(thread, ...)
end)
return coroutine.yield()
end
Yeah @nonamehd24’s shows the underlying logic of it. You just yield the current thread, which will halt execution until something resumes the thread. I think the only thing I’d change would be to use task.spawn(thread, ...)
for the resuming of the thread, since coroutine.resume
runs in protected mode & will hide any errors.
AH running was what i was looking for