.Qual servidor ou website você utiliza como base?
Qual o motivo deste tópico?
Está surgindo algum erro? Se sim coloque-o aqui.
Você tem o código disponível? Se tiver publique-o aqui:
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 msg = string.lower(msg)
tabble = {
[50] = {item = {2173,1}, storage = 201320},
[100] = {item = {2160,5}, storage = 201321},
[150] = {item = {2123,1}, storage = 201322},
[200] = {item = {2466,1}, storage = 201320}
}
if isInArray({"recompensa","reward", "receber", "level"}, msg) then
npcHandler:say("Olá guerreiro, eu posso entregar recompensas para o level {50}, {100}, {150} e {200}! qual dos leveis você deseja receber a recompensa?", cid)
talkState[talkUser] = 1
elseif talkState[talkUser] == 1 then
if tabble[getNumber(msg)] then
if getPlayerStorageValue(cid, tabble[getNumber(msg)].storage) <= 0 then
if getPlayerLevel(cid) >= getNumber(msg) then
doPlayerAddItem(cid,tabble[getNumber(msg)].item[1],tabble[getNumber(msg)].item[2])
setPlayerStorageValue(cid, tabble[getNumber(msg)].storage, 1)
npcHandler:say("Parabéns! Você recebeu "..tabble[getNumber(msg)].item[2].." "..getItemNameById(tabble[getNumber(msg)].item[1]), cid)
else
npcHandler:say("Desculpe, mas você não tem level para receber essa recompensa!", cid)
end
else
npcHandler:say("Desculpe, mas você já recebeu a sua recompensa!", cid)
end
else
npcHandler:say("Desculpe, mas não tenho recompensa para esse level!", cid)
end
elseif isInArray({"no","nao"}, msg) 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())
function getNumber(txt)
x = string.gsub(txt,"%a","")
x = tonumber(x)
if x ~= nill and x > 0 then
return x
else
return 0
end
end
Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.