• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

NPC [Module] Advanced BuyContainer

Can you say me just where i must it put?

I know how to make it, but in modules only or in global too?
 
thanks, this is really helpful, i wish i could make so nice scripts by myself for my server :'(

:p keep trying an learning, 3 weaks ago i was an newbie in this:eek: but now many people see me as the Npc's King;):thumbup:
 
:p keep trying an learning, 3 weaks ago i was an newbie in this:eek: but now many people see me as the Npc's King;):thumbup:


thats true, just one question, is this version of code working in 0.2.6? i made all that you said in 1st post and i am getting this,

Lua Script Error: [Npc interface]
data/npc/scripts/sam.lua

data/npc/scripts/sam.lua:3: attempt to index global 'NpcSystem' (a nil value)
Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/sam.lua
 
thats true, just one question, is this version of code working in 0.2.6? i made all that you said in 1st post and i am getting this,

Lua Script Error: [Npc interface]
data/npc/scripts/sam.lua

data/npc/scripts/sam.lua:3: attempt to index global 'NpcSystem' (a nil value)
Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/sam.lua
i think u forgot the part in global.lua
 
i found the error, in your first post change to this
Code:
[COLOR="Red"]elseif[/COLOR](parameters.eventType == SHOPMODULE_BUY_CONTAINER) then
			local msg = module.npcHandler:getMessage(MESSAGE_BUY)
			msg = module.npcHandler:parseMessage(msg, parseInfo)
			selfSay(msg)

you have only IF


and is ELSEIF
 
I can guess the answer but, what if I write this?

PHP:
shopModule:addBuyableItem({'sd'}, 	             2268, 200, 5,  	'Sudden death')
shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 4000, 5,  	'Backpack of sudden death')

If I say bp sd, I won't get a bp, but just 1 sd. So, am I right if I think we cannot mix words from them?
 
I can guess the answer but, what if I write this?

PHP:
shopModule:addBuyableItem({'sd'}, 	             2268, 200, 5,  	'Sudden death')
shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 4000, 5,  	'Backpack of sudden death')

If I say bp sd, I won't get a bp, but just 1 sd. So, am I right if I think we cannot mix words from them?


sadly we can not fix it =(
 
only reporting

if the player don't have cap .. he get the backpack without some runes and show this error in console
Code:
Lua Script Error: [Npc interface]
data/npc/scripts/runas.lua:onCreatureSay

luaDoAddContainerItem(). Could not add item

nice script ..
 
Haha, i'v just checked and i forgot to add cap check/slot check
 
maybe you can update it ;p

and i give you rep + o/

I'm sorry but i'm not pallning in updating it, maby in the future but for now i'v lost my tibia spirit.
Dont worry i will keep my eye on the lua board for rule breakers
 
Back
Top