Postado Maio 4, 2015 10 anos Olá, gostaria de pedir um script de "death channel", no caso, ele funcionaria da seguinte maneira, ao player morrer, aparecesse a morte anunciada nesse channel, eu já configurei tudo, criei o channel e tal, porém não está funcionando. SCRIPT: function onDeath(cid, corpse, deathList) local strings = {""} local t, position = 1, 1 local deathType = "killed" local toSlain, toCrushed, toEliminated = 3, 9, 15 if #deathList >= toSlain and #deathList < toCrushed then deathType = "slain" elseif #deathList >= toCrushed and #deathList < toEliminated then deathType = "crushed" elseif #deathList >= toEliminated then deathType = "eliminated" end for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" t = t + 1 else strings[position] = t == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" t = t + 1 end end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end msg = getCreatureName(cid) .. " was " .. deathType .. " at level " .. getPlayerLevel(cid) .. " by " .. str end for _, oid in ipairs(getPlayersOnline()) do doPlayerSendChannelMessage(oid, "Death channel", msg, TALKTYPE_CHANNEL_O, CHANNEL_DEATH) end return true end TFS 0.4.
Postado Maio 4, 2015 10 anos Solução erro? registrou no login.lua? registerCreatureEvent(cid, "nome do event") data/XML/channels.xml colocou <channel id="10" active="no" name="Death Channel"/> data/lib/constant.lua colocou CHANNEL_DEATH = 10
Postado Maio 4, 2015 10 anos Autor erro? registrou no login.lua? registerCreatureEvent(cid, "nome do event") data/XML/channels.xml colocou <channel id="10" active="no" name="Death Channel"/> data/lib/constant.lua colocou CHANNEL_DEATH = 10 Havia esquecido de adicionar na lib, muito obrigado mesmo! Dúvida sanada.
Postado Maio 6, 2016 9 anos 9 horas atrás, kauereis disse: a escript principal coloca onde? creaturescripts, com a tag death.
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.