Postado Janeiro 8, 2014 11 anos EDITADO: Como eu faço para que todos os players que atacarem certo boss ganhem a recompensa quando o boss morrer? Eu "fiz" esse script e só falta o console reconhecer o player: function onDeath(cid, corpse, deathList) deathList = tostring(Creature(cid):getDamageMap()) for i = 1, #deathList do if(isPlayer(deathList[i])) then broadcastMessage("" .. deathList .. "", MESSAGE_EVENT_ADVANCE) doPlayerAddItem(deathList[i], 2160, 1) end end return true end Porque quando eu tiro a parte ifIsPlayer acontece isso: Se alguém puder ajudar ... Editado Janeiro 9, 2014 11 anos por Bobypsaico (veja o histórico de edições)
Postado Janeiro 8, 2014 11 anos Tente isso : function onKill(cid, target) if(string.lower(getCreatureName(target)) == "Devil Stone") then setPlayerStorageValue(cid, 33000, 1) end return true end 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Janeiro 8, 2014 11 anos Autor Não funcionou também, só um player ganha o storage, o resto não
Postado Janeiro 8, 2014 11 anos Tente isso : local bossCreatures = { ["Devil Stone"] = {killStorage = 33000} } function onKill(cid, target, lastHit) local creature = bossCreatures[string.lower(getCreatureName(target))] if creature then if isPlayer(target) or isSummon(target) then return true end setPlayerStorageValue(cid, creature.killStorage, 1) end return true end 愛"A alma permanece em suas criações" 平(Não dou suporte por mensagem privada.)
Postado Janeiro 8, 2014 11 anos Autor Eu fiz assim pra saber se tava funcionando: local bossCreatures = { ["devil stone"] = {killStorage = 33000} } function onKill(cid, target, lastHit) local creature = bossCreatures[string.lower(getCreatureName(target))] if creature then if isPlayer(target) or isSummon(target) then return true end setPlayerStorageValue(cid, creature.killStorage, 1) doCreatureSay(cid, "Ganhou.", TALKTYPE_ORANGE_1) end return true end E só aparece a mensagem em laranja pra quem dá o último hit :S Tentei ver no playerdeath se tinha alguma coisa porque quando mata um player aparece que vários mataram, queria que reconhecesse da mesma maneira, se o player ganhar a xp do bixo ele ganha storage
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.