Poste o Xml dele!
info
Grupo: Conde
Registrado: 14/04/15
Posts: 956
Reputação: +333
Gênero: Masculino

info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

então galera meu npc está todo configurado mais a unica coisa que ele fala é I have been expecting you
alguem poderia me ajudar?
Tenta assim:
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
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if getPlayerStorageValue(cid, 157171) == 4 then
return true
end
if msgcontains(msg, 'hi') or msgcontains(msg, 'ola') then
selfSay('Bem Vindo ao Mundo Pokemon! Voce gostaria de ser um mestre pokemon?', cid)
talkState[talkUser] = 1
elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 1 then
doPlayerSetVocation(cid, 1)
selfSay('Muito Bom! Agora me Fale qual sua cidade natal?', cid)
talkState[talkUser] = 3
elseif msgcontains(msg, 'Saffron') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 5)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Cerulean') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 4)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Fuchsia') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 9)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Lavender') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 7)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
elseif msgcontains(msg, 'Viridian') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 2)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Pewter') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 3)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Vermilion') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 8)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Cinnabar') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 10)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Celadon') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then
doPlayerSetTown(cid, 6)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 4
elseif msgcontains(msg, 'Charmander') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 4 then
doPokemonToPlayer(cid, "Charmander")
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 157171, 4)
talkState[talkUser] = 0
elseif msgcontains(msg, 'Bulbasaur') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 4 then
doPokemonToPlayer(cid, "Bulbasaur")
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 157171, 4)
talkState[talkUser] = 0
elseif msgcontains(msg, 'Squirtle') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 4 then
doPokemonToPlayer(cid, "Squirtle")
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 157171, 4)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado Junho 17 por Bruno Minervino
info
Grupo: Visconde
Registrado: 28/02/14
Posts: 416
Reputação: +90
Gênero: Masculino

Poste o Xml dele!
Tenta assim:
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 local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if getPlayerStorageValue(cid, 157171) == 4 then return true end if msgcontains(msg, 'hi') or msgcontains(msg, 'ola') then selfSay('Bem Vindo ao Mundo Pokemon! Voce gostaria de ser um mestre pokemon?', cid) talkState[talkUser] = 1 elseif (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 1 then doPlayerSetVocation(cid, 1) selfSay('Muito Bom! Agora me Fale qual sua cidade natal?', cid) talkState[talkUser] = 3 elseif msgcontains(msg, 'Saffron') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 5) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Cerulean') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 4) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Fuchsia') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 9) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Lavender') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 7) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) elseif msgcontains(msg, 'Viridian') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 2) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Pewter') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 3) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Vermilion') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 8) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Cinnabar') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 10) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Celadon') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 3 then doPlayerSetTown(cid, 6) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif msgcontains(msg, 'Charmander') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 4 then doPokemonToPlayer(cid, "Charmander") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) talkState[talkUser] = 0 elseif msgcontains(msg, 'Bulbasaur') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 4 then doPokemonToPlayer(cid, "Bulbasaur") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) talkState[talkUser] = 0 elseif msgcontains(msg, 'Squirtle') and getDistanceToCreature(cid) <= 3 and talkState[talkUser] == 4 then doPokemonToPlayer(cid, "Squirtle") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
n funfou aparece a mesma coisa, os outros npc funfa normalmente
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

posta um que funfe pra ver o que está de errado
info
Grupo: Visconde
Registrado: 28/02/14
Posts: 416
Reputação: +90
Gênero: Masculino

posta um que funfe pra ver o que está de errado
<?xml version="1.0" encoding="UTF-8"?> <npc name="Dalk" script="data/npc/scripts/premium.lua" walkinterval="3000" floorchange="0" access="5" > <health now="150" max="150"/> <look type="259" head="0" body="114" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Welcome to the diamond store, here you are able to upgrade your account to diamond(10D), change your hometown(5D), change sex(5D) and blessing(3D)."/> <parameter key="message_farewell" value="Bye! See you next time."/> </parameters> </npc>
info
Grupo: Conde
Registrado: 18/07/08
Posts: 545
Reputação: +21
Char no Tibia: Nem eu sei

posta o arquivo premium.lua na pasta dos npc
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

<?xml version="1.0" encoding="UTF-8"?> <npc name="Dalk" script="data/npc/scripts/premium.lua" walkinterval="3000" floorchange="0" access="5" > <health now="150" max="150"/> <look type="259" head="0" body="114" legs="114" feet="0"/> <parameters> <parameter key="message_greet" value="Welcome to the diamond store, here you are able to upgrade your account to diamond(10D), change your hometown(5D), change sex(5D) and blessing(3D)."/> <parameter key="message_farewell" value="Bye! See you next time."/> </parameters> </npc>
Posta o arquivo do npc tbm, não só o xml
info
Grupo: Visconde
Registrado: 28/02/14
Posts: 416
Reputação: +90
Gênero: Masculino

posta o arquivo premium.lua na pasta dos npc
Posta o arquivo do npc tbm, não só o xml
premium.lua, mais o npc que esta bugado não é esse é o que esta no topico la em cima
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

Npc:premium.lua, mais o npc que esta bugado não é esse é o que esta no topico la em cima
<?xml version="1.0" encoding="UTF-8"?> <npc name="Oak" script="data/npc/scripts/inicial.lua" walkinterval="0" floorchange="0" access="5" > <health now="150" max="150"/> <look type="177" head="17" body="54" legs="114" feet="0" addons="2" /> <parameters> <parameter key="message_greet" value="Bem Vindo ao Mundo Pokemon |PLAYERNAME|! Voce gostaria de ser um mestre pokemon?"/> <parameter key="message_farewell" value="Tchau! Ate a proxima."/> </parameters> </npc>inicial.lua:
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 getPlayerStorageValue(cid, 157171) == 4 then
selfSay('Desculpe! Voce ja e um mestre pokemon.', cid)
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
doPlayerSetVocation(cid, 1)
selfSay('Muito Bom! Agora me Fale qual sua cidade natal?', cid)
talkState[talkUser] = 1
elseif msgcontains(msg, 'Saffron') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 5)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Cerulean') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 4)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Fuchsia') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 9)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Lavender') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 7)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Viridian') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 2)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Pewter') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 3)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Vermilion') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 8)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Cinnabar') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 10)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Celadon') and talkState[talkUser] == 1 then
doPlayerSetTown(cid, 6)
selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid)
talkState[talkUser] = 2
elseif msgcontains(msg, 'Charmander') and talkState[talkUser] == 2 then
doPokemonToPlayer(cid, "Charmander")
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 157171, 4)
talkState[talkUser] = 0
elseif msgcontains(msg, 'Bulbasaur') and talkState[talkUser] == 2 then
doPokemonToPlayer(cid, "Bulbasaur")
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 157171, 4)
talkState[talkUser] = 0
elseif msgcontains(msg, 'Squirtle') and talkState[talkUser] == 2 then
doPokemonToPlayer(cid, "Squirtle")
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
setPlayerStorageValue(cid, 157171, 4)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado Junho 18 por Bruno Minervino
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local var_city = {
["saffron"] = 5,
["cerulean"] = 4,
["fuchsia"] = 9,
["viridian"] = 2,
["lavender"] = 7,
["pewter"] = 3,
["vermilion"] = 8,
["cinnabar"] = 10,
["celadon"] = 6
}
local ret_pokes = {"bulbasaur", "charmander", "squirtle"}
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
local talkUser, msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
if isInArray({'yes', 'sim', 'si'}, msg) then
if getPlayerStorageValue(cid, 157171) == 2 then
selfSay("Desculpe, mas só pode fazer uma escolha.", cid)
elseif getPlayerStorageValue(cid, 157171) == 1 then
selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid)
talkState[talkUser] = 2
else
selfSay("Muito Bom! Agora me Fale qual sua cidade natal? {saffron}, {cerulean} ou {fuchsia} ?", cid)
talkState[talkUser] = 1
end
elseif talkState[talkUser] == 1 then
if var_city[msg] then
doPlayerSetTown(cid, var_city[msg])
setPlayerStorageValue(cid, 157171, 1)
selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid)
talkState[talkUser] = 2
else
selfSay("está cidade não está disponivel.", cid)
end
elseif talkState[talkUser] == 2 then
if isInArray(ret_pokes, msg) then
doPokemonToPlayer(cid, msg)
setPlayerStorageValue(cid, 157171, 2)
selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid)
talkState[talkUser] = 0
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false)
else
selfSay('você só pode escolher {Bulbasaur}, {Charmander} ou {Squirtle}!', cid)
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("tudo bem então.", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado Junho 18 por Vodkart
info
Grupo: Visconde
Registrado: 28/02/14
Posts: 416
Reputação: +90
Gênero: Masculino

Npc:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Oak" script="data/npc/scripts/inicial.lua" walkinterval="0" floorchange="0" access="5" > <health now="150" max="150"/> <look type="177" head="17" body="54" legs="114" feet="0" addons="2" /> <parameters> <parameter key="message_greet" value="Bem Vindo ao Mundo Pokemon |PLAYERNAME|! Voce gostaria de ser um mestre pokemon?"/> <parameter key="message_farewell" value="Tchau! Ate a proxima."/> </parameters> </npc>inicial.lua:
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 getPlayerStorageValue(cid, 157171) == 4 then selfSay('Desculpe! Voce ja e um mestre pokemon.', cid) return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then doPlayerSetVocation(cid, 1) selfSay('Muito Bom! Agora me Fale qual sua cidade natal?', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'Saffron') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 5) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Cerulean') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 4) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Fuchsia') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 9) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Lavender') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 7) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Viridian') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 2) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Pewter') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 3) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Vermilion') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 8) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Cinnabar') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 10) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Celadon') and talkState[talkUser] == 1 then doPlayerSetTown(cid, 6) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 2 elseif msgcontains(msg, 'Charmander') and talkState[talkUser] == 2 then doPokemonToPlayer(cid, "Charmander") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) talkState[talkUser] = 0 elseif msgcontains(msg, 'Bulbasaur') and talkState[talkUser] == 2 then doPokemonToPlayer(cid, "Bulbasaur") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) talkState[talkUser] = 0 elseif msgcontains(msg, 'Squirtle') and talkState[talkUser] == 2 then doPokemonToPlayer(cid, "Squirtle") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local var_city = { ["saffron"] = 5, ["cerulean"] = 4, ["fuchsia"] = 9, ["viridian"] = 2, ["lavender"] = 7, ["pewter"] = 3, ["vermilion"] = 8, ["cinnabar"] = 10, ["celadon"] = 6 } local ret_pokes = {"bulbasaur", "charmander", "squirtle"} 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 local talkUser, msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower() if isInArray({'yes', 'sim', 'si'}, msg) then if getPlayerStorageValue(cid, 157171) == 2 then selfSay("Desculpe, mas só pode fazer uma escolha.", cid) elseif getPlayerStorageValue(cid, 157171) == 1 then selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid) talkState[talkUser] = 2 else selfSay("Muito Bom! Agora me Fale qual sua cidade natal? {saffron}, {cerulean} ou {fuchsia} ?", cid) talkState[talkUser] = 1 end elseif talkState[talkUser] == 1 then if var_city[msg] then doPlayerSetTown(cid, var_city[msg]) setPlayerStorageValue(cid, 157171, 1) selfSay('Agora escolha seu Pokemon Inicial? {Bulbasaur}, {Charmander} ou {Squirtle} ?', cid) talkState[talkUser] = 2 else selfSay("está cidade não está disponivel.", cid) end elseif talkState[talkUser] == 2 then if isInArray(ret_pokes, msg) then doPokemonToPlayer(cid, msg) setPlayerStorageValue(cid, 157171, 2) selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) talkState[talkUser] = 0 doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) else selfSay('você só pode escolher {Bulbasaur}, {Charmander} ou {Squirtle}!', cid) end elseif msg == "no" and talkState[talkUser] >= 1 then selfSay("tudo bem então.", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Vlw galera Ambos ajudaram,
Bom saber que ainda existe alguem que ajuda nos forums ^^
info
Grupo: Herói
Registrado: 01/05/08
Posts: 2.6k
Reputação: +536
Gênero: Masculino

Vlw galera Ambos ajudaram,
Bom saber que ainda existe alguem que ajuda nos forums ^^
Funcionou amigo?
info
Grupo: Visconde
Registrado: 28/02/14
Posts: 416
Reputação: +90
Gênero: Masculino

Funcionou amigo?
sim qualquer problema eu aviso de novo



info
Grupo: Visconde
Registrado: 28/02/14
Posts: 416
Reputação: +90
Gênero: Masculino
então galera meu npc está todo configurado mais a unica coisa que ele fala é I have been expecting you
alguem poderia me ajudar?
meu script
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 local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if getPlayerStorageValue(cid, 157171) == 4 then return true end if((msgcontains(msg, 'hi') or msgcontains(msg, 'ola'))) then selfSay('Bem Vindo ao Mundo Pokemon! Voce gostaria de ser um mestre pokemon?', cid) talkState[talkUser] = 0 elseif((msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and (getDistanceToCreature(cid) <= 3))then doPlayerSetVocation(cid, 1) selfSay('Muito Bom! Agora me Fale qual sua cidade natal?', cid) talkState[talkUser] = 3 elseif((msgcontains(msg, 'Saffron')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 5) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Cerulean')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 4) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Fuchsia')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 9) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Lavender')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 7) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) elseif ((msgcontains(msg, 'Viridian')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 2) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Pewter')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 3) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Vermilion')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 8) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Cinnabar')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 10) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif ((msgcontains(msg, 'Celadon')) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 3)then doPlayerSetTown(cid, 6) selfSay('Agora escolha seu Pokemon Inicial? (Bulbasaur, Charmander ou Squirtle?)', cid) talkState[talkUser] = 4 elseif((msgcontains(msg, 'Charmander') ) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 4)then doPokemonToPlayer(cid, "Charmander") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) elseif((msgcontains(msg, 'Bulbasaur') ) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 4)then doPokemonToPlayer(cid, "Bulbasaur") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) elseif((msgcontains(msg, 'Squirtle') ) and (getDistanceToCreature(cid) <= 3) and talkState[talkUser] == 4)then doPokemonToPlayer(cid, "Squirtle") selfSay('Agora voce tem um pokemon e pode seguir sua Jornada, Ate Ate logo!', cid) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) setPlayerStorageValue(cid, 157171, 4) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())peço desculpas se estiver em local errado
Editado Junho 17 por valakas