data/globalevents/scripts/lottery.lua:21: unfinished string near '")'
eu uso esse system:
-- By Allebr
local config = {
lottery_hour = "20 Minutos", -- Time to next lottery (only for broadcast message, real time you can set on globalevents.xml)
rewards_id = {9693}, -- Rewards ID
crystal_counts = 50, -- Used only if on rewards_id is crystal coin (ID: 2160).
website = "no" -- Only if you have php scripts and table `lottery` in your database!
}
function onThink(interval, lastExecution)
local list = {}
for i, tid in ipairs(getPlayersOnline()) do
list[i] = tid
end
local winner = list[math.random(1, #list)]
local random_item = config.rewards_id[math.random(1, #config.rewards_id)]
if(random_item == 9693) then
doPlayerAddItem(winner, random_item, config.crystal_counts)
doBroadcastMessage("[Lottery System] Vencedor: " .. getCreatureName(winner) .. ", Ganhou: " .. config.crystal_counts .. " " .. getItemNameById(random_item) .. "s! Congratulations! (Proxima Loterry em: " .. config.lottery_hour .. "")
else
doBroadcastMessage("[Lottery System] Vencedor: " .. getCreatureName(winner) .. ", Ganhou: " .. getItemNameById(random_item) .. "! Congratulations! (Proxima Loterry em: " .. config.lottery_hour .. ")
doPlayerAddItem(winner, random_item, 1)
end
if(config.website == "yes") then
db.executeQuery("INSERT INTO `lottery` (`name`, `item`) VALUES ('".. getCreatureName(winner) .."', '".. getItemNameById(random_item) .."');")
end
return true
end
Pergunta
JumentoCuzaum 10
ta dando esse erro quando rodo meu ot ai a loterry num pega :S alguem sabe o que é?
[Error - LuaScriptInterface::loadFile] data/globalevents/scripts/lottery.lua:21: unfinished string near '")'
[Warning - Event::loadScript] Cannot load script (data/globalevents/scripts/lottery.lua)
data/globalevents/scripts/lottery.lua:21: unfinished string near '")'
eu uso esse system:
Link para o comentário
https://xtibia.com/forum/topic/185940-globalevents-loterry-erro/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados