Postado Dezembro 17, 2018 6 anos TFS 0.4 Galera, gostaria de saber se teria como criar um script que ao morrer pra monstros, o jogador não perca experience nem skills. Que só perdesse xp etc quando morresse para players... Atenciosamente :AdilsonHackerTe ajudei? click em Meus Trabalhos: Bronson Server - By Adilson Hacker
Postado Dezembro 20, 2018 6 anos Solução Fiz aqui, testa ai Em creaturescript/scripts crie um arquivo com o nome qualquer e coloque isto dentro: -- Script by Yan Liima(Night) function onDeath(cid, corpse, deathList) if not isPlayer(cid) then return true end local loot = false -- Se o jogador morrer ele irá perder o loot? local xp = false -- Se o jogador morrer ele irá perder EXP? local loss = getConfigValue('deathLostPercent') local killer = deathList[1] -- Não mexa aqui if isMonster(killer) then doCreatureSetDropLoot(cid, loot) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) if xp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 1) end end return TRUE end XML: <event type="death" name="ProtegerPlayer" event="script" value="nome_do_arquivo.lua"/> Login.lua: registerCreatureEvent(cid, "ProtegerPlayer") Cara o unico problema vai ser o PLAYERLOSS_EXPERIENCE, bem provavel que ele buga e faz o jogador voltar pro nv1. Muitos reclamam sobre isso. Se acontecer o mesmo, tente trocar para Blessing Editado Dezembro 20, 2018 6 anos por Yan Liima (veja o histórico de edições) ╔══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ══════════════════════════╗ Te Ajudei? Rep + e ficamos Quits Precisando de ajuda? Discord: Yan Liima #3702 Programador Júnior de LUA, PHP e JavaScript Juntos somos lendas, separados somos Mitos! ╚══════════════════════════ҳ̸Ҳ̸ҳஜ۩۞۩ஜҳ̸Ҳ̸ҳ═════════════════════════════╝
Postado Dezembro 21, 2018 6 anos Em 19/12/2018 em 22:11, Yan Liima disse: Fiz aqui, testa ai Em creaturescript/scripts crie um arquivo com o nome qualquer e coloque isto dentro: -- Script by Yan Liima(Night) function onDeath(cid, corpse, deathList) if not isPlayer(cid) then return true end local loot = false -- Se o jogador morrer ele irá perder o loot? local xp = false -- Se o jogador morrer ele irá perder EXP? local loss = getConfigValue('deathLostPercent') local killer = deathList[1] -- Não mexa aqui if isMonster(killer) then doCreatureSetDropLoot(cid, loot) doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) if xp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 1) end end return TRUE end XML: <event type="death" name="ProtegerPlayer" event="script" value="nome_do_arquivo.lua"/> Login.lua: registerCreatureEvent(cid, "ProtegerPlayer") Cara o unico problema vai ser o PLAYERLOSS_EXPERIENCE, bem provavel que ele buga e faz o jogador voltar pro nv1. Muitos reclamam sobre isso. Se acontecer o mesmo, tente trocar para Blessing Vllw deu certo
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.