Ir para conteúdo

Resolvido


caio1523

Posts Recomendados

toma o script aew. o xml c faz ae.

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

 

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

 

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

-------------------------------------------------------------------------------

 

if msgcontains(msg, 'soft boots') or msgcontains(msg, 'boots') or msgcontains(msg, 'soft') then

selfSay('Yeah, i can repair your soft boots for 10000 gold. Do you want?', cid)

talk_state = 1

 

elseif msgcontains(msg, 'yes') and talk_state == 1 then

if getPlayerItemCount(cid,6530) >= 1 then

if doPlayerRemoveMoney(cid,10000) then

selfSay('Here you are.', cid)

doPlayerRemoveItem(cid,6530,1)

doPlayerAddItem(cid,2640,1)

talk_state = 0

else

selfSay('You do not have enough money.', cid)

talk_state = 0

end

else

selfSay('You do not have worn soft boots.', cid)

talk_state = 0

end

 

elseif msgcontains(msg, 'firewalker boots') or msgcontains(msg, 'firewalker') then

selfSay('Yeah, i can repair your firewalker boots for 50000 gold. Do you want?', cid)

talk_state = 2

 

elseif msgcontains(msg, 'yes') and talk_state == 2 then

if getPlayerItemCount(cid,9934) >= 1 then

if doPlayerRemoveMoney(cid,50000) then

selfSay('Here you are.', cid)

doPlayerRemoveItem(cid,9934,1)

doPlayerAddItem(cid,9933,1)

talk_state = 0

else

selfSay('You do not have enough money.', cid)

talk_state = 0

end

else

selfSay('You do not have worn firewalker boots.', cid)

talk_state = 0

end

 

elseif msg == 'no' and talk_state >= 1 then

selfSay('Ok then.', cid)

talk_state = 0

end

return TRUE

end

 

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

eu testei e deu certim.

flw

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...