nicoelperro
New Member
- Joined
- May 3, 2024
- Messages
- 14
- Reaction score
- 3
Helloo, so, i have this lottery system script, it works perfectly.
The thing is that i'd like it to be a player only thing, the staff also gets the reward, i'd like to change that
i tried but i couldn't figure it out :/ If someone can help me with this i'd be very thankful
local config = {
lottery_hora = "30 Minutos", -- Es la siguiente ronda!! Suerte
reward_count = 50, -- How many crystal coins get winner?
website = 0 -- Do you have
}
function onThink(interval, lastExecution)
local players = getPlayersOnline()
local list = {}
for i, tid in ipairs(players) do
list = tid
end
local winner = list[math.random(1, #list)]
if(config.website == 1) then
db.executeQuery("INSERT INTO
end
doBroadcastMessage('[SISTEMA DE LOTERIA] Ganador: '.. getCreatureName(winner) ..', Recompensa: '.. config.reward_count ..'0k! - Felicitaciones! (siguiente Loteria en '.. config.lottery_hora ..')')
doPlayerAddItem(winner, 2152,config.reward_count)
return TRUE
end
The thing is that i'd like it to be a player only thing, the staff also gets the reward, i'd like to change that
i tried but i couldn't figure it out :/ If someone can help me with this i'd be very thankful

local config = {
lottery_hora = "30 Minutos", -- Es la siguiente ronda!! Suerte
reward_count = 50, -- How many crystal coins get winner?
website = 0 -- Do you have
lottery
table in your database? (1 = yes / 0 = no)}
function onThink(interval, lastExecution)
local players = getPlayersOnline()
local list = {}
for i, tid in ipairs(players) do
list = tid
end
local winner = list[math.random(1, #list)]
if(config.website == 1) then
db.executeQuery("INSERT INTO
lottery
(name
) VALUES ('".. getCreatureName(winner) .."');")end
doBroadcastMessage('[SISTEMA DE LOTERIA] Ganador: '.. getCreatureName(winner) ..', Recompensa: '.. config.reward_count ..'0k! - Felicitaciones! (siguiente Loteria en '.. config.lottery_hora ..')')
doPlayerAddItem(winner, 2152,config.reward_count)
return TRUE
end