getRandomPlayer | Multi Theft Auto: Wiki Skip to content

getRandomPlayer

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function returns a random player.

OOP Syntax Help! I don't understand this!

Syntax

player getRandomPlayer ( )

Returns

  • player: value

Returns a random player , false if the server is empty.

Code Examples

shared

This code outputs a random player's name.

local randomPlayer = getRandomPlayer ( )
outputChatBox ( getPlayerName ( randomPlayer ).." is now the fugitive!" )

See Also