GetRandomPlayer: Difference between revisions
Jump to navigation
Jump to search
m (→Example) |
(→Syntax: OOP syntax added) |
||
Line 7: | Line 7: | ||
player getRandomPlayer ( ) | player getRandomPlayer ( ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||Player.getRandom|random|}} | |||
===Returns=== | ===Returns=== | ||
Returns a random [[player]], ''false'' if the server is empty. | Returns a random [[player]], ''false'' if the server is empty. |
Revision as of 03:15, 15 July 2014
This function returns a random player.
Syntax
player getRandomPlayer ( )
OOP Syntax Help! I don't understand this!
- Method: Player.getRandom(...)
- Variable: .random
Returns
Returns a random player, false if the server is empty.
Example
This code outputs a random player's name.
local randomPlayer = getRandomPlayer ( ) outputChatBox ( getPlayerName ( randomPlayer ).." is now the fugitive!" )
See Also
- getPlayerTeam
- getPlayerBlurLevel
- setPlayerBlurLevel
- getPlayerSerial
- forcePlayerMap
- getPlayerScriptDebugLevel
- getPlayerFromName
- getPlayerMoney
- getPlayerName
- getPlayerNametagColor
- getPlayerNametagText
- getPlayerPing
- getPlayerWantedLevel
- givePlayerMoney
- isPlayerMapForced
- isPlayerNametagShowing
- setPlayerHudComponentVisible
- setPlayerMoney
- setPlayerNametagColor
- setPlayerNametagShowing
- setPlayerNametagText
- takePlayerMoney
- countPlayersInTeam
- getPlayersInTeam
- isVoiceEnabled
- setControlState
- getControlState