Not sure if this is possible with how it’s currently implemented on ROBLOX’s end, but it would be nice to have this. Pretty much, if a signal isn’t called after the Timeout, it should just continue the function and maybe return “false” or “Enum.ScriptSignal.Failed” (Doesn’t really matter)
I’m aware you can just implement it like this:
local waitTimeout do
local resume = coroutine.resume
local create = coroutine.create
local wait = wait
local unpack = unpack
function waitTimeout(event, timeout)
local flag
resume(create(function()
flag = {event:Wait()}
end))
-- wait for flag to be set to true or fire bindable
local time = 0
while not flag and time < timeout do
time = time + wait()
end
return unpack(flag)
end
end
or return your own bindable timeout
But I trust ROBLOX with a more efficient implementation (if RBXScriptSignals for :wait() were the same as while not flag do wait() end
then someone should make a PSA for it )