MUTANO
New Member
Hello
I made a quest using 2 NPCs, but they have not worked as I wanted.
The two are giving the following error:
SCRIPTS:
The two NPCs interact is the same quest, as you can understand. But this error happens ...
I thought that someone what is wrong in 2 Scripts. :huh:
Thanks to attention. Until more.
I made a quest using 2 NPCs, but they have not worked as I wanted.
The two are giving the following error:
SCRIPTS:
----------------local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
local msgs = {
"Hi, |PLAYERNAME|. Better that has disturbed me for good reason, because I'm thirsty for blood.",
"The book that old witch? It may take, we can not understand a written as old,"
"I do not know what book is talking about. Get out of my way now!",
"Are you crazy? I already gave you the damn book!"
"I can not give you something that does not hold charge!"
}
npcHandler:setMessage(MESSAGE_GREET, msgs[1])
if msgcontains(msg, "book of magic") then
if getPlayerStorageValue(cid,8569) == 1 then
if getPlayerFreeCap(cid) < getItemWeight(6120,1) then
selfSay(msgs[5], cid)
else
selfSay(msgs[2], cid)
doPlayerAddItem(cid, 6120, 1)
setPlayerStorageValue(cid, 8569, 2)
end
elseif getPlayerStorageValue(cid, 8569) >= 2 then
selfSay(msgs[4], cid)
else
SelfSay(msgs[3], cid)
end
end
talkState[talkUser] = 0
npcHandler:addModule(FocusModule:new())
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandlernCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandlernCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandlernCreatureSay(cid, type, msg) end
function onThink() npcHandlernThink() end
local msgs = {
"Hello, |PLAYERNAME|! I am the most powerful witch in the region. But I do not have time for you, I'm busy!",
"My book magic? Vampires of venore robbed me! But I'm already planning a way to take it back those worms."
"I see that my book recovered magic! Take this gift as a bonus. Obrigada .. Hmm..|PLAYERNAME|. This is your name, right?"
"Thank you for having recovered my book!",
"He said he became my book, but where is he? You are trying to rob me? Get out of my way!",
"It seems that this man is too heavy for you."
}
npcHandler:setMessage(MESSAGE_GREET, msgs[1])
if msgcontains(msg, 'book of magic') then
if getPlayerStorageValue(cid, 8569) == -1 then
selfSay(msgs[2], cid)
setPlayerStorageValue(cid,8569, 1)
elseif getPlayerStorageValue(cid, 8569) == 3 then
selfSay(msgs[4],cid)
elseif getPlayerStorageValue(cid, 8569) == 2 then
if getPlayerItemCount(cid, 6120) then
if getPlayerFreeCap + getItemWeight(6120, 1) >= getItemWheight(2487,1) then
selfSay(msgs[3], cid)
doPlayerRemoveItem(cid, 6120, 1)
doPlayerAddItem(uid, 2487, 1)
setPlayerStorageValue(cid, 8569, 3)
else
selfSay(msgs[6], cid)
end
else
selfSay(msgs[5], cid)
end
end
end
talkState[talkUser] = 0
npcHandler:addModule(FocusModule:new())
The two NPCs interact is the same quest, as you can understand. But this error happens ...
I thought that someone what is wrong in 2 Scripts. :huh:
Thanks to attention. Until more.
Last edited: