- Documentation
- Server functions
- getRandomPlayer
Function
getRandomPlayer
Returns a random player from the server.
Syntax
player getRandomPlayer()Returns
A player, or false when nobody is online.
Example
setTimer(function()
local lucky = getRandomPlayer()
if lucky then
givePlayerMoney(lucky, 1000)
outputChatBox(getPlayerName(lucky) .. " wygrał $1000 w loterii!")
end
end, 600000, 0)