Ot 8.6<
Bom pessoal mexi em algumas coisas, juntei alguns script, e acabei fazendo um npc que dá xp por storage! bem como assim?
bom você faz uma quest e volta pra falar com o npc, assim, ele te da tando de xp, só que,
ele continua dando xp sempre, queria saber como faço pra ele só dar uma vez!
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
npcHandler:setMessage(MESSAGE_GREET, "Hello welcome to Global Server RPG, Make quest in 2 floor up of my House, and back to me saying Quest ")
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
-- Conversa Jogador/NPC
if(msgcontains(msg, 'Quest')) and getPlayerStorageValue(cid, 60994)>=1 then
doSendAnimatedText(getPlayerPosition(cid),"Exp", TEXTCOLOR_RED)
doPlayerAddExp(cid,100)
selfSay('Thanks, can continue your expedition!.',cid)
talkState[talkUser] = 1
else
selfSay('You dont maked quest!.',cid)
talkState[talkUser] = 1
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Ta ai, desde já agradecido!