• 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!

Npc errors.

Killzon32

There killing our dudes.
Joined
Aug 11, 2010
Messages
235
Reaction score
8
Location
mount olympus
Got 2 npc errors.

PHP:
[22/09/2010 10:44:59] Reloaded npcs.
[22/09/2010 10:44:59] [Error - Npc interface] 
[22/09/2010 10:44:59] data/npc/scripts/seller.lua:onThink
[22/09/2010 10:44:59] Description: 
[22/09/2010 10:44:59] data/npc/scripts/seller.lua:8: attempt to index a nil value
[22/09/2010 10:44:59] stack traceback:
[22/09/2010 10:44:59] 	data/npc/scripts/seller.lua:8: in function <data/npc/scripts/seller.lua:8>

[22/09/2010 10:44:59] [Error - Npc interface] 
[22/09/2010 10:44:59] data/npc/scripts/seller.lua:onThink
[22/09/2010 10:44:59] Description: 
[22/09/2010 10:44:59] Stack size changed!

Seller.lua

PHP:
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

npcHandler:addModule(FocusModule:new())













Oracle Npc

PHP:
[21/09/2010 07:54:13] [Error - CreatureScript Interface] 
[21/09/2010 07:54:13] data/creaturescripts/scripts/oraclecheck.lua
[21/09/2010 07:54:13] Description: 
[21/09/2010 07:54:13] (luaGetCreatureStorage) Creature not found

[21/09/2010 07:54:13] [Error - CreatureScript Interface] 
[21/09/2010 07:54:13] data/creaturescripts/scripts/oraclecheck.lua
[21/09/2010 07:54:13] Description: 
[21/09/2010 07:54:13] data/creaturescripts/scripts/oraclecheck.lua:2: attempt to compare boolean with number
[21/09/2010 07:54:13] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/oraclecheck.lua)


I think its something in this script?

PHP:
 local oracleItems = 9011
	if getPlayerStorageValue(cid,oracleItems) < 1 then
	  itemThinker(cid)
	end
 
function itemThinker(cid)
	local backpack = doCreateItemEx(1988, 1)
	local giveItems = firstItems[getPlayerVocation(cid)]
	if giveItems ~= nil then
		for _, v in ipairs(giveItems) do
			doAddContainerItem(backpack, v.itemid, v.count or 1)
		end
		local addItem = doPlayerAddItemEx(cid, backpack, 0)
		if (addItem == RETURNVALUE_NOERROR and getPlayerStorageValue(cid,9011) < 1) then
			setPlayerStorageValue(cid,9011,1)
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You recieved items from the Oracle.')
			return true
		elseif (addItem == RETURNVALUE_NOTENOUGHCAPACITY and getPlayerStorageValue(cid,9011) < 1) then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'you don\'t have enough capacity for your start items, please make capacity by dropping items.')
			addEvent(itemThinker,10000,cid)
			return true
		end
	end
  return true

Rep++ if you can help me.
 
For the second one, I'm assuming you're trying to check if the player does not have that storage. It's;

Code:
if getPlayerStorageValue(cid,oracleItems) == -1 then
 
Try this for the seller.lua

EDIT: Oh I got the same as yours but, mine is working :/.
 
Last edited:
here:
Lua:
 local oracleItems = 9011
    if getPlayerStorageValue(cid,oracleItems) <= 1 then
      itemThinker(cid)
    end
 
function itemThinker(cid)
    local backpack = doCreateItemEx(1988, 1)
    local giveItems = firstItems[getPlayerVocation(cid)]
    if giveItems ~= nil then
        for _, v in ipairs(giveItems) do
            doAddContainerItem(backpack, v.itemid, v.count or 1)
        end
        local addItem = doPlayerAddItemEx(cid, backpack, 0)
        if (addItem == RETURNVALUE_NOERROR and getPlayerStorageValue(cid,9011) <= 1) then
            setPlayerStorageValue(cid,9011,1)
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You recieved items from the Oracle.')
            return true
        elseif (addItem == RETURNVALUE_NOTENOUGHCAPACITY and getPlayerStorageValue(cid,9011) <= 1) then
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'you don\'t have enough capacity for your start items, please make capacity by dropping items.')
            addEvent(itemThinker,10000,cid)
            return true
        end
    end
  return true  
 end
 
Back
Top