abrindo serve 8.0, antes de abrir fui testa os npc que foi colocado novo
era para o player compra os addons trocando pelos itens necessários, o npc pega o item, mais não da o addons para o players,
e se o player tenta pegar de novo, o npc avisa que a pessoa já está com a quele addons.
achei que o problema era o código, então abri o script do npc, e estava certo o código, tentei com outros npc e estava com o mesmo problema, vou colocar aqui em baixo o Script de 1 npc de addons, quem souber e poder dá uma mãozinha, agradeço de já .
citizen 1
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
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('Hiho ' .. getCreatureName(cid) .. ' Eu posso lhe oferecer o Citizen Addon 1, diga help para mais infos.')
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, 'help') then
selfSay('Eu libero o Citizen Addon 1 , se estiver interessado diga: citizen cloth')
elseif msgcontains(msg, 'citizen cloth') then
if getPlayerStorageValue(cid,8000) >= 2 then
selfSay('Voce ja tem esse addon.')
else if getPlayerStorageValue(cid,8000) == 1 then
selfSay('Precisarei de 100 Minotaur Leathers, voce as trouxe?')
addon_state = 2
else
setPlayerStorageValue(cid,8000,1)
selfSay('Precisarei de 100 Minotaur Leathers, voce as trouxe?')
end
end
elseif msgcontains(msg, 'yes') and addon_state == 2 then
if doPlayerRemoveItem(cid,5878,100) == 0 then
selfSay('Sorry, you not have them.')
else
selfSay('Prontinho, voce adquiriu o Citizen Addon 1.')
if getPlayerSex(cid) == 0 then
doPlayerAddOutfit(cid, 136, 1)
setPlayerStorageValue(cid,8000,2)
else
addon(cid, 128, 1)
setPlayerStorageValue(cid,8000,2)
talk_state = 1
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Adeus ' .. creatureGetName(cid) .. ', Volte Sempre.')
focus = 0
talk_start = 0
elseif msg ~= "" then
selfSay('Como? Eu não entendi!')
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('Proximo!!...')
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