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

Weird problem when somebody is buying

Aako

New Member
Joined
May 5, 2011
Messages
32
Reaction score
1
hi guys! i have this problem: when somebody is buying things you buy 1 thing and the NPC give you 2 for the price of 1 WTF?

here is the script:

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

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

shopModule:addBuyableItem({'Orange Backpack'}, 10519, 500, 'Orange Backpack')
shopModule:addBuyableItem({'Orange Bag'}, 10520, 100, 'Orange Bag')
shopModule:addBuyableItem({'brown bag'}, 1987, 20, 'brown bag')
shopModule:addBuyableItem({'brown backpack'}, 1988, 20, 'brown backpack')
shopModule:addBuyableItem({'brocade backpack'}, 9774, 20, 'brocade backpack')
shopModule:addBuyableItem({'green bag'}, 1991, 5, 'green bag')
shopModule:addBuyableItem({'yellow bag'}, 1992, 5, 'yellow bag')
shopModule:addBuyableItem({'red bag'}, 1993, 5, 'red bag')
shopModule:addBuyableItem({'purple bag'}, 1994, 5, 'purple bag')
shopModule:addBuyableItem({'blue bag'}, 1995, 5, 'blue bag')
shopModule:addBuyableItem({'grey bag'}, 1996, 5, 'grey bag')
shopModule:addBuyableItem({'golden bag'}, 1997, 5, 'golden bag')
shopModule:addBuyableItem({'green backpack'}, 1998, 20, 'green backpack')
shopModule:addBuyableItem({'yellow backpack'}, 1999, 20, 'yellow backpack')
shopModule:addBuyableItem({'red backpack'}, 2000, 20, 'red backpack')
shopModule:addBuyableItem({'purple backpack'}, 2001, 20, 'purple backpack')
shopModule:addBuyableItem({'blue backpack'}, 2002, 20, 'blue backpack')
shopModule:addBuyableItem({'grey backpack'}, 2003, 20, 'grey backpack')
shopModule:addBuyableItem({'golden backpack'}, 2004, 20, 'golden backpack')
shopModule:addBuyableItem({'beach backpack'}, 5949, 20, 'beach backpack')
shopModule:addBuyableItem({'beach bag'}, 5950, 20, 'beach bag')
shopModule:addBuyableItem({'camouflage bag'}, 3939, 20, 'camouflage bag')
shopModule:addBuyableItem({'camouflage backpack'}, 3940, 20, 'camouflage backpack')
shopModule:addBuyableItem({'pirate backpack'}, 5926, 20, 'pirate backpack')
shopModule:addBuyableItem({'pirate bag'}, 5927, 5, 'pirate bag')
shopModule:addBuyableItem({'fur backpack'}, 7342, 20, 'fur backpack')
shopModule:addBuyableItem({'fur bag'}, 7343, 20, 'fur bag')

shopModule:addBuyableItem({'rope'}, 2120, 50, 'rope')
shopModule:addBuyableItem({'scythe'}, 2550, 50, 'scythe')
shopModule:addBuyableItem({'pick'}, 2553, 50, 'pick')
shopModule:addBuyableItem({'shovel'}, 2554, 50, 'shovel')

npcHandler:addModule(FocusModule:new())
 
Code:
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
 
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
 
shopModule:addBuyableItem({'orange backpack'}, 10519, 500, 1, 'orange backpack')
shopModule:addBuyableItem({'orange bag'}, 10520, 100, 1, 'orange bag')
shopModule:addBuyableItem({'brown bag'}, 1987, 20, 1, 'brown bag')
shopModule:addBuyableItem({'brown backpack'}, 1988, 20, 1, 'brown backpack')
shopModule:addBuyableItem({'brocade backpack'}, 9774, 20, 1, 'brocade backpack')
shopModule:addBuyableItem({'green bag'}, 1991, 5, 1, 'green bag')
shopModule:addBuyableItem({'yellow bag'}, 1992, 5, 1, 'yellow bag')
shopModule:addBuyableItem({'red bag'}, 1993, 5, 1, 'red bag')
shopModule:addBuyableItem({'purple bag'}, 1994, 5, 1, 'purple bag')
shopModule:addBuyableItem({'blue bag'}, 1995, 5, 1, 'blue bag')
shopModule:addBuyableItem({'grey bag'}, 1996, 5, 1, 'grey bag')
shopModule:addBuyableItem({'golden bag'}, 1997, 5, 1, 'golden bag')
shopModule:addBuyableItem({'green backpack'}, 1998, 20, 1, 'green backpack')
shopModule:addBuyableItem({'yellow backpack'}, 1999, 20, 1, 'yellow backpack')
shopModule:addBuyableItem({'red backpack'}, 2000, 20, 1, 'red backpack')
shopModule:addBuyableItem({'purple backpack'}, 2001, 20, 1, 'purple backpack')
shopModule:addBuyableItem({'blue backpack'}, 2002, 20, 1, 'blue backpack')
shopModule:addBuyableItem({'grey backpack'}, 2003, 20, 1, 'grey backpack')
shopModule:addBuyableItem({'golden backpack'}, 2004, 20, 1, 'golden backpack')
shopModule:addBuyableItem({'beach backpack'}, 5949, 20, 1, 'beach backpack')
shopModule:addBuyableItem({'beach bag'}, 5950, 20, 1, 'beach bag')
shopModule:addBuyableItem({'camouflage bag'}, 3939, 20, 1, 'camouflage bag')
shopModule:addBuyableItem({'camouflage backpack'}, 3940, 20, 1, 'camouflage backpack')
shopModule:addBuyableItem({'pirate backpack'}, 5926, 20, 1, 'pirate backpack')
shopModule:addBuyableItem({'pirate bag'}, 5927, 5, 1, 'pirate bag')
shopModule:addBuyableItem({'fur backpack'}, 7342, 20, 1, 'fur backpack')
shopModule:addBuyableItem({'fur bag'}, 7343, 20, 1, 'fur bag')
 
shopModule:addBuyableItem({'rope'}, 2120, 50, 1, 'rope')
shopModule:addBuyableItem({'scythe'}, 2550, 50, 1, 'scythe')
shopModule:addBuyableItem({'pick'}, 2553, 50, 1, 'pick')
shopModule:addBuyableItem({'shovel'}, 2554, 50, 1, 'shovel')
 
npcHandler:addModule(FocusModule:new())
If this didn't work, try to remove module_shop from the NPC's .xml file
 
Back
Top