• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Another simple error!

login12

void newbie scripter()
Joined
Feb 26, 2011
Messages
164
Reaction score
24
Location
Brazil
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:

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
 
Back
Top