EH MTU FACIL...MAIS DIFICIL DE APRENDER SOZINHO....ABRA A PASTA DATA E VAI EM NPC...AI DEPOIS TEM AS PASTAS SCRIPT'S....ABRA ELA....ABRA DOCUMENTO CHAMADO RUNE....PRONTO...NORMALMENTE VAI TAR ASSIM.....
-- Respawn position set
--ox = 44
--oy = 5
--oz = 6 AKI SAUM AS CORDENADAS DO SEU NPC Q VENDE RUNA....
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)
if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 3 then
selfSay('Hello ' .. creatureGetName(cid) .. '! I sell hmms (30gps), uhs (40gps), gfbs (60gps), explosions (60gps), sds (70gps) and blank runes (5gps). You can also buy more runes, just say "10 uh" or "100 sd".')
focus = cid
talk_start = os.clock()
elseif string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')
elseif msgcontains(msg, '100 hmm') and focus == cid then
buy(cid,3136,100)
talk_start = os.clock()
elseif msgcontains(msg, '10 hmm') and focus == cid then
buy(cid,3136,10,100)
talk_start = os.clock()
elseif msgcontains(msg, 'hmm') and focus == cid then
buy(cid,3136,5,100)
talk_start = os.clock()
elseif msgcontains(msg, '100 uh') and focus == cid then
buy(cid,3098,100,100)
talk_start = os.clock()
elseif msgcontains(msg, '10 uh') and focus == cid then
buy(cid,3098,10,100)
talk_start = os.clock()
elseif msgcontains(msg, 'uh') and focus == cid then
buy(cid,3098,1,100)
talk_start = os.clock()
elseif msgcontains(msg, '100 gfb') and focus == cid then
buy(cid,3129,100,100)
talk_start = os.clock()
elseif msgcontains(msg, '10 gfb') and focus == cid then
buy(cid,3129,10,100)
talk_start = os.clock()
elseif msgcontains(msg, 'gfb') and focus == cid then
buy(cid,3129,3,100)
talk_start = os.clock()
elseif msgcontains(msg, '100 explosion') and focus == cid then
buy(cid,3138,100,100)
talk_start = os.clock()
elseif msgcontains(msg, '10 explosion') and focus == cid then
buy(cid,3138,10,100)
talk_start = os.clock()
elseif msgcontains(msg, 'explosion') and focus == cid then
buy(cid,3138,3,100)
talk_start = os.clock()
elseif msgcontains(msg, '100 sd') and focus == cid then
buy(cid,3093,100,100)
talk_start = os.clock()
elseif msgcontains(msg, '10 sd') and focus == cid then
buy(cid,3093,10,100)
talk_start = os.clock()
elseif msgcontains(msg, 'sd') and focus == cid then
buy(cid,3093,1,100)
talk_start = os.clock()
elseif msgcontains(msg, 'blank') and focus == cid then
buy(cid,3085,1,5)
talk_start = os.clock()
elseif string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
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
end
O Q ESTA EM VERDE EH O PREÇO DA RUNA...E BEM EMCIMA DO PREÇO TAH A RUNA....EX: 100 UH....E EH ISSO....
COMENTEM PLXXXX