i want what god and staff not gain lottery too... only players for win lotterry
local rewards = {
{9002, 1},
{9004, 1},
{9693, 1},
{2160, 100},
}
function onTime(interval)
local players = Game.getPlayers()
if #players > 0 and #rewards > 0 then
local uid, n = math.random(1, #players), math.random(1, #rewards)
local ganhador = players[uid]
local reward, count = rewards[n][1], rewards[n][2]
if ganhador and reward and count then
ganhador:addItem(reward, count)
Game.broadcastMessage('O player '.. ganhador:getName()..' recebeu '.. count .. ' '..ItemType(reward):getName()..' na loteria.', MESSAGE_STATUS_WARNING)
end
end
return true
end
local rewards = {
{9002, 1},
{9004, 1},
{9693, 1},
{2160, 100},
}
function onTime(interval)
local players = Game.getPlayers()
if #players > 0 and #rewards > 0 then
local uid, n = math.random(1, #players), math.random(1, #rewards)
local ganhador = players[uid]
local reward, count = rewards[n][1], rewards[n][2]
if ganhador and reward and count then
ganhador:addItem(reward, count)
Game.broadcastMessage('O player '.. ganhador:getName()..' recebeu '.. count .. ' '..ItemType(reward):getName()..' na loteria.', MESSAGE_STATUS_WARNING)
end
end
return true
end