Basketball Outcome

API -

function yourEvent(winners, losers, mvp, winnerScores, loserScores)
    if losers == nil then
        log('the game was cancelled!');
        return;
    end
    if winners == nil then
        log('the game was drawn!');
        log('everyone is a losers... their stats and order will exist in parameters, as well as the highest scorer as mvp');
    end

    log('the winners are...');
    wait(1);

    local str = '';
    
    for i,user in pairs(winners) do
      str = str .. ' ' .. user.displayName .. '#=' .. winnerScores[i];
    end
    log(str); --prints all winners like:
    -- clonzeh#=10 someonelse#=2 yetanother#=5
    wait(1);
    log('and the mvp is: ' .. mvp);
end

return function()
    addEvent('basketballOutcome', 'yourEvent');
    keepAlive();
end

Events are asynchronous coroutines.

Last updated