The return team is done directly, it doesn’t wait until the code in the function(result) is done executing

so either use MySQL.Sync or let your getPlayerTeam() function have an callback which you then call and put the team code inside