Use proc_kill or a return task (if(...) return;)