Alguem poderia me ajudar com esse script? Este é o Bounty Hunter... Ele esta dando um erro aqui no console e acredito que seja a função target: .... Alguem me ajuda?
function onKill(creature, target) if not target:isPlayer() then return true end ---- BOUNTY HUNTERS START ----- local result_plr = db.storeQuery("SELECT * FROM `bounty_hunters` WHERE `sp_id` = "..target:getGuid().." AND `killed` = 0;") if(result_plr ~= false) then prize = tonumber(result.getDataInt(result_plr, "prize")) bid = tonumber(result.getDataInt(result_plr, "id")) result.free(result_plr) else prize = 0 bid = 0 end
if (bid ~= 0 and prize ~= 0 and (not creature:getTile():hasFlag(TILESTATE_PVPZONE))) then db.query("UPDATE `bounty_hunters` SET `killed` = 1, `k_id`="..creature:getGuid()..", `kill_time` = " .. os.time() .. " WHERE `id` = "..bid..";") creature:setBankBalance(creature:getBankBalance() + prize) creature:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,'[bOUNTY HUNTERS] You killed hunted player, so you gained the reward!') Game.broadcastMessage("Bounty Hunter Update:\n " .. creature:getName() .. " has killed " .. target:getName() .. " and earned the prize of " .. prize .. " gps!", MESSAGE_EVENT_ADVANCE) end ---- BOUNTY HUNTERS END ----- return true end
Pergunta
surfnament 1
Galera
Alguem poderia me ajudar com esse script? Este é o Bounty Hunter... Ele esta dando um erro aqui no console e acredito que seja a função target: ....
Alguem me ajuda?
Uso TFS 1.0
Print do erro
https://uploaddeimagens.com.br/images/000/576/705/full/errobounty.png?1456784671
bh-kill.lua
Editado por PrototypeLink para o comentário
https://xtibia.com/forum/topic/239659-mudar-fun%C3%A7%C3%A3o-deste-evento-para-tfs-10/Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados