Fla gente! ta tudo maisoumenos? :smile_positivo:
Bem...vamos ao oq interessa...o NPC Teleporter
Vai ate\data\npc
copie um qualqer e cole...
abra o copiado...delete tudo que tem dentro, renomeie para Teleporter e cole isso:
<?xml version="1.0"?>
<npc name="Teleporter" script="data/npc/scripts/Teleporter.lua" access="3" lookdir="1" autowalk="200" speed="50">
<health now="1" max="1"/>
<look type="128" head="86" body="99" legs="22" feet="91" addon="1" know="1"/>
</npc>
Pronto!
Agora dentro de scripts novamente copie e cole qualquer 1 e renomeie para Teleporter...apague tudo que tem dentro e poe:
-- NPC Teleporter-- By Léo
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Tchau.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) < 4 then
selfSay('Olá ' .. creatureGetName(cid) .. '! Eu posso te levar até o NPC de "premium", o de "runas", o de "flexas", o "comprador" ou os "outros".')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and focus ~= cid and getDistanceToCreature(cid) < 4 then
selfSay('Calma ai, ' .. creatureGetName(cid) .. '! Jaja falo com você.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'runas') then
selfSay('Então vamos!')
travel(cid, x, y, z)
focus = 0
talk_start = 0
elseif msgcontains(msg, 'premium') then
selfSay('Então vamos!')
travel(cid, x, y, z)
focus = 0
talk_start = 0
elseif msgcontains(msg, 'outros') then
selfSay('então vamos!')
travel(cid, x, y, z )
focus = 0
talk_start = 0
elseif msgcontains(msg, 'flechas') then
selfSay('então vamos!')
travel(cid, x, y, z)
focus = 0
talk_start = 0
elseif msgcontains(msg, 'comprador') then --caso queira continuar somente copie e cole esse ultimo comando
selfSay('então vamos!')
travel(cid, x, y, z)
focus = 0
talk_start = 0
elseif string.find(msg, '(%a*)bye(%a*)') and getDistanceToCreature(cid) < 4 then
selfSay('Tchau, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Proximo...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Tchau.')
focus = 0
end
end
end
Pronto! seu NPC Teleporter está pronto!
NPC by Léo
VLw! espero ter ajudado!
Sou:
50%--mapper
trabalhos:
_______________________________________