The problem is that after the NPC speak: "Amazing! You already have the pieces ?!" I type yes, and he does not answer anything more.
I believe the problem is talk_state, i'm not knowing manage with many IF's.
Can anyone exlicar me why this happens?
CODE:
I believe the problem is talk_state, i'm not knowing manage with many IF's.
Can anyone exlicar me why this happens?
CODE:
Code:
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'mission') then
talk_state = 1
if getPlayerStorageValue(cid, 47999) == 1 then
npcHandler:say('Thank you in advance! Well I need you to bring me 3 pieces so that I can fix the electric starting... Well, the items are: (parafuse of adamantium), (motorcycle manual), (special toolbox). Back here, when you found this.')
doSendMagicEffect(getThingPos(cid),10)
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE, "You started now, Dead'cycle quest. Good luck!")
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE, "You can use the command: !deadcycle quest, if you forget what items you need found!")
setPlayerStorageValue(cid, 47999, -1)
talk_state = 1
elseif talk_state == 1 and msgcontains(msg, 'mission') and getPlayerStorageValue(cid, 47999) == -1 then
npcHandler:say('Amazing! You already have the pieces?!', 1)
if talk_state == 1 and msgcontains(msg, 'yes') then
npcHandler:say('Its so amazing!', 1)
talk_state = 0
end
end
return false
end
return true
end