Pular para o conteúdo

getRandomPlayer

Servidor Jogadores OOP Player.getRandom()

Sorteia um dos jogadores conectados.

player getRandomPlayer ( )

Um jogador, escolhido com a mesma chance entre todos os conectados. Devolve false quando o servidor está vazio.

local sorteado = getRandomPlayer()
if sorteado then
outputDebugString(getPlayerName(sorteado) .. " ganhou o sorteio")
end