Tente desta seguinte forma abaixo:
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 msgcontains(msg, 'Emily Topson') then
if getPlayerStorageValue(cid, 15000) >= 1 then
selfSay('Você já me ajudou.', cid)
talkState[talkUser] = 0
return true
end
if getPlayerStorageValue(cid, 15001) <= 1 then
selfSay('Emily Topson é o nome da minha esposa que sumiu após caminhar aqui próximo. Não tenho notícia dela a muito tempo.', cid)
talkState[talkUser] = 0
else
selfSay('Obrigado grande guerreiro por solucionar o mistério da minha esposa. Você agora tem permissão para acessar o lado sul da ilha..', cid)
talkState[talkUser] = 0
setPlayerStorageValue(cid, 15000, 1)
return true
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
#Obrigado por acessar a comunidade.






info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...
Pedido NPC que dá storagem 15000 se o player tiver a storagem 15001
A primeira parte do npc eu já fiz agora falta o script:
<?xml version="1.0" encoding="utf-8"?>
<npc name="Teddy Topson" script="data/npc/scripts/teddy topson.lua" floorchange="0" walkinterval="0">
<health now="100" max="100"/>
<look type="129" head="58" body="124" legs="114" feet="116" addons="2"/>
<parameters>
<parameter key="message_greet" value="Olá aventureiro." />
</parameters>
</npc>
Editado Setembro 20 por KennyxD