Postado Março 28, 2018 7 anos Quando tento acrescentar um script novo para NPC no server, começa a dar um erro. O script é esse: Spoiler local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end function onThink() npcHandler:eek:nThink() end local storage1 = 60093 local storage2 = 60095 local global_storage = 63105 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, 'mission') or msgcontains(msg, 'help') then if getPlayerStorageValue(cid, storage1) <= 0 then if getPlayerStorageValue(cid, storage2) <= 0 then selfSay("Well, left some herbs, you will need to bring me more 100, ok?",cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, storage2) == 1 then selfSay("Did you have the 100 blood herbs?", cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid, storage2) == 2 then selfSay("Ta pronto pra terminar agora?", cid) talkState[talkUser] = 1 else selfSay("You already bring me the herbs. Thank you again.", cid) talkState[talkUser] = 0 end else selfSay("I have nothing to you.", cid) talkState[talkUser] = 0 end npcHandler:addFocus(cid) end if msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, storage2) <= 0 then selfSay("Ok then. Come back when you have them.", cid) setPlayerStorageValue(cid, storage2, 1) elseif getPlayerStorageValue(cid, storage2) == 1 then selfSay("Oh, thanks mate. You've helpful.", cid) doPlayerRemoveItem(cid, 2160, 10) setPlayerStorageValue(cid, storage2, 2) setPlayerStorageValue(cid, storage1, 2) else selfSay("Is missing some herbs.", cid) elseif getPlayerStorageValue(cid, storage2) == 2 and getGlobalStorageValue(global_storage) <= 0 then doBroadcastMessage('O player '..getCreatureName(cid)..' acabou de terminar todas as quests agora, ele é o primeiro.') doPlayerAddItem(cid, 2124, 1) setGlobalStorageValue(global_storage, 1) else selfSay("Parabéns por terminar as tasks, essa é sua recompensa final.", cid) doPlayerAddItem(cid, 2173, 1) end elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then selfSay("Ok then.", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Esse é o erro:[Error - NpcScript Interface]<Unknown script file>Description:attempt to call a nil valueTFS 0.4 rev 3884 v8.60Obrigado desde já.
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.