• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved NPCC!!! help

Joined
Jun 24, 2009
Messages
103
Reaction score
0
Location
Sweden
Hello i need help with my npcs i took all my npcs on my old server Crying demson 9.60 but map was 8.6 so i updated map to 9.60 and all worked fine! then i changed to latest Mystic Spirit and i added all my npcs and map / monster but then all npcs was bugged not even a single npc was found ingame! errors on everyone ! do any1 now what i have to do to solve this problem?


here is the error message.. :/

asdasdasd.jpg




and maybe this will help you understand the error?
i just pickt a random npc to show my script on npc

Zoltan.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Zoltan" script="data/npc/scripts/Zoltan.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="130" head="95" body="94" legs="95" feet="57" addons="0"/>
</npc>


Zoltan.lua
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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


-- Storage IDs --

fmage        = 22114    
smage        = 22115
  
newaddon    = 'Ah, right! The Ferumbra\'s Hat! Here you go.'
noitems        = 'You do not have all the required items.'
noitems2    = 'You do not have all the required items or you do not have the outfit, which by the way, is a requirement for this addon.'
already        = 'It seems you already have this addon, don\'t you try to mock me son!'


function MageSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,smage)
    if addon == -1 then
       if getPlayerItemCount(cid,5903) >= 1 then
        if doPlayerRemoveItem(cid,5903,1) then
            npcHandler:say('Ah, right! The mage hat! Here you go.')
            doSendMagicEffect(getCreaturePosition(cid), 13)
			setPlayerStorageValue(cid,smage,1)
			if getPlayerSex(cid) == 1 then 
            doPlayerAddOutfit(cid, 130, 2)
            elseif getPlayerSex(cid) == 0 then 
            doPlayerAddOutfit(cid, 141, 2)	
        end    
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
----------------------------------------Paradox-------------------------
function creatureSayCallback(cid, type, msg)
if (not npcHandler:isFocused(cid)) then
        return false
    end

		local queststate = getPlayerStorageValue(cid,6664)
		
		if msgcontains(msg, 'yenny the gentle') and queststate == 1 then
		npcHandler:say('Ah, Yenny the Gentle was one of the founders of the druid order called Crunors Caress, that has been originated in her hometown Carlin.', cid)
        talk_state = 1
		elseif msgcontains(msg, 'crunors caress') and talk_state == 1 then
			npcHandler:say('A quite undruidic order of druids they were, as far as we know. I have no more enlightening knowledge about them though.', cid)
				setPlayerStorageValue(cid,6665,1)
                talk_state = 2
		elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 2) then
			npcHandler:say('Good Bye. |PLAYERNAME|!', cid)
			

			talk_state = 0
		end
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	return true
end


node1 = keywordHandler:addKeyword({'mage hat'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get mage hat you need give me a ferumbras\' hat. Do you have them with you?'})
node1:addChildKeyword({'yes'}, MageSecond, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node2 = keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get mage hat you need give me a ferumbras\' hat. Do you have them with you?'})
node2:addChildKeyword({'yes'}, MageSecond, {})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})




npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





please help!! ill ofc rep++

Thankz in regards!!
 

Attachments

Last edited by a moderator:
here is error :S

Code:
Lua Script Error [npc interface]
data/npc/scripts/zoltan.lua
data/npc/scripts/zoltan.lua:1: Attempt to index global 'keywordhandler' <a nil value>
Stack traceback
[C]: In function '---INDEX'
Data/npc/scripts/zoltan.lua :1: in main chunk
Warning - npcscript::npcscript] can not load script: data/npc/scripts/zoltan.lua
 
didnt say me much :p he did solve it with downloading new npcs i may try that if i find it somewhere but wich is best Crying demson or Mystic spirit?
 
ah now i see but wasnt that i fixed it i had to use the latest Libs and keywordhandler etc:) thankz anyways guys for taking ur time! rep added!
 
Back
Top