Nathan96 4 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 (editado) Tipo do script: creaturescripts Protocolo: 8.60 Servidor utilizado: tfs 0.3.6 Alguém sabe por que esta dando erro ? [08/08/2012 21:56:28] [Error - CreatureScript Interface] [08/08/2012 21:56:28] data/creaturescripts/scripts/vocationCorpse.lua:onDeath [08/08/2012 21:56:28] Description: [08/08/2012 21:56:28] (luaDoTransformItem) Item not found Aqui a script local config = { --[vocation id] = corpse id, [25] = 3080, [26] = 3080, [27] = 3080, [28] = 3080, [29] = 3080, [30] = 3080 } function onDeath(cid, corpse, deathList) local crp = config[getPlayerVocation(cid)] if crp and tonumber(crp) then doTransformItem(corpse, crp) end return true end Editado Agosto 9, 2012 por Nathan96 Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/ Compartilhar em outros sites More sharing options...
0 Newtonnotwen 80 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 (editado) Tenta fazer isso: Troca: local crp = config[getPlayerVocation(cid)] Por: local crp = 3080 Editado Agosto 9, 2012 por Newtonnotwen Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312938 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 [08/08/2012 22:04:24] [Error - CreatureScript Interface] [08/08/2012 22:04:25] data/creaturescripts/scripts/vocationCorpse.lua:onDeath [08/08/2012 22:04:25] Description: [08/08/2012 22:04:25] (luaDoTransformItem) Item not found Mesmo erro Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312943 Compartilhar em outros sites More sharing options...
0 Newtonnotwen 80 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 Editei lá em cima. Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312946 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 Mesma coisa ainda Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312949 Compartilhar em outros sites More sharing options...
0 Newtonnotwen 80 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 Testa o do meu ot: local config = { deathListEnabled = getBooleanFromString(getConfigInfo('deathListEnabled')), sqlType = getConfigInfo('sqlType'), maxDeathRecords = getConfigInfo('maxDeathRecords') } config.sqlType = config.sqlType == "sqlite" and DATABASE_ENGINE_SQLITE or DATABASE_ENGINE_MYSQL function onDeath(cid, corpse, lastHitKiller, mostDamageKiller) if(config.deathListEnabled ~= TRUE) then return end local hitKillerName = "field item" local damageKillerName = "" if(lastHitKiller ~= FALSE) then if(isPlayer(lastHitKiller) == TRUE) then hitKillerName = getPlayerGUID(lastHitKiller) else hitKillerName = getCreatureName(lastHitKiller) end if(mostDamageKiller ~= FALSE and mostDamageKiller ~= lastHitKiller and getCreatureName(mostDamageKiller) ~= getCreatureName(lastHitKiller)) then if(isPlayer(mostDamageKiller) == TRUE) then damageKillerName = getPlayerGUID(mostDamageKiller) else damageKillerName = getCreatureName(mostDamageKiller) end end end db.executeQuery("INSERT INTO `player_deaths` (`player_id`, `time`, `level`, `killed_by`, `altkilled_by`) VALUES (" .. getPlayerGUID(cid) .. ", " .. os.time() .. ", " .. getPlayerLevel(cid) .. ", " .. db.escapeString(hitKillerName) .. ", " .. db.escapeString(damageKillerName) .. ");") local rows = db.getResult("SELECT `player_id` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. ";") if(rows:getID() ~= -1) then local amount = rows:getRows(true) - config.maxDeathRecords if(amount > 0) then if(config.sqlType == DATABASE_ENGINE_SQLITE) then for i = 1, amount do db.executeQuery("DELETE FROM `player_deaths` WHERE `rowid` = (SELECT `rowid` FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT 1);") end else db.executeQuery("DELETE FROM `player_deaths` WHERE `player_id` = " .. getPlayerGUID(cid) .. " ORDER BY `time` LIMIT " .. amount .. ";") end end end end Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312957 Compartilhar em outros sites More sharing options...
0 LuckOake 400 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 Tenta adicionar essa linha no seu script abaixo de onDeath: local corpse = corpse Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312958 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 lol ? man na sua script onde que eu configuro a vocação ? i qual o corpse certo ??? você não postou script errado não ? Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312962 Compartilhar em outros sites More sharing options...
0 LuckOake 400 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 (editado) @Nathan96 Faz o que eu disse, tenta adicionar essa linha no seu script abaixo de onDeath: local corpse = corpse Editado Agosto 9, 2012 por LuckOake Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312963 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 pus assim local config = { --[vocation id] = corpse id, [25] = 3080, [26] = 3080, [27] = 3080, [28] = 3080, [29] = 3080, [30] = 3080 } function onDeath(cid, corpse, deathList) local corpse = corpse local crp = config[getPlayerVocation(cid)] if crp and tonumber(crp) then doTransformItem(corpse, crp) end return true end i deu a mesma coisa que tava dando antes. [08/08/2012 22:28:02] [Error - CreatureScript Interface] [08/08/2012 22:28:02] data/creaturescripts/scripts/vocationCorpse.lua:onDeath [08/08/2012 22:28:03] Description: [08/08/2012 22:28:03] (luaDoTransformItem) Item not found Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312964 Compartilhar em outros sites More sharing options...
0 LuckOake 400 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 (editado) Tenta assim: function onDeath(cid, corpse, killer) local voc = getPlayerVocation(cid) local corpse = corpse local voc_corpse = 3080 if voc == 25 then doTransformItem(corpse, voc_corpse) elseif voc == 26 then doTransformItem(corpse, voc_corpse) elseif voc == 27 then doTransformItem(corpse, voc_corpse) elseif voc == 28 then doTransformItem(corpse, voc_corpse) elseif voc == 29 then doTransformItem(corpse, voc_corpse) elseif voc == 30 then doTransformItem(corpse, voc_corpse) end return true end Vermelho: ID do corpo E sim, pra colocar mais vocations dá mais trabalho, mas esse foi o melhor modo que eu obtive. Editado Agosto 9, 2012 por LuckOake Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312966 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 Man quando eu tava ligando o server já deu esse erro [08/08/2012 22:34:57] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/vocationCorpse.lua:10: 'then' expected near '(' [08/08/2012 22:34:57] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/vocationCorpse.lua) [08/08/2012 22:34:57] data/creaturescripts/scripts/vocationCorpse.lua:10: 'then' expected near '(' Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312970 Compartilhar em outros sites More sharing options...
0 LuckOake 400 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 (editado) Opa, foi mal, esqueci de tirar um (cid). function onDeath(cid, corpse, killer) local voc = getPlayerVocation(cid) local corpse = corpse local voc_corpse = 3080 if voc == 25 then doTransformItem(corpse, voc_corpse) elseif voc == 26 then doTransformItem(corpse, voc_corpse) elseif voc == 27 then doTransformItem(corpse, voc_corpse) elseif voc == 28 then doTransformItem(corpse, voc_corpse) elseif voc == 29 then doTransformItem(corpse, voc_corpse) elseif voc == 30 then doTransformItem(corpse, voc_corpse) end return true end Editado Agosto 9, 2012 por LuckOake Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312973 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 (editado) [08/08/2012 22:38:29] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/vocationCorpse.lua:10: 'then' expected near '(' [08/08/2012 22:38:29] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/vocationCorpse.lua) [08/08/2012 22:38:29] data/creaturescripts/scripts/vocationCorpse.lua:10: 'then' expected near '(' (Edited) eu arrumei aki agora vo testa mais ainda ta tendo o erro [08/08/2012 22:42:09] [Error - CreatureScript Interface] [08/08/2012 22:42:09] data/creaturescripts/scripts/vocationCorpse.lua:onDeath [08/08/2012 22:42:09] Description: [08/08/2012 22:42:09] (luaDoTransformItem) Item not found Editado Agosto 9, 2012 por Nathan96 Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312975 Compartilhar em outros sites More sharing options...
0 LuckOake 400 Postado Agosto 9, 2012 Share Postado Agosto 9, 2012 Verifica de novo meu post, editei lá. Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312976 Compartilhar em outros sites More sharing options...
0 Nathan96 4 Postado Agosto 9, 2012 Autor Share Postado Agosto 9, 2012 Man eu sei que você só quer ajudar mais da uma testada primeiro porque ficar ligando i desligando o server ta ficando foda ;/ só de mapa 70 mb sá merda demora um ano pra carregar. Mesmo erro. [08/08/2012 22:47:07] [Error - CreatureScript Interface] [08/08/2012 22:47:07] data/creaturescripts/scripts/vocationCorpse.lua:onDeath [08/08/2012 22:47:07] Description: [08/08/2012 22:47:07] (luaDoTransformItem) Item not found Link para o comentário https://xtibia.com/forum/topic/191626-erro-vocationcorpse/#findComment-1312980 Compartilhar em outros sites More sharing options...
Pergunta
Nathan96 4
Tipo do script: creaturescripts
Protocolo: 8.60
Servidor utilizado: tfs 0.3.6
Alguém sabe por que esta dando erro ?
Aqui a script
Link para o comentário
https://xtibia.com/forum/topic/191626-erro-vocationcorpse/Compartilhar em outros sites
17 respostass a esta questão
Posts Recomendados