Now say I called function A. Then I called it again. I want the second call to return all previous instances of the function so that it only prints ‘1’ one time. How would I go about doing this?
An easier solution is to give each function call its own “ID” and if it is outdated, stop execution after the wait.
local i = 0
function A()
i += 1
local id = i
wait(10)
if id ~= i then --if function A got executed a second time, in which case "i" will have changed
return
end
print(1)
end