vo bota aqui como cria pq naum sei mexe com o baguio pa baxa arquivos =/ mais ta ai
1º crie um arquivo com o nome Pepe.xml na pasta npc (data/npc) e coloque os seguintes texto
<?xml version="1.0"?><npc name="Pepe" script="data/npc/scripts/coin.lua" access="3">
<look type="134" head="77" body="114" legs="114" feet="114"/>
</npc>
2º agora crie 1 arquivo com o nome coin.lua na pasta script (data/npc/srcipt) e coloque o seguinte texto
focus = 0talk_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)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I charge gold, platinum and crystal coin.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.') elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'platinum') then
sell(cid,2973,1,100)
elseif msgcontains(msg, '10 platinum') then
sell(cid,2973,10,1000)
elseif msgcontains(msg, '5 platinum') then
sell(cid,2973,5,500)
elseif msgcontains(msg, 'crystal') then
sell(cid,2989,1,10000)
elseif msgcontains(msg, '5 crystal') then
sell(cid,2989,5,50000)
elseif msgcontains(msg, '10 crystal') then
sell(cid,2989,10,100000)
elseif msgcontains(msg, '2 platinum') then
sell(cid,2973,2,200)
elseif msgcontains(msg, '3 platinum') then
sell(cid,2973,3,300)
elseif msgcontains(msg, '4 platinum') and focus == cid then
sell(cid,2973,4,400)
elseif msgcontains(msg, '10 gold') or msgcontains(msg, 'boots of haste') and focus == cid then
sell(cid,2969,10,10)
elseif msgcontains(msg, 'platinum') then
selfSay('I trade 1, 2, 3, 4, 5 and 10 platinum coin.')
elseif msgcontains(msg, '50 gold') or msgcontains(msg, 'mpa') then
sell(cid,2969,50,50)
elseif msgcontains(msg, 'crystal') then
selfSay('I charge 1, 5 and 10 crystal coin.')
elseif msgcontains(msg, 'gold') then
selfSay('I charge 10 and 50 gold coin.')
elseif string.find(msg, '(%a*)bye(%a*)') 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
pronto npc criado ;D
creditos by me
cometa aew povo