awe esse npc e o npc de test muito rox manow
primeiro va em npc/scripts e fas um assim
focus = 0contador = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(id, stackpos)
if id == focus then
focus = 0
contador = 0
selfSay("Ate breve.")
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('HeheheHaHaHae ' .. creatureGetName(cid) .. ' Quer testar suas abilidades! Se vc quiser fale ok?')
contador = 1
focus = cid
talk_start = os.clock()
end
if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 3 then
selfSay('Só tem lugar pra um ' .. creatureGetName(cid) .. '.')
end
if string.find(msg, '(%a*)ok(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
jogar = getPlayerStorageValue(cid,3333)
if jogar == 1 then
selfSay('Podemos começar?')
contador = 5
setPlayerStorageValue(cid,3333,1)
end
if jogar == -1 then
selfSay('Desculpe, voce ja participou.')
end
end
if msgcontains(msg, 'sim') and focus == cid and contador == 5 then
selfSay('Vamos lá! Primeira Pergunta: Qual é o bixo mais forte? 1-demon, 2-snake, 3-monk, 4-worms')
contador = 2
talk_start = os.clock()
end
if string.find(msg, '(%a*)worms(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)monk(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)snake(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 2 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'sim') and focus == cid and contador == 1 then
talk_start = os.clock()
queststatus = getPlayerStorageValue(cid,2563)
if queststatus == -1 then
selfSay('Vamos para a primeira pergunta, esta pronto?')
contador = 3
else
selfSay('Voce ja perdeu...')
end
end
if msgcontains(msg, 'demon') and focus == cid and contador == 2 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 6
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 6 then
selfSay('Vamos lá! Segunda Pergunta: com q se pesca? 1-worms, 2-laranja, 3-pedra, 4-mato.')
contador = 7
talk_start = os.clock()
end
if string.find(msg, '(%a*)laranja(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)mato(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)pedra(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 7 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'worms') and focus == cid and contador == 7 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 8
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 8 then
selfSay('Vamos lá! Terceira Pergunta: qual a cidade mais chata de jodar? 1-carlin, 2-thais, 3-Edron, 4-darashia.')
contador = 9
talk_start = os.clock()
end
if string.find(msg, '(%a*)darashia(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)edron(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)thais(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 9 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'carlin') and focus == cid and contador == 9 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 10
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 10 then
selfSay('Vamos lá! Quarta Pergunta: qual e o estado do brasil? 1-brasilia, 2-sao paulo, 3-itobi, 4-vgs.')
contador = 11
talk_start = os.clock()
end
if string.find(msg, '(%a*)vgs(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)sao paulo(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)itobi(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'brasilia') and focus == cid and contador == 11 then
selfSay('Certa a Resposta! Podemos continuar?')
contador = 12
talk_start = os.clock()
end
if msgcontains(msg, 'sim') and focus == cid and contador == 12 then
selfSay('Vamos lá! Última Pergunta!!! qual é o bixo q vc tem mais medo de morre? 1-Orshabaal, 2-ciclop, 3-worms, 4-troll.')
contador = 11
talk_start = os.clock()
end
if string.find(msg, '(%a*)troll(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)ciclop(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)worms(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 and contador == 11 then
selfSay('Errado!')
focus = 0
talk_start = 0
end
if msgcontains(msg, 'orshabaal') and focus == cid and contador == 11 and getDistanceToCreature(cid) < 3 then
selfSay('Certa a Resposta!!!!! Voce ganhou seu premio!')
selfSay('Let\'s go!')
selfSay('/send ' .. creatureGetName(cid) .. ', 275 86 4')end
if msgcontains(msg, 'nao') or msgcontains(msg, 'não') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('OK, mas perdeu uma grande chance!')
focus = 0
talk_start = 0
end
if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 3 then
selfSay('Adeus, Boa Sorte. HahahaHeheHAhae')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if (os.clock() - talk_start) > 40 then
if focus > 0 then
selfSay('Quem qr testar suas abilidades!?')
end
focus = 0
end
--nothing special has happened
--but perhaps we want to walk around a bit?
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,50)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end
end
dpois de ter feito isso va em word/npc e coloke
<npc name="Test" x="145" y="51" z="7" dir="0"/>
Creditos By R@U£
Quarquer duvida ou erro poste
ai vlwsssss
flwsssssss