local GameModule = require("GameModule")
local success, errormsg = pcall(GameModule.AssignTeams, Teams)
if not success then
print("An error occurred:", errormsg)
else
print("Function executed successfully")
end
I agree with @richiitalia, you should probably put checks in the actual module to see if it yields or not. However, it seems as if the “AssignTeams” function is important to the actual game. Instead, you should try your best to fix the function so that it will return something no matter the circumstance.