Mensaje: #1
[NPC] Cambio de Residencia
Este NPC lo que hace es cambiar la spawn del temple de un player.
Para que funcione:
Meten esto en data/npc/ y creen un NPC, el mio se llama Ripo(.xml) :p
Código:
Lo guardan.
Ahora en data/npc/scripts/ crean residencia.lua y meten esto:
Código:
if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hola ' .. creatureGetName(cid) .. '! Te gustaria cambiar de ciudad de Residencia a RipoLand?')
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hia(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Espera, en seguida te atiendo...!')
end
if msgcontains(msg, 'si') and focus == cid then
selfSay('Ya eres habitante de RipoLand.')
setPlayerMasterPos(cid,372,68,7)
talk_start = os.clock()
end
if string.find(msg, '(%a*)adios(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Adios, vuelve cuando quieras ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
Bueno, editan lo que quieran, el nombre de la ciudad... el npc... pero lo mas importante:
Código:
setPlayerMasterPos(cid,372,68,7)