Postado Junho 15, 2018 7 anos E ae galera Blz? Alguém poderia me ajudar com a função do npc atacar monstros... Eu encontrei essas funções no NPC/Lib Spoiler -- Include the Advanced NPC System dofile(getDataDir() .. 'npc/lib/npcsystem/npcsystem.lua') function selfIdle() following = false attacking = false selfAttackCreature(0) target = 0 end function getNpcDistanceToCreature(id) if(not id or id == 0) then selfIdle() return nil end local c = getCreaturePosition(id) if(not c.x or c.x == 0) then return nil end local s = getCreaturePosition(getNpcId()) if(not s.x or s.x == 0 or s.z ~= c.z) then return nil end return math.max(math.abs(s.x - c.x), math.abs(s.y - c.y)) end Se alguém souber como configurar e se possível explicar ficaria grato! Editado Junho 15, 2018 7 anos por peterson18 (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.