iiau
(iiau)
October 18, 2018, 1:40am
#1
Been implementing this in my game;
Hey Developers,
Over the coming weeks, we are going to be making changes to the way coroutine.yield works. If you are using this method in your game you could be affected. Below are details on how to update your game to avoid being impacted by this change.
What is the change?
Currently, calling coroutine.yield will (in certain situations) cause the thread to yield for the default wait time, and then automatically be resumed. With this change, we will no longer automatically resume any threads …
Basically InvokeClient is called in the server, expecting a value returned, but the OnClientInvoke function uses coroutine.yield/resume, which totally breaks the return.
repro.rbxl (12.8 KB)
Scripts in StarterGui/Workspace
Should print “a” to the output, doesn’t
1 Like
woot3
(Woot)
October 18, 2018, 9:15am
#3
Another thread exists about this topic, there’s a simplified repro there.
I was able to reproduce this with the following code
local bindable = Instance.new("BindableFunction")
function bindable.OnInvoke()
print("Invoked")
local thread = coroutine.running()
spawn(function ()
print("Thread resuming")
coroutine.resume(thread, "Howdy")
end)
print("Thread yielding")
local result = coroutine.yield()
print("Thread resumed")
return result
end
local result
delay(1, function ()
print("Force print:", result)
end)
print("Invoke")
result = bindable:Invoke()
pri…