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

Custom Npc Request REP!!

hum

New Member
Joined
Jan 7, 2010
Messages
35
Reaction score
0
Guyss!! >.<!! i need your help.. look, i know how to create a npc but this time i dont know what happened, it doesnt sell the item to players and when i want to buy something from it, this appears in my console
PHP:
[13/08/2011 00:54:46] [Error - Npc interface] 
[13/08/2011 00:54:46] (Unknown script file)
[13/08/2011 00:54:46] Description: 
[13/08/2011 00:54:46] data/npc/lib/npcsystem/modules.lua:1151: bad argument #2 to 'error' (number expected, got string)
[13/08/2011 00:54:46] stack traceback:
[13/08/2011 00:54:46] 	[C]: in function 'error'
[13/08/2011 00:54:46] 	data/npc/lib/npcsystem/modules.lua:1151: in function 'callbackOnBuy'
[13/08/2011 00:54:46] 	data/npc/lib/npcsystem/npchandler.lua:263: in function 'processModuleCallback'
[13/08/2011 00:54:46] 	data/npc/lib/npcsystem/npchandler.lua:440: in function 'onBuy'
[13/08/2011 00:54:46] 	data/npc/lib/npcsystem/modules.lua:1292: in function <data/npc/lib/npcsystem/modules.lua:1291>

can you create a npc that sells this items plz??
shopModule:addBuyableItem({'soft boots'}, 6132, 5000, 'soft boots')
shopModule:addBuyableItem({'firewalker boots'}, 9932, 5000, 'firewalker boots')
shopModule:addBuyableItem({'nuub helmet'}, 8900, 5000, 'nuub helmet')
shopModule:addBuyableItem({'nuub armor'}, 2491, 5000, 'nuub armor')
shopModule:addBuyableItem({'nuub legs'}, 2487, 5000, 'nuub legs')
shopModule:addBuyableItem({'nuub shield'}, 2519, 5000, 'nuub shield')
shopModule:addBuyableItem({'nuub sword'}, 2419, 5000, 'nuub sword')
shopModule:addBuyableItem({'nuub axe'}, 2443, 5000, 'nuub axe')
shopModule:addBuyableItem({'nuub club'}, 2439, 5000, 'nuub club')
shopModule:addBuyableItem({'nuub wand'}, 3961, 5000, 'nuub wand')
shopModule:addBuyableItem({'nuub spear'}, 3965, 5000, 'nuub spear')

PD: (i just need the lua one~)
another PD: if you can help me with that npc's error i'd be happy!

yours

Betoox^_^
 
Check this
Code:
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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'soft boots'}, 6132, 5000, 'soft boots')
shopModule:addBuyableItem({'firewalker boots'}, 9932, 5000, 'firewalker boots')
shopModule:addBuyableItem({'nuub helmet'}, 8900, 5000, 'nuub helmet')
shopModule:addBuyableItem({'nuub armor'}, 2491, 5000, 'nuub armor')
shopModule:addBuyableItem({'nuub legs'}, 2487, 5000, 'nuub legs')
shopModule:addBuyableItem({'nuub shield'}, 2519, 5000, 'nuub shield')
shopModule:addBuyableItem({'nuub sword'}, 2419, 5000, 'nuub sword')
shopModule:addBuyableItem({'nuub axe'}, 2443, 5000, 'nuub axe')
shopModule:addBuyableItem({'nuub club'}, 2439, 5000, 'nuub club')
shopModule:addBuyableItem({'nuub wand'}, 3961, 5000, 'nuub wand')
shopModule:addBuyableItem({'nuub spear'}, 3965, 5000, 'nuub spear')


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

	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
u.u
this happens in .exe


[17/08/2011 23:52:18] [Error - Npc interface]
[17/08/2011 23:52:18] (Unknown script file)
[17/08/2011 23:52:18] Description:
[17/08/2011 23:52:18] data/npc/lib/npcsystem/modules.lua:1151: bad argument #2 to 'error' (number expected, got string)
[17/08/2011 23:52:18] stack traceback:
[17/08/2011 23:52:18] [C]: in function 'error'
[17/08/2011 23:52:18] data/npc/lib/npcsystem/modules.lua:1151: in function 'callbackOnBuy'
[17/08/2011 23:52:18] data/npc/lib/npcsystem/npchandler.lua:263: in function 'processModuleCallback'
[17/08/2011 23:52:18] data/npc/lib/npcsystem/npchandler.lua:440: in function 'onBuy'
[17/08/2011 23:52:18] data/npc/lib/npcsystem/modules.lua:1292: in function <data/npc/lib/npcsystem/modules.lua:1291>
 
this one
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

local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)

shopModule:addBuyableItem({'soft boots'}, 6132, 5000, 'soft boots')
shopModule:addBuyableItem({'firewalker boots'}, 9932, 5000, 'firewalker boots')
shopModule:addBuyableItem({'nuub helmet'}, 8900, 5000, 'nuub helmet')
shopModule:addBuyableItem({'nuub armor'}, 2491, 5000, 'nuub armor')
shopModule:addBuyableItem({'nuub legs'}, 2487, 5000, 'nuub legs')
shopModule:addBuyableItem({'nuub shield'}, 2519, 5000, 'nuub shield')
shopModule:addBuyableItem({'nuub sword'}, 2419, 5000, 'nuub sword')
shopModule:addBuyableItem({'nuub axe'}, 2443, 5000, 'nuub axe')
shopModule:addBuyableItem({'nuub club'}, 2439, 5000, 'nuub club')
shopModule:addBuyableItem({'nuub wand'}, 3961, 5000, 'nuub wand')
shopModule:addBuyableItem({'nuub spear'}, 3965, 5000, 'nuub spear')


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

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

return true
end

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