How do I know whether a task has been cancelled yet or not? Let’s say I have a variable assigned to task.spawn() and I want to know whether that task is running currently, has completed, or been cancelled. What can I use to figure this out? I know it’s possible with coroutines.
local TestFunction = function()
print("Called!")
end
local Thread = task.spawn(TestFunction)
print("Cancelling..")
if Thread then --//What can I do to get the current status of "thread"? Whether task.cancel() has been called or not.
task.cancel(Thread)
print("Cancelled.")
end