edita ai
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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
local talkState = {}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local pos = {x=152,y=58,z=7} -------------- Pos para onde o player sera levado
local itemid = 2468 ----------------- Id do item que vai ser removido do player
if msgcontains(msg, "travel") then
selfSay("Eu posso te levar a TAL lugar por um "..getItemNameById(itemid).." item, fale {passage} se quizer viajar.", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, "passage") then
selfSay("Are you sure? {yes} ", cid)
talkState[talkUser] = 2
elseif msgcontains(msg, "yes") then
if doPlayerRemoveItem(cid, itemid, 1) then
selfSay("Boa viagem.", cid)
doTeleportThing(cid, pos)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
else
selfSay('You don\'t have '.. getItemNameById(itemid) ..'', cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
elseif msg == "no" and talkState[talkUser] == 2 then
selfSay("Then not", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())







info
Grupo: Campones
Registrado: 30/10/06
Posts: 17
Reputação: 0
Char no Tibia: Dimitri Vanzypher
Eaew, galera, eh o seguinte, hj d tarde eu pedi pra q alguem me ajudasse com um script.. mas tpo esse script eu tentei faze uma mudança e nun deu certo, sera que alguem aki consegue faze isso, é pouca coisa...
elseif msgcontains(msg, 'passage') then if doPlayerRemoveItem(cid, itemid, 10) then selfSay("Go on!.", cid) doTeleportThing(cid, pos)nessa parte do script, qnd eu falo pra ele passage, ele remove os itens que precisa e me teleporta direto, eu so queria mudar que, quando eu falar passage, ele perguntasse : "Are you sure?" , dai precisasse fla Yes ou No pra ele te teleporta, axo que deu pra intende.
Preciso mtoo vlww.
Editado Julho 14 por brutpc