Ae fiko rox kra...valeu ae vai ajuda mtu no meu ot
ty
Obs.: 1 POST! xD
Por BoRoMiR, 14 de abr. de 2006 em Tutoriais de Scripting
Ae fiko rox kra...valeu ae vai ajuda mtu no meu ot
ty
Obs.: 1 POST! xD
Legal o tuto..
Poderia ser melhor
Mas ta bom,
Atenciosamente,God Luan.
info
Grupo: Campones
Registrado: 04/11/06
Posts: 3
Reputação: 0
Bom.. tutorial simples, porem é algo que muitas pessoas que estam começandu a mecher em ot servs não devem saber.
So estou postandu aqui porque no inicio do post do script você colocou
-- Respawn position set--ox = 44
--oy = 5
--oz = 6
E nos servidores 7.8/7.81 isso não faz mais os npc's andarem, nas recentes versões tem que colocar entre 'function onThink ()' e 'selfSay('next plese...')..
function onThink()if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Next Please...')
Ficando assim..
function onThink()if focus > 0 then
x, y, z = creatureGetPosition(focus)
myx, myy, myz = selfGetPosition()
if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then
selfTurn(0)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(1)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(3)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(1)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(3)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(2)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(0)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(1)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(3)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(2)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(0)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(1)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(3)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(2)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(0)
end
end
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('next please..')
OBS: nem sempre estará escrito 'next plese'. Neste lugar estara a mensagem que você quiser que o npc diga quando terminar de falar com alguem
Espero ter ajudado, pelo menos uma pessoa que tenha tentado usar esse esript em um ot 7.8 e viu que o npc não estava andando...
Sem mais
info
Grupo: Campones
Registrado: 29/03/06
Posts: 30
Reputação: 0
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