Ir para conteúdo

[Encerrado] Trocar sprite no cliente...


xmaster0

Posts Recomendados

  • Respostas 44
  • Created
  • Última resposta

Top Posters In This Topic

É porque você tinha perguntando pra ele antes, e ele já te adicionou a Storage :/

Tente com outro player com que você não falou com o NPC, ou troque por esse, ajeitei a storage:

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerStorageValue (cid,3989) ~= -1 then

doAddContainerItem(bags.uid, 12247, 1)

doPlayerRemoveItem(cid,12239,1)

setPlayerStorageValue (cid,3989,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod ou não tem o item necessario (iron bar)!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

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('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Editado por Roksas
Link para o comentário
Compartilhar em outros sites

É porque você tinha perguntando pra ele antes, e ele já te adicionou a Storage :/

Tente com outro player com que você não falou com o NPC, ou troque por esse, ajeitei a storage:

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerStorageValue (cid,3989) ~= -1 then

doAddContainerItem(bags.uid, 12247, 1)

doPlayerRemoveItem(cid,12239,1)

setPlayerStorageValue (cid,3989,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod ou não tem o item necessario (iron bar)!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

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('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

 

pow eu editei e coloquei doTransformItem

 

e pegou uuuuuuuuuuuuuuuu pegaaaa muiito foooooda

Link para o comentário
Compartilhar em outros sites

É porque você tinha perguntando pra ele antes, e ele já te adicionou a Storage :/

Tente com outro player com que você não falou com o NPC, ou troque por esse, ajeitei a storage:

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerStorageValue (cid,3989) ~= -1 then

doAddContainerItem(bags.uid, 12247, 1)

doPlayerRemoveItem(cid,12239,1)

setPlayerStorageValue (cid,3989,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod ou não tem o item necessario (iron bar)!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

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('Next Please...')

end

focus = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

ei pow sabe assim para trocar a rod so se o player tivesse level 80 de fishing

Link para o comentário
Compartilhar em outros sites

Tenta assim:

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerSkillLevel(cid, 6) <= 80 then

if getPlayerStorageValue (cid,3991) ~= -1 then

doAddContainerItem(bags.uid, 12247, 1)

doPlayerRemoveItem(cid,12239,1)

setPlayerStorageValue (cid,3991,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod , não item necessario (iron bar)! Ou não tem level 80 em fishing!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

focus = 0

talk_start = 0

end

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

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Link para o comentário
Compartilhar em outros sites

Tenta então :))

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerSkillLevel(cid, 6) <= 80 then

if getPlayerStorageValue (cid,3991) ~= 2 then

if doPlayerRemoveItem(cid,12239,1) then

doAddContainerItem(bags.uid, 12247, 1)

setPlayerStorageValue (cid,3991,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod , não item necessario (iron bar)! Ou não tem level 80 em fishing!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

focus = 0

talk_start = 0

end

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

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Link para o comentário
Compartilhar em outros sites

Tenta então :))

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerSkillLevel(cid, 6) <= 80 then

if getPlayerStorageValue (cid,3991) ~= 2 then

if doPlayerRemoveItem(cid,12239,1) then

doAddContainerItem(bags.uid, 12247, 1)

setPlayerStorageValue (cid,3991,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod , não item necessario (iron bar)! Ou não tem level 80 em fishing!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

focus = 0

talk_start = 0

end

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

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

 

ei pow testa esse npc tah dando bug denovo agr deu erro na linha 29

Link para o comentário
Compartilhar em outros sites

Arrumei, aqui não deu nenhum erro!

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerSkillLevel(cid, 6) <= 80 and getPlayerStorageValue (cid,3991) ~= 2 then

if doPlayerRemoveItem(cid,12239,1) then

doAddContainerItem(bags.uid, 12247, 1)

setPlayerStorageValue (cid,3991,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod , não item necessario (iron bar)! Ou não tem level 80 em fishing!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

focus = 0

talk_start = 0

end

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

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Link para o comentário
Compartilhar em outros sites

Arrumei, aqui não deu nenhum erro!

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerSkillLevel(cid, 6) <= 80 and getPlayerStorageValue (cid,3991) ~= 2 then

if doPlayerRemoveItem(cid,12239,1) then

doAddContainerItem(bags.uid, 12247, 1)

setPlayerStorageValue (cid,3991,2)

addon_state = 0

else

selfSay('Você já recebeu sua Rod , não item necessario (iron bar)! Ou não tem level 80 em fishing!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

focus = 0

talk_start = 0

end

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

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

 

Mano deu tudo certo agora á unica coisa que funcionou é mesmo se o player tiver 0 de fishing ele consegue a great rod... fora isso tah tudo ok

Link para o comentário
Compartilhar em outros sites

Experimente:

 

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local addon_state = 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)

local bags = getPlayerSlotItem(cid, 2)

msg = string.lower(msg)

 

if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then

selfSay('Olá ' .. getCreatureName(cid) .. '... eu troco items pela great rod!')

focus = cid

 

talk_start = os.clock()

 

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

selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')

 

elseif focus == cid then

talk_start = os.clock()

if msgcontains(msg, 'great') then

if getPlayerSkillLevel(cid, 6) <= 80 then

if getPlayerStorageValue (cid,3991) ~= 2 then

if doPlayerRemoveItem(cid,12239,1) then

doAddContainerItem(bags.uid, 12247, 1)

setPlayerStorageValue (cid,3991,2)

addon_state = 0

else

selfSay('Você não tem level 80 em fishing!')

talk_start = 0

end

else

selfSay('Você ja recebeu sua Great Rod!')

talk_start = 0

end

 

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

selfSay('Good bye, ' .. getCreatureName(cid) .. '! Come back soon..')

focus = 0

talk_start = 0

end

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

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good bye then.')

focus = 0

end

end

end

 

Link para o comentário
Compartilhar em outros sites

  • 5 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.

×
×
  • Criar Novo...