Ir para conteúdo
  • 0

Problema: <eof> near end


Aerdor

Pergunta

Galera, to com problema no npc aqui:

 

 

 

--------------

--- Config ---

--------------

-- item necessário para fazer a busca

local i_required = 10099

-- contagem de item necessário para fazer a busca

local i_required_count = 1

 

-- recompensa padrão id item

local i_reward = 2531

local i_reward2 = 2544

 

-- contagem de recompensa

local i_reward_count = 1

local i_reward2_count = 30

 

-- --

local storage = 60307

 

-- --

local questname = "first quest"

 

-- NPC Messages --

local npc_message ={

 

"You need the map of the village to complete this mission, do you have it?",

"You don't have the required item to complete this mission.",

"Thank you for the help, {take it.}",

"You have already done this {mission}.",

"This mission is probably your {"..questname.."}, so take work hard. If you help me, I can give a reward to you!"

}

 

-------------------

--- End Confing ---

-------------------

 

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

 

if(msgcontains(msg, 'mission')) then

selfSay(npc_message[5], cid)

end

 

if(msgcontains(msg, questname)) then

selfSay(npc_message[1], cid)

talkState[talkUser] = 1

elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

 

if (getPlayerStorageValue(cid,storage) > 0) then

selfSay(npc_message[4], cid)

else

 

if(doPlayerRemoveItem(cid,i_required,i_required_count)) then

setPlayerStorageValue(cid,storage,1)

doPlayerAddItem(cid,i_reward,i_reward_count)

doPlayerAddItem(cid,i_reward2,i_reward2_count)

doPlayerSetVocation(cid,3)

if getPlayerSex(cid) == PLAYERSEX_MALE then

doPlayerAddOutfit(cid,239)

doPlayerAddOutfit(cid,280)

doPlayerRemOutfit(cid,128)

else

doPlayerAddOutfit(cid,237)

doPlayerAddOutfit(cid,67)

doPlayerRemOutfit(cid,136)

end

end

end

selfSay(npc_message[3], cid)

doSendMagicEffect(getCreaturePosition(cid), 10)

doCreatureSay(cid, "Quest Finished!", TALKTYPE_ORANGE_1)

else

selfSay(npc_message[2], cid)

end

end

return true

end

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

Sendo que o erro tá nesse pedaço:

 

doPlayerSetVocation(cid,3)
if getPlayerSex(cid) == PLAYERSEX_MALE then
doPlayerAddOutfit(cid,239)
doPlayerAddOutfit(cid,280)
doPlayerRemOutfit(cid,128)
else
doPlayerAddOutfit(cid,237)
doPlayerAddOutfit(cid,67)
doPlayerRemOutfit(cid,136)
end
end
end

 

E o erro que dá é esse:

 

[Error - LuaScriptInterface::loadFile] data/npc/scripts/quest.lua:93: '<eof>' expected near 'end'

 

Sei que deve ser uma dúvida noob, mas como conserta? uhasuhasuhasuhsauhsuah

E alguém poderia me explicar o que é "eof"?

 

Rep+ pra quem ajudar.

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Tenta assim:

 

 

--------------
--- Config ---
--------------
-- item necessário para fazer a busca
local i_required = 10099
-- contagem de item necessário para fazer a busca
local i_required_count = 1

-- recompensa padrão id item
local i_reward = 2531
local i_reward2 = 2544

-- contagem de recompensa
local i_reward_count = 1
local i_reward2_count = 30

-- --
local storage = 60307

-- --
local questname = "first quest"

-- NPC Messages --
local npc_message ={

"You need the map of the village to complete this mission, do you have it?",
"You don't have the required item to complete this mission.",
"Thank you for the help, {take it.}",
"You have already done this {mission}.",
"This mission is probably your {"..questname.."}, so take work hard. If you help me, I can give a reward to you!"
}

-------------------
--- End Confing ---
-------------------

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

if(msgcontains(msg, 'mission')) then
selfSay(npc_message[5], cid)
end

if(msgcontains(msg, questname)) then
selfSay(npc_message[1], cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if (getPlayerStorageValue(cid,storage) > 0) then
selfSay(npc_message[4], cid)
else

if(doPlayerRemoveItem(cid,i_required,i_required_count)) then
setPlayerStorageValue(cid,storage,1)
doPlayerAddItem(cid,i_reward,i_reward_count)
doPlayerAddItem(cid,i_reward2,i_reward2_count)
doPlayerSetVocation(cid,3)
if getPlayerSex(cid) == PLAYERSEX_MALE then
doPlayerAddOutfit(cid,239)
doPlayerAddOutfit(cid,280)
doPlayerRemOutfit(cid,128)
else
doPlayerAddOutfit(cid,237)
doPlayerAddOutfit(cid,67)
doPlayerRemOutfit(cid,136)
end
end
end
selfSay(npc_message[3], cid)
doSendMagicEffect(getCreaturePosition(cid), 10)
doCreatureSay(cid, "Quest Finished!", TALKTYPE_ORANGE_1)
else
selfSay(npc_message[2], cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

 

Link para o comentário
Compartilhar em outros sites

  • 0

Bom, "funcionou". Mas aproveitando, você poderia trocar pra mim a parte de adicionar e remover outfits?

Pq não ta funcionando. E queria que quando você completasse a quest seu outfit mudasse automaticamente e o anterior fosse deletado.

É possível? :SS

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...