Postado Novembro 29, 2016 9 anos Queria saber, se existe alguma function ou modo de saber, quando que o monstro morre, quero fazer uma hunt automática e para não superlotar a hunt de monstros, queria fazer o seguinte. Quando o monstro morrer, demorar x tempo para ele nascer de novo, mas se ele não morrer, continuar normal sem sumonar mais nenhum outro monstro. obs: tem jeito de fazer tbm, se não tiver nenhum player por perto, ele sumonar e quando tiver não sumonar?
Postado Novembro 29, 2016 9 anos Solução Acho que isso deve resolver, sei lá. local names = {'demon', 'dragon'} local function checkAround(monsterName, monsterPosition) local spectators = Game.getSpectators(monsterPosition, false, true, 7, 7, 5, 5) if #spectators ~= 0 then return false end Game.createMonster(monsterName, monsterPosition, true, false) return true end function onDeath(monster, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) local monsterName = monster:getName() -- Lets check if the name is in the array if not isInArray(names, monsterName:lower()) then return true end -- Lets check if the killer is a player if not killer or not killer:isPlayer() then return true end -- Now lets check if there is players around then summon addEvent(checkAround, 1 * 60 * 1000, monsterName, monster:getPosition()) return true end
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.