Postado Novembro 4, 2017 7 anos Olá a todos, estou com um script de quando dropar certo item, surge um efeito no monstro, porém, se o monstro que morrer tiver um nome diferente do que foi catalogado no monsters.xml, ocorre um erro na distro do servidor. Ex: Coloquei o nome do monstro assim no monsters.xml <monster name="Rato1" file="monstros/Rato1.xml"/> E no script do monstro Super Rato. alguém pode me ajudar a solucionar? passei horas e horas tentando mas sem resultado. segue abaixo o script e o error do console @Dwarfer local rare_items = {2353, 5943, 2227, 2178, 2145, 5912, 4848, 8869, 9691, 8394, 8565, 6210, 7852, 2639, 7600, 7601, 7602, 6343, 7603, 7604, 7605, 7606, 6318, 7894, 5876, 5480, 2159, 7353, 2744, 2745, 2746, 5902, 7318, 7317, 5886, 5944, 9376, 7830, 5893, 7948, 7857, 7837} local effect = 165 local timer = 20 local function countdown(pos, timer) if timer < 0 then return true end doSendMagicEffect(pos, effect) addEvent(countdown, 400, pos, timer - 1) end local function scanContainer(uid, pos) for i = getContainerSize(uid) - 1, 0, -1 do local item = getContainerItem(uid, i) if isContainer(item.uid) then scanContainer(item.uid, pos) else if isInArray(rare_items, item.itemid) then doSendMagicEffect(pos, effect) addEvent(countdown, 600, pos, timer) end end end end local function scanCorpse(pos, corpseId) local corpse = getTileItemById(pos, corpseId) if not corpse then return end if not isContainer(corpse.uid) then return end scanContainer(corpse.uid, pos) end function onKill(cid, target, corpse, lastHit) local pos = getCreaturePosition(target) if not isMonster(target) then return end local corpseId = getMonsterInfo(getCreatureName(target)) if corpseId ~= false then addEvent(scanCorpse, 50, pos, corpseId.lookCorpse, getCreatureName(target), getCreaturePosition(target)) end return true end error: Citar [1:23:48.438] [Error - CreatureScript Interface] [1:23:48.440] data/creaturescripts/scripts/droploot.lua:onKill [1:23:48.441] Description: [1:23:48.442] (luaGetMonsterInfo) Monster not found ########## EDIT, RESOLVIDO, TIVE QUE MEXER NAS SOURCERS E COLOCAR UMA FUNCTION DISPLAYERROR, PARA DESATIVA-LA DO CONSOLE, PRA QUEM QUISER UTILIZAR O SCRIPT AI, PODE FICAR A VONTADE. Editado Novembro 4, 2017 7 anos por esnio12 JÁ RESOLVI (veja o histórico de edições)
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.