okay
so this has been bothering me for quite a while
ive been trying to figure out how to pause a thread,
task.spawn is able to resume/start threads
but what kind of function makes the thread pause
task.cancel completely mauls & murders the thread, so im not satisfied with that
local Thread = task.spawn(function()
for i = 1,10,1 do
warn(i)
task.wait(1.5)
end
end)
task.wait(2)
print("pausing thread")
task.cancel(Thread)
task.wait(2)
print("resuming thread")
task.spawn(Thread)
local suspend
local thread = task.spawn(function()
suspend = function()
coroutine.yield()
end
for i = 1,10,1 do
warn(i)
task.wait(1.5)
end
end)
print("pausing thread")
suspend()
task.wait(2)
print("resuming thread")
task.spawn(thread)