LE
npc

[DUVIDA] OQUE FIZ DE ERRADO NO NPC

Por LeoTK, 26 de dez. de 2013 em Scripts

script
4
624
LeoTKL
26 de dezembro de 2013 às 00:03

\/ NPC SCRIPT \/

 

 

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


--------------------------script--------------------------------
if msgcontains(msg, "certificado") then
if getPlayerStorageValue(cid, 90745) > 5 then
npcHandler:say("Voce ja é um hokage!", cid)
return TRUE
end
npcHandler:say("Voce tem os seguintes items: {certificado}? {yes} or {no}.", cid)
talkState[talkUser] = 1

elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
npcHandler:say("Traga o certificado, para se tornar um hokage.", cid)
talkState[talkUser] = 0

elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, 6089, 1) == TRUE then
npcHandler:say("Muito Bem shinobi! agora voce é um Hokage!", cid)
setPlayerStorageValue(cid, 90745, 6)
doPlayerAddItem(cid, 2131, 1)
talkState[talkUser] = 0
else
npcHandler:say("Voce nao tem o certificado! axe a torre do {hokage} e me traga o Certificado!", cid)
end
end


end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

 

/\ quando entrego o certificado ele ta a storage ao player mais nao da o titulo eu do look no player aparece he is sennin < nao muda pra hokage ;/

 

alguem pode ajudar

meubkM
27 de dezembro de 2013 às 14:26
setPlayerStorageValue(cid, 90745, 6) 

a storage do seu script do look é 89745, não 90745

troca ai por

setPlayerStorageValue(cid, 89745, 6) 
LeoTKL
27 de dezembro de 2013 às 15:15

sim eu consegui arrumar um amigo meu scripter ajudo mais valeu lek pode mover pra divida resolvida xD

vai ajudar bastante gente essa questao

zipter98Z
29 de dezembro de 2013 às 12:27

Sanado, movido.