Primeiramente poste o script para que possamos editar.
Já o code seria algo mais ou menos assim:
if(msgcontains(msg, 'hi') and talkState[talkUser] < 1) then
if getPlayerLevel(cid) < 8 then
selfSay('CHILD! COME BACK WHEN YOU HAVE GROWN UP!',cid)
talkState[talkUser] = 0
return true
end
selfSay(string.upper(getPlayerName(cid))..', ARE YOU PREPARED TO FACE YOUR DESTINY?',cid)
talkState[talkUser] = 1
end




info
Group: Campones
Joined: 02/02/08
Posts: 29
Reputation: +1
Bom pessoal...
To tentando criar um oraculo, so que infelizmente o conteudo sobre npcs na internet e muito vago e por isso ando tendo muitas dificuldades =/
Queria que quando o player falar "hi" com o oraculo, se ele for lvl 7 ou menos, o oraculo dizer " CHILD! COME BACK WHEN YOU HAVE GROWN UP! ", se o player for lvl 8 ou mais o oraculo dizer "Nome do jogador, ARE YOU PREPARED TO FACE YOUR DESTINY?"
O script eh este:
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 onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end local shopModule = ShopModule:new() npcHandler:addModule(shopModule) function creatureSayCallback(cid, types, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) if msg == 'yes' then if(getPlayerLevel(cid)) >= 8 then selfSay(getCreatureName(cid)..', ARE YOU PREPARED TO FACE YOUR DESTINY??', cid) talkState[talkUser] = 1 else selfSay('CHILD! COME BACK WHEN YOU HAVE GROWN UP!', cid) end elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then selfSay('I WILL BRING YOU TO THE ISLAND OF DESTINY AND YOU WILL BE UNABLE TO RETURN HERE! ARE YOU SURE?', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'no') then talkState[talkUser] = 0 selfSay('COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 2 then if msgcontains(msg, 'yes') then doPlayerSetTown(cid, 1) doTeleportThing(cid,city1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) selfSay('SO BE IT!', cid) else if msgcontains(msg, 'no') then selfSay('COME BACK WHEN YOU ARE PREPARED TO FACE YOUR DESTINY!', cid) talkState[talkUser] = 0 end end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())So que quando o player fala hi com ele ele diz:
15:56 The Oracle: Olá, GOD Sabrina! O que o traz aqui?
Por favor...
Tem como voces me ajudarem?
Desde ja...
Muito obrigada
Edited Janeiro 19 by sabrina9292