Ir para conteúdo

Posts Recomendados

Eaew galera...

Eu to com um probleminha de NPCs, eles nao respondem,

só que nao é todas as falas, so algumas...

Vou posta algumas SS para vocês terem uma noção.

 

Bug no Johnny

bugjohnny.png

 

Bug na VIP

bugvip.png

 

Como podem ver..eu falo Hi e em seguida falo o que eu quero,

e ele nao responde..se puderem me ajudar fico grato :P:

Link para o comentário
https://xtibia.com/forum/topic/142862-npc-eles-nao-respondem/
Compartilhar em outros sites

Foi eu mesmo que criei os NPCs..Ta Ai o Script e a Versao do OT..

 

 

local focus = 0

local talk_start = 0

local target = 0

local days = 0

 

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) .. '! Eu vendo vip master sorcerer se vc e master sorcerer e deseja comprar vip fala VIP.')

focus = cid

talk_start = os.clock()

 

elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then

selfSay('Sorry, ' .. creatureGetName(cid) .. '! Espera 1 minuto.')

 

elseif focus == cid then

talk_start = os.clock()

 

if msgcontains(msg, 'vip') or msgcontains(msg, 'vip') then

if getPlayerVocation(cid) > 10 then

selfSay('Vc ja e vip.')

talk_state = 0

elseif getPlayerLevel(cid) < 1000 then

selfSay('LvL 1000.')

talk_state = 0

else

selfSay('Deseja comprar VIP por 200 Browser Coin?')

talk_state = 1

end

 

elseif msgcontains(msg, 'premiumy') or msgcontains(msg, 'premmym') then

selfSay('Do you want to buy 7 days of premium for 7k?')

talk_state = 2

 

elseif talk_state == 1 then

if msgcontains(msg, 'yes') then

if doPlayerRemoveItem(cid,2159,200) == TRUE then

doPlayerSetVocation(cid, getPlayerVocation(cid)+5)

selfSay('/bc white Ae mais um Vip, o(a) ' .. creatureGetName(cid) .. '! acaba de virar Vip.Saudações ao novo Vip')

doPlayerAddItem(cid, 2276, 1)

else

selfSay('Vaza pobre.')

end

end

talk_state = 0

 

elseif talk_state == 2 then

if msgcontains(msg, 'yes') then

if pay(cid,7000) then

selfSay('/premium '.. creatureGetName(cid) ..', 30')

selfSay('You have 30 days of premium more!')

else

selfSay('Sorry, you do not have enough money.')

end

end

talk_state = 0

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Good bye, ' .. creatureGetName(cid) .. '!')

focus = 0

talk_start = 0

end

end

end

 

 

function onCreatureChangeOutfit(creature)

 

end

 

 

function onThink()

doNpcSetCreatureFocus(focus)

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Proximo...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Flw.')

focus = 0

end

end

end

 

 

 

Versao: 8.10

 

Quando eu falo Premmy no Johnny, ele fala

 

Johnny: /premium MurilooW, 7

 

E quando vou comprar vip ele fala

 

Vip Master: /bc white Ae mais um Vip, o(a) MurilooW! acaba de virar Vip.Saudações ao novo Vip

 

Consegui arrumar dos NPCs responderem..mas mandem o que iriam mandar por precauçao... agora eles nao executam comando...como /premium e /bc white

Editado por InShowTime
Link para o comentário
https://xtibia.com/forum/topic/142862-npc-eles-nao-respondem/#findComment-945180
Compartilhar em outros sites

×
×
  • Criar Novo...