Sabe fazer o .xml?
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
local configuration = {
id = xxx, --ID do item que o jogador irá receber.
position = {x = x, y = y, z = z}, --Para onde o jogador irá ser teleportado.
quantity = 5,
}
local check = {}
if msgcontains(msg:lower(), "enter") or msgcontains(msg:lower(), "travel") then
selfSay("Para ser teleportado e receber "..configuration.quantity.." "..getItemNameById(configuration.id)..", você precisa remover as pokeballs vazias de sua bag. Deseja continuar?", cid)
talkState[talkuser] = 1
return true
elseif (msgcontains(msg:lower(), "yes") or msgcontains(msg:lower(), "sim")) and talkState[talkUser] == 1 then
for i = 2391, 2394 do
if getPlayerItemCount(cid, i) > 0 then
table.insert(check, i)
end
end
if #check > 0 then
local str = ""
for i = 1, #check do
if str == "" then
str = getItemNameById(check[i])
else
str = str..", "..getItemNameById(check[i])
end
end
selfSay("Você possui em sua bag a(s) seguinte(s) pokeball(s): "..str, cid)
talkState[talkUser] = 0
return true
else
selfSay("Boa sorte!", cid)
doPlayerAddItem(cid, configuration.id, configuration.quantity)
doTeleportThing(cid, configuration.position)
talkState[talkUser] = 0
return true
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.