Postado Setembro 8, 2022 2 anos Salve Tk! Procurei mais n Encontrei! Um npc que fica soltando msg em amarelo posicionando quem morreu no Servidor! Ex: o Player xxx acabou de morrer para o PLayerYY(LVL XXX) ou ate mesmo por Regiao (Pos Superior Esquerda e Pos Inferior Direita) (Quem morreu dentro dessa Arena o Npc iria Avisar! no Default! Agradeco quem poder ajudar! Editado Setembro 10, 2022 2 anos por Maniaco (veja o histórico de edições)
Postado Setembro 18, 2022 2 anos Solução Ideia interessante! Fiz uma adaptação no script do Death System 2016 do chaitosoft, para funcionar conforme o seu pedido. aviso: eu testei somente na versão TFS 0.4 caso a sua versão for superior, não tenho certeza se irá ou não funcionar. Segue abaixo o passo a passo de como configurar em seu servidor: Em data > npc, crie um arquivo NomeDoNPC.xml e adicione o código abaixo: <?xml version="1.0" encoding="UTF-8"?> <npc name="NomeDoNPC" script="data/npc/scripts/NomeDoNPC.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="268" head="76" body="38" legs="76" feet="95" addons="2"/> </npc> em seguida, na pasta data > npc > scripts, crie um arquivo NomeDoNPC.lua e adicione o código a seguir: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end npcHandler:addModule(FocusModule:new()) Logo após, vá em data > creaturescripts, abra o arquivo creaturescripts.xml e cole a tag: <!-- NPC Anuncia Morte --> <event type="death" name="npcDeath" event="script" value="npcDeath.lua"/> agora em data > creaturescripts > scripts, crie um arquivo chamado npcDeath.lua e cole o código de acordo com a sua preferência: Spoiler Anunciar quando alguém morrer em qualquer lugar do servidor: function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] local npc = getCreatureByName("NomeDoNPC") -- Nome do NPC que você criou local mensagem = "%s [Level: %s] foi mort%s pelo %s %s%s" if isNpc(npc) then doCreatureSay(npc, mensagem:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_SAY) end return true end Spoiler Anuncia somente quando alguém morrer em uma determinada área function onDeath(cid, corpse, deathList) if(not isPlayer(cid)) then return true end local target = deathList[1] local npc = getCreatureByName("NomeDoNPC") -- Nome do NPC que você criou local mensagem = "%s [Level: %s] foi mort%s pelo %s %s%s" config = { area = {{x = 32314, y = 31926, z = 7}, {x = 32322, y = 31932, z = 7}} -- Posição do canto SUPERIOR ESQUERDO, Posição do canto INFERIOR DIREITO. } if isNpc(npc) and isInRange(getPlayerPosition(cid), config.area[1], config.area[2]) then doCreatureSay(npc, mensagem:format(getCreatureName(cid), getPlayerLevel(cid), getPlayerSex(cid) == 1 and "o" or "a", isPlayer(target) and "player" or "monstro", getCreatureName(target), isPlayer(target) and " [Level: "..getPlayerLevel(target).."]." or "."), TALKTYPE_SAY) end return true end Por fim, vá até em data > creaturescripts > scripts, abra o arquivo login.lua e adicione esta linha antes do último return true registerCreatureEvent(cid, "npcDeath") e pronto! Editado Setembro 18, 2022 2 anos por Imperius (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.