From 50ef51a0bb71eeb40af5ed103173ff6610fe506e Mon Sep 17 00:00:00 2001 From: wclxb <155585777+wclxb@users.noreply.github.com> Date: Sat, 18 Jan 2025 04:24:45 -0500 Subject: [PATCH] Fix signal:Wait() method when :Fire() is called after :Wait() in a non-suspended coroutine. Fixes the error "cannot spawn non-suspended coroutine with arguments", as seen in https://www.youtube.com/watch?v=yevAvHU3ewo The coroutine's status is now checked before spawning it in :Wait(). --- modules/signal/init.luau | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/signal/init.luau b/modules/signal/init.luau index 54473fca..78037c2a 100644 --- a/modules/signal/init.luau +++ b/modules/signal/init.luau @@ -385,7 +385,10 @@ function Signal:Wait() self:Once(function(...) yieldedThreads[thread] = nil - task.spawn(thread, ...) + + if coroutine.status(thread) == "suspended" then + task.spawn(thread, ...) + end end) return coroutine.yield()