Postado Outubro 24, 2012 12 anos O que tem de errado nesse script? ta dando um erro Unexpected symbol near then at line 23 local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local storage1 = 171717 -------------- Storagevalue 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 if msgcontains(msg, "quest") or msgcontains(msg, "mission") then selfSay("Para voce sair eu preciso de 1 "..getItemNameById(itemid)..", You bringing me draconian steel and obsidian lance in exchange for obsidian knife?", cid) talkState[cid] = 0 elseif msgcontains(msg, 'yes') then getPlayerStorageValue(cid,storage1) < 1 then if (doPlayerRemoveItem(cid,5889,1) == TRUE and doPlayerRemoveItem(cid,2425,1) == TRUE) then doPlayerAddItem(cid,5908,1) setPlayerStorageValue(cid,storage1,1) selfSay("Adeus.", cid) doTeleportThing(cid, pos) else selfSay("Voce nao possui o item que eu preciso.", cid) end end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Outubro 25, 2012 12 anos Faltou o if no get local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local storage1 = 171717 -------------- Storagevalue 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 if msgcontains(msg, "quest") or msgcontains(msg, "mission") then selfSay("Para voce sair eu preciso de 1 "..getItemNameById(itemid)..", You bringing me draconian steel and obsidian lance in exchange for obsidian knife?", cid) talkState[cid] = 0 elseif msgcontains(msg, 'yes') then if getPlayerStorageValue(cid,storage1) < 1 then if (doPlayerRemoveItem(cid,5889,1) == TRUE and doPlayerRemoveItem(cid,2425,1) == TRUE) then doPlayerAddItem(cid,5908,1) setPlayerStorageValue(cid,storage1,1) selfSay("Adeus.", cid) doTeleportThing(cid, pos) else selfSay("Voce nao possui o item que eu preciso.", cid) end end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) http://baiakuza.com/IP: baiakuza.com TIBIA: 10.96 Baiak Custom [ High Exp Rate ]
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.