Seguinte, to usano esse script do VodKart..
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 bag_id = 6571 -- id da sua bag
local storage = 40021
if(msgcontains(msg, 'natal') or msgcontains(msg, 'NATAL')) then
selfSay('Ho,ho,ho. Vou te ajudar a ganhar o seu Presente, mas você merece?? {yes}', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerStorageValue(cid,storage) <= 0 then
setPlayerStorageValue(cid,storage,1)
doPlayerAddItem(cid, bag_id, 1)
selfSay('Aqui está seu presente,Feliz Natal!', cid)
doSendMagicEffect(getPlayerPosition(cid), 2)
else
selfSay('Você já ganhou seu presente!.', cid)
talkState[talkUser] = 0
end
elseif msg == "no" and talkState[talkUser] >= 1 then
selfSay("Volte no próximo natal então!", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Queria que o npc só entregase o presente para players lvl 150+
pq asim qualquer lvl 8 pode pega o presente..
vlw e REP++