When I try to put this script in the server, I got alot of erros. I changed everything on the npcsystem folder, but the error persists.
Here are the script:
And here are the error:
[Error - NpcScript Interface]
<Unknown script file>
Description:
attempt to call a nil value
TFS 0.4 rev 3884 v8.60
Thanks in advance.
Here are the script:
Code:
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 virar hokage 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('Temos um novo kage. O player '..getCreatureName(cid)..' acabou de virar o kage de konoha, todos o saudem.')
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())
And here are the error:
[Error - NpcScript Interface]
<Unknown script file>
Description:
attempt to call a nil value
TFS 0.4 rev 3884 v8.60
Thanks in advance.
Last edited: