ja ageitei o ~ eu to falando com o npc mas ele ta dizendo que eu ja recebi ou nao tenho o item mas eu tenho.... e nao recebii nada
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Trocar sprite no cliente...
[Encerrado] Trocar sprite no cliente...
Por xmaster0, 20 de fev. de 2013 em Tópicos Sem Resposta
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

É 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 Fevereiro 21 por Roksas
É 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
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Oks, disponha!
Dúvida sanada, reported!
É 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
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

Tópico movido para a seção de dúvidas e pedidos resolvidos.
Ei pow tem um bug mesmo se o player nao tiver os itens a mulher tah dando a rod nova pra ele
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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
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
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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
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
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

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
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

+ 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.



info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino
Desculpe, meu editor .Lua que está doido (desculpa de burro) aeuhehuaea, editei o post acima. espero qfuncione!