Parusoid Posted October 6, 2017 Share Posted October 6, 2017 How can I interrupt DoTaskInTime before it reaches the end and proceeds further into code? Link to comment Share on other sites More sharing options...
Arkathorn Posted October 6, 2017 Share Posted October 6, 2017 If I recall correctly, the original call of DoTaskInTime returns a task handler. You should be able to interrupt the task like so: local task = inst:DoTaskInTime(3, fn_dothing) task:Kill() (This info might be completely wrong, I'm not sure.) Link to comment Share on other sites More sharing options...
Parusoid Posted October 6, 2017 Author Share Posted October 6, 2017 3 hours ago, Arkathorn said: If I recall correctly, the original call of DoTaskInTime returns a task handler. You should be able to interrupt the task like so: local task = inst:DoTaskInTime(3, fn_dothing) task:Kill() (This info might be completely wrong, I'm not sure.) Can it be done from another function? Link to comment Share on other sites More sharing options...
w00tyd00d Posted October 7, 2017 Share Posted October 7, 2017 6 hours ago, Arkathorn said: If I recall correctly, the original call of DoTaskInTime returns a task handler. You should be able to interrupt the task like so: local task = inst:DoTaskInTime(3, fn_dothing) task:Kill() (This info might be completely wrong, I'm not sure.) You were close, but the function is actually "task:Cancel()" 2 hours ago, Parusoid said: Can it be done from another function? And yes you can, all you need to do is reference the instance its attached to. A common method I've seen in the files goes like: if inst.task ~= nil then inst.task:Cancel() inst.task = nil end Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.