I’m replacing some code that used bindable events to coroutines and I’m coming across this error:
20:01:58.098 - false C stack overflow
This is the code that I’m using:
while true do
local t = coroutine.running()
print(t)
coroutine.wrap(function()
wait()
warn(coroutine.resume(t))
end)()
coroutine.yield()
end
This is the code that uses BindableEvent
s to achieve similar functionality without any error:
local bindable = Instance.new("BindableEvent")
while true do
coroutine.wrap(function()
wait()
bindable:Fire()
end)()
bindable.Event:Wait()
print("looped")
end
Would anyone mind explaining me why the first block of code causes that error?