I have a loop that spawns a new function each time it's ran, but I want to know if there's an easy way I can revoke that spawn() if it's not completed by the time the loop is ran again?
Example:
while wait(5) do print("yes") spawn(function() for i=1, 10 do wait(math.random(0,1)) print(i) end end) --The for i=1,10 has a 50% chance of completing itself before the while loop runs again, but I want to be able to cancel it so I don't have 2 spawn()s running over each other at once. end