Postado Fevereiro 7, 2015 10 anos Autor Em 07/02/2015 em 14:43, xBlackWolf disse: O primeiro erro eu arrumei... já o segundo, não tenho idéia, porque no meu ot 10.35 funciona normal e é script de 8.60... tenta agora e ve se da erro. Mostrar conteúdo oculto Mostrar conteúdo oculto ---- NPC DE BARCO, FEITO POR XBLACKWOLF P\ TIBIAKING. ---- EDITAR APENAS AS POSIÇÕES E AS PALAVRAS MÁGICAS: if msgcontains(msg, 'town 1 free') then ---- NO CASO 'TOWN 1 FREE' town1free = {x=759, y=678, z=7} town2free = {x=430, y=420, z=6} town3free = {x=400, y=482, z=6} town4free = {x=518, y=439, z=6} town5free = {x=568, y=465, z=7} town6free = {x=434, y=618, z=7} town7free = {x=573, y=694, z=7} town1 = {x=237, y=928, z=7} town2 = {x=600, y=1052, z=7} town3 = {x=423, y=1010, z=7} local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos) 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('Hiho ' .. getCreatureName(cid) .. '! Anda logo, me diga a onde deseja ir') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('espera, ' .. getCreatureName(cid) .. '!porra.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'town 1 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1free) doSendMagicEffect(town1free,10) selfSay("Vai") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 2 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2free) doSendMagicEffect(town2free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 3 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3free) doSendMagicEffect(town3free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 4 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town4free) doSendMagicEffect(town4free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 5 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town5free) doSendMagicEffect(town5free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 6 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town6free) doSendMagicEffect(town6free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 7 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town7free) doSendMagicEffect(town7free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end ------------------------------------------ VIP Travel ----------------------------------- elseif msgcontains(msg, 'town 1') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1) doSendMagicEffect(town1,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end end elseif msgcontains(msg, 'town 2') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2) doSendMagicEffect(town2,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end end elseif msgcontains(msg, 'town 3') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3) doSendMagicEffect(town3,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', go back.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('how? I do not understand!') talk_state = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next please!!...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end vlw parceiro, está funcionando agora só tem um problema, ele fala no Default, nao fala no chat npc, teria como ver isso pra mim ? OBS: outra coisa que acabei de ver, quando um jogador free fala que quer ir pra cidade vip, ele não responde, poderia botar ele pra falar que não é possivel por qe ele não eh vip ? poderia botar tbm pra confimar a viagem ? exp: hi, yalahar, yes ele tah teleportando só em falar o nome da cidade Darei REP+ ><" Editado Fevereiro 7, 2015 10 anos por subhe (veja o histórico de edições)
Postado Fevereiro 7, 2015 10 anos É só o meu NPC que está falando no default? Segue com mensagem para free: Mostrar conteúdo oculto ---- NPC DE BARCO, FEITO POR XBLACKWOLF P\ TIBIAKING. ---- EDITAR APENAS AS POSIÇÕES E AS PALAVRAS MÁGICAS: if msgcontains(msg, 'town 1 free') then ---- NO CASO 'TOWN 1 FREE' town1free = {x=759, y=678, z=7} town2free = {x=430, y=420, z=6} town3free = {x=400, y=482, z=6} town4free = {x=518, y=439, z=6} town5free = {x=568, y=465, z=7} town6free = {x=434, y=618, z=7} town7free = {x=573, y=694, z=7} town1 = {x=237, y=928, z=7} town2 = {x=600, y=1052, z=7} town3 = {x=423, y=1010, z=7} local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos) 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('Hiho ' .. getCreatureName(cid) .. '! Anda logo, me diga a onde deseja ir') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('espera, ' .. getCreatureName(cid) .. '!porra.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'town 1 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1free) doSendMagicEffect(town1free,10) selfSay("Vai") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 2 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2free) doSendMagicEffect(town2free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 3 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3free) doSendMagicEffect(town3free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 4 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town4free) doSendMagicEffect(town4free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 5 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town5free) doSendMagicEffect(town5free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 6 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town6free) doSendMagicEffect(town6free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 7 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town7free) doSendMagicEffect(town7free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end ------------------------------------------ VIP Travel ----------------------------------- elseif msgcontains(msg, 'town 1') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1) doSendMagicEffect(town1,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'town 2') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2) doSendMagicEffect(town2,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'town 3') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3) doSendMagicEffect(town3,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', go back.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('how? I do not understand!') talk_state = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next please!!...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end xBlackWolf THX @Storm Night Best Avatar Ever
Postado Fevereiro 7, 2015 10 anos Autor Em 07/02/2015 em 15:11, xBlackWolf disse: É só o meu NPC que está falando no default? Segue com mensagem para free: Mostrar conteúdo oculto Mostrar conteúdo oculto ---- NPC DE BARCO, FEITO POR XBLACKWOLF P\ TIBIAKING. ---- EDITAR APENAS AS POSIÇÕES E AS PALAVRAS MÁGICAS: if msgcontains(msg, 'town 1 free') then ---- NO CASO 'TOWN 1 FREE' town1free = {x=759, y=678, z=7} town2free = {x=430, y=420, z=6} town3free = {x=400, y=482, z=6} town4free = {x=518, y=439, z=6} town5free = {x=568, y=465, z=7} town6free = {x=434, y=618, z=7} town7free = {x=573, y=694, z=7} town1 = {x=237, y=928, z=7} town2 = {x=600, y=1052, z=7} town3 = {x=423, y=1010, z=7} local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos) 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('Hiho ' .. getCreatureName(cid) .. '! Anda logo, me diga a onde deseja ir') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('espera, ' .. getCreatureName(cid) .. '!porra.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'town 1 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1free) doSendMagicEffect(town1free,10) selfSay("Vai") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 2 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2free) doSendMagicEffect(town2free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 3 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3free) doSendMagicEffect(town3free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 4 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town4free) doSendMagicEffect(town4free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 5 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town5free) doSendMagicEffect(town5free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 6 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town6free) doSendMagicEffect(town6free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 7 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town7free) doSendMagicEffect(town7free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end ------------------------------------------ VIP Travel ----------------------------------- elseif msgcontains(msg, 'town 1') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1) doSendMagicEffect(town1,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'town 2') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2) doSendMagicEffect(town2,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'town 3') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3) doSendMagicEffect(town3,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', go back.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('how? I do not understand!') talk_state = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next please!!...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end sim, somente o seu npc que fala no Default irei test aqui jaja edito Ediit: não funcionou, ficou do mesmo jeito Jogador Free (cidade vip) Citar 13:24 Master Of Puppets [12]: hi 13:24 Sparrow: Hiho Master Of Puppets! Anda logo, me diga a onde deseja ir 13:24 Master Of Puppets [12]: alfon ele não responde nada depois disso Jogador vip, a mesma fala, só que ele é teleportado Arrumei essa parte do npc responder o player free, quando tenta ir pra cidade vip só falta 2 coisinhas o npc continua falando no default, e queria tbm que botasse uma confimação na hora que for viajar Voce quer viajar para x cidade por x gold coins? OBS: percebi uma coisa agora, o npc fala no default, mais se eu abrir manualmente o chat do npc, ele fala tbm, mais não no chat, no default exemplo: eu falo no chat npc, ele responde no default e não no chat npc ;x OBS: acho que esse erro do npc nao falar pelo default, é por que o seu ot eh versão 10.x e o meu eh 8.6, muda algumas funcões poderia adaptar pra 8.6 ? Editado Fevereiro 8, 2015 10 anos por subhe (veja o histórico de edições)
Postado Fevereiro 9, 2015 10 anos Desculpe, mas enfrento o mesmo problema no meu OT, estou pesquisando e tentando aprender a adaptar para utilizar o NPC Chat. Vou ficar te devendo. Não sei como ficou seu script dps que vc arrumou, mas segue agora com confirmação: Mostrar conteúdo oculto ---- NPC DE BARCO, FEITO POR XBLACKWOLF P\ TIBIAKING. ---- EDITAR APENAS AS POSIÇÕES E AS PALAVRAS MÁGICAS: if msgcontains(msg, 'town 1 free') then ---- NO CASO 'TOWN 1 FREE' town1free = {x=759, y=678, z=7} town2free = {x=430, y=420, z=6} town3free = {x=400, y=482, z=6} town4free = {x=518, y=439, z=6} town5free = {x=568, y=465, z=7} town6free = {x=434, y=618, z=7} town7free = {x=573, y=694, z=7} town1 = {x=237, y=928, z=7} town2 = {x=600, y=1052, z=7} town3 = {x=423, y=1010, z=7} local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos) 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('Hiho ' .. getCreatureName(cid) .. '! Anda logo, me diga a onde deseja ir') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('espera, ' .. getCreatureName(cid) .. '!porra.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'town 1 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1free) doSendMagicEffect(town1free,10) selfSay("Vai") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end elseif msgcontains(msg, 'town 2 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2free) doSendMagicEffect(town2free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end elseif msgcontains(msg, 'town 3 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3free) doSendMagicEffect(town3free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end elseif msgcontains(msg, 'town 4 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town4free) doSendMagicEffect(town4free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end elseif msgcontains(msg, 'town 5 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town5free) doSendMagicEffect(town5free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end elseif msgcontains(msg, 'town 6 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town6free) doSendMagicEffect(town6free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end elseif msgcontains(msg, 'town 7 free') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town7free) doSendMagicEffect(town7free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end end ------------------------------------------ VIP Travel ----------------------------------- elseif msgcontains(msg, 'town 1') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1) doSendMagicEffect(town1,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end end elseif msgcontains(msg, 'town 2') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2) doSendMagicEffect(town2,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end end elseif msgcontains(msg, 'town 3') then msg = string.lower(msg) selfSay('Tem certeza que deseja ir a town 1 ?') if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim') and (focus == 0)) and getDistanceToCreature(cid) < 4 then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3) doSendMagicEffect(town3,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end selfSay("Você não tem VIP!") end end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', go back.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('how? I do not understand!') talk_state = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next please!!...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end Faça suas modificações, e me fala se está funcionando. Não testei. E também se não soube modificar posta seu script que eu ponho a confirmação. Abrs, xBlackWolf THX @Storm Night Best Avatar Ever
Postado Fevereiro 10, 2015 10 anos Autor testei o seu script, ele nao funcionou, está dando aquele mesmo erro do incio, quando vc fala o nome da cidade, ele fala Citar 'how? I do not understand! e não responde mais nada irei postar o meu script aqui, pq nao consegui fazer as alterações Citar ---- NPC DE BARCO, FEITO POR XBLACKWOLF P\ TIBIAKING. ---- EDITAR APENAS AS POSIÇÕES E AS PALAVRAS MÁGICAS: if msgcontains(msg, 'town 1 free') then ---- NO CASO 'TOWN 1 FREE' town1free = {x=1555, y=2576, z=6} town2free = {x=430, y=420, z=6} town3free = {x=400, y=482, z=6} town4free = {x=518, y=439, z=6} town5free = {x=568, y=465, z=7} town6free = {x=434, y=618, z=7} town7free = {x=573, y=694, z=7} town1 = {x=114, y=282, z=6} town2 = {x=600, y=1052, z=7} town3 = {x=423, y=1010, z=7} local focus = 0 local talk_start = 0 local target = 0 local following = false local attacking = false function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos) 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('Olá ' .. getCreatureName(cid) .. '! Anda logo, me diga a onde deseja ir') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('espera, ' .. getCreatureName(cid) .. '!porra.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'yalahar') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1free) doSendMagicEffect(town1free,10) selfSay("Vai") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 2 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2free) doSendMagicEffect(town2free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 3 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3free) doSendMagicEffect(town3free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 4 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town4free) doSendMagicEffect(town4free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 5 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town5free) doSendMagicEffect(town5free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 6 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town6free) doSendMagicEffect(town6free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end elseif msgcontains(msg, 'town 7 free') then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town7free) doSendMagicEffect(town7free,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money.") end ------------------------------------------ VIP Travel ----------------------------------- elseif msgcontains(msg, 'alfon') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town1) doSendMagicEffect(town1,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end else selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'town 2') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town2) doSendMagicEffect(town2,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end else selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'town 3') then if(getPlayerVipDays(cid) > 0) then if(doPlayerRemoveMoney(cid, 50) == TRUE) then doTeleportThing(cid,town3) doSendMagicEffect(town3,10) selfSay("Let's GO") focus = 0 talk_start = 0 else selfSay("Sorry, you don\'t have enough money or VIP Time.") end else selfSay("Você não tem VIP!") end elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Bye ' .. getCreatureName(cid) .. ', go back.') focus = 0 talk_start = 0 elseif msg ~= "" then selfSay('how? I do not understand!') talk_state = 0 end end end function onCreatureChangeOutfit(creature) end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 30 then if focus > 0 then selfSay('Next please!!...') end focus = 0 talk_start = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good Bye') focus = 0 talk_start = 0 end end end por favor, me ajuda nessa parte da confirmação, irei dar mts rep+ pra vc, por ter me ajudado mt ><'
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.