Tenta fazer isso:
Troca:
local crp = config[getPlayerVocation(cid)]
Por:
local crp = 3080
info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80

Tenta fazer isso:
Troca:
local crp = config[getPlayerVocation(cid)]
Por:
local crp = 3080
Editado Agosto 8 por Newtonnotwen
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo

[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 ![]()
info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80

Editei lá em cima.
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo

Mesma coisa ainda
info
Grupo: Conde
Registrado: 04/08/12
Posts: 762
Reputação: +80

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
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

Tenta adicionar essa linha no seu script abaixo de onDeath:
local corpse = corpse
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo

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 ?
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

@Nathan96
Faz o que eu disse, tenta adicionar essa linha no seu script abaixo de onDeath:
local corpse = corpse
Editado Agosto 8 por LuckOake
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo

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
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

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 8 por LuckOake
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo

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 '('
info
Grupo: Marquês
Registrado: 22/07/12
Posts: 1.1k
Reputação: +400
Gênero: Masculino
Char no Tibia: Luck Oake

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 8 por LuckOake
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo

[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 8 por Nathan96
info
Grupo: Artesão
Registrado: 25/03/12
Posts: 109
Reputação: +4
Char no Tibia: Kimera DebochadoOo
Tipo do script: creaturescripts
Protocolo: 8.60
Servidor utilizado: tfs 0.3.6
Alguém sabe por que esta dando erro ?
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 endEditado Agosto 8 por Nathan96