Abra a pasta do OT, dps data, dps NPC dps scripts, copie algum arquivo daqueles e cole, com qualquer nome, bote Editar, vou monstrar o seller editado
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
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)
msg = string.lower(msg)
selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (30gp), light (1k), backpacks (10gp), color backpack (20 a 30 gp), lifefluids (100gp) and fishing rods (150gp) . I buy vials (5gp).')
if msgcontains(msg, 'rope') then
buy(cid,2120,1,50)
elseif msgcontains(msg, 'shovel') then
buy(cid,2554,1,30)
elseif msgcontains(msg, 'light') then
buy(cid,2162,1,1000)
elseif msgcontains(msg, 'backpack') then
selfSay('qual cor voce deseja?')
elseif msgcontains(msg, 'blue') then
buy(cid,2002,1,20)
elseif msgcontains(msg, 'yellow') then
buy(cid,1999,1,20)
elseif msgcontains(msg, 'red') then
buy(cid,2000,1,20)
elseif msgcontains(msg, 'green') then
buy(cid,1998,1,20)
elseif msgcontains(msg, 'black') then
buy(cid,2003,1,20)
elseif msgcontains(msg, 'purple') then
buy(cid,2001,1,20)
elseif msgcontains(msg, 'golden') then
buy(cid,2004,1,30)
elseif msgcontains(msg, 'lifefluid') or msgcontains(msg, 'life fluid') then
buy(cid,2006,10,100)
elseif msgcontains(msg, 'fishing rod') then
buy(cid,2580,1,150)
elseif msgcontains(msg, 'vial') or msgcontains(msg, 'flask') then
sell(cid,2006,1,5)
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. 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('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
Onde ta Vermelho, e Oq ele vai fala quandu alguem fala "HI"
Onde ta Azul eh Oq ele vai vende, o primeiro tem "if", nao modifiquem, pq o primeiro item q ele vende tem q ficar asim, como ta, qualquer NPC
um ex como ta: if msgcontains(msg, 'rope') then
buy(cid,2120,1,50)
Agora um Ex do vc vai ter q fase pra bota ele pra vende, o item, preço, e etc:
elseif msgcontains(msg, 'yellow backpack') then
buy(cid,1999,1,20)
Oq ta em Azul, eh oq o cara vai ter q fala pra ele compra esse item
Oq ta em Vermelho, eh se o cara vai compra ou vende o Item
Ex: se o NPC for vende item botem Buy, se o NPC vai compra item botem Sell
Oq ta em Amarelo, eh o ID do item
Oq ta em Laranja eh a Qunatidade do Item, Ex: 10 spears
Oq ta em Marron: eh o preso do item, e o resto nao modifiquem no NPC
Dps salve esse arquivo e feche, e volte ate a pagina NPC, copie um NPC e bote qualquer nome, e abra, vai tar escrito asim
<?xml version="1.0"?>
<npc name="Andre" script="data/npc/scripts/seller 2.lua" access="3">
<look type="128" head="20" body="100" legs="50" feet="99"/>
</npc>
Oq ta en Azul, e o nome dele, procure bota omesmo nome desse arquivo q vc abriu
Oq ta em Vermelho Troque para o nome q vc boto no Script, o resto, nun mecha, o NPC esta pronto.
Outro Tutorial de como potar NPC no lugar ,fis issu pq o cara tinha feito o Tuto dele e ele se sente prejudicado pq eu completei o meu com esse Tuto, quem quise olha o dele so clika ali no começo, mas eu nao posso Tira o meu pq no nome do Tutorial eu botei Como Cria Npc e Por no Lugar, vcs q escolhe o dele ta ali e quem quise olha o meu olha aki, descupa pelo transtorno
Agora temos q cria uma loja pra ele (opisional) e coloca ele no lugar,
Se vc quise cria uma loja pra ele abra o mapeditor e crie, pege as cordenadas e abra a pasta World, e abra o arquivo NPC
Vai tar mais ou menos asim
o meu ta umpoco diferente pq ja tem muitos NPCs prontos,
copie uma linha, tipo essa
<npc name="Seller" x="145" y="50" z="7" dir="3"/>
e modifique
oq ta em vermelho e o nome do NPC, bote o nome q vc tinha botado antes, e bote as cordenadas do NPC,dps de pronto fica assim
oq ta em azul e a direção q ele vai estar olhandu
0 = Cima
1 = Direita
2 = Baxo
3 = Esquerda
So modifike o numero, mais nada da direção
<npc name="Andre" x="96" y="219" z="7" dir="2"/>
Se vc quise baxa esse NPC q eu fis, e so clika aki (ele eh uma evolusao do seller^^, vcs poden troca, ele pelo seller se vcs quiserem
e coloque o andre na pasta npc, e o Seller 2 na pasta Script, nao precisa modifica nada pra eles, mas eles sao pra Neverland 4.0 (7.6)
so precisa bota eles no arquivo NPC, o lugar dele