Postado Janeiro 2, 2020 5 anos Boa noite gente, eu possuo o script passado pelo KIlua para implementar em meu servidor. 8.60 de TFS 0.4. Porém, ele funciona tudo corretamente, consigo startar o evento no god, sorteia o bicho, o time porém não conta par ao jogador quando o mesmo mata o bixo sorteado.. Seja o bixo no servidor ou sumonado pelo GOD. Podem me ajudar? Instalação do script:Crie Monster Hunter.lua em data/creaturescripts/scripts e coloque: Citar -- Monster Hunter Event feito por Killua, XTibia.com function onKill(cid, target, lastHit) if isPlayer(cid) and isMonster(target) then if getCreatureMaster(target) ~= nil then return true end local name = getGlobalStorageValue(1919211) if string.lower(getCreatureName(target)) == string.lower(name) then doPlayerSetStorageValue(cid, 1814210, getPlayerStorageValue(cid, 1814210) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[Monster Hunter Event] Voce ja matou "..getPlayerStorageValue(cid, 1814210).." "..name.."s! Continue matando para ser o vencedor!") end end return true end function onLogin(cid) if getGlobalStorageValue(1919211) == 0 then doPlayerSetStorageValue(cid, 1814210, 0) end registerCreatureEvent(cid, "Monster Hunter") return true end Em data/creaturescripts/creaturescripts.xml adicione essas TAGs: Citar <event type="kill" name="Monster Hunter" event="script" value="Monster Hunter.lua"/> <event type="login" name="Monster Hunterl" event="script" value="Monster Hunter.lua"/> Em data/talkactions/scripts crie Monster Hunter.lua e coloque: Citar -- Monster Hunter Event feito por Killua, XTibia.com local monsters = {"Demon", "Rat", "Hydra", "Dragon Lord", "Ancient Scarab"} -- Monstros que podem ser sorteados local time_min, max = 10, 15 -- Em minutos local premios, gold = {{2160, 10}, {2157, 5}}, 10000 -- {id do item, quantidade} que o jogador ganha e quantia de gold function winMonsterEvent() local max_sto, winner = 0, 0 local monster = getGlobalStorageValue(1919211) for _, pid in pairs(getPlayersOnline()) do local sto = getPlayerStorageValue(pid, 1814210) if sto > max_sto then max_sto = sto winner = pid end end if isPlayer(winner) then local artigo = getPlayerSex(winner) == 0 and "A jogadora" or "O jogador" doBroadcastMessage(artigo.." "..getCreatureName(winner).." matou "..getPlayerStorageValue(winner, 1814210).." "..monster.."s e venceu o evento, parabens!") for _, prize in pairs(premios) do doPlayerAddItem(winner, prize[1], prize[2]) end doPlayerAddMoney(winner, gold) else doBroadcastMessage("[Monster Hunter Event] O evento terminou e nao houve nenhum vencedor.") end setGlobalStorageValue(1919211, 0) end function onSay(cid, words, param, channel) local random = math.random(1, #monsters) local time = math.random(time_min, max) for _, pid in pairs(getPlayersOnline()) do doPlayerSetStorageValue(pid, 1814210, 0) end setGlobalStorageValue(1919211, monsters[random]) doBroadcastMessage("[Monster Hunter Event] O evento comecou e vai durar "..time.." minuto. O monstro sorteado foi "..monsters[random].."! Quem matar mais deles ate o fim sera o vencedor!") addEvent(winMonsterEvent, time*1000*60) return true end Em data/talkactions/talkactions.xml coloque essa TAG: Citar <talkaction log="yes" access="5" words="/monsterhunter" event="script" value="Monster Hunter.lua"/> OBS: Já tentei trocar as storages, sem sucesso.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.