• 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 [Module] Advanced BuyContainer

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?

We can mix, but it must be in good position. I mean when you msg "sd" then script is checking this first line. I don't really know how to say it, my english isn't good, but i know how to fix it.

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

to
PHP:
shopModule:buyContainer({'bp sd'}, 	             2003, 2268, 4000, 5,  	'Backpack of sudden death')
shopModule:addBuyableItem({'sd'}, 	             2268, 200, 5,  	'Sudden death')
I quess you see what is changed there ;) - you just need to change line 1 to line 2. Its good way to do that, you just need to be first was multiple word = "bp sd" and after "sd"

I'll try to add cap checking.
 
I can say ir for you ;p

An example can be spells, when you create the npc you need to put great fireball spell before adding fireball spell into the script, because the server is checking the first one, if you still doesnt understand then, if you have spells, items, etc with similiar combination (haste/great haste, spear/royal spear) then the longer one must be first in the script. ^^
 
Thanks!!!

This worked like a charm!!

THANKS FOR YOUR TIME AT IT.
GOT REP ON MY PART ;)
 
It doesnt seem to work can someone just upload the modules, and the global with it working please!
 
dont work with TFS 0.2.9 :|

debug in console when I say 'sd' or 'uh':

[23/01/2008 21:41:27] Lua Script Error: [Npc interface]
[23/01/2008 21:41:27] data/npc/scripts/runes.lua:eek:nCreatureSay

[23/01/2008 21:41:27] data/npc/lib/npcsystem/modules.lua:700: attempt to index global 'npcHandler' (a nil value)
 
yea i no the global file is buggedi nthe 0.2.9 i got it working =o xD error and trial works! Xd
 
I have idea how to fix... just copy 'lib' from npc folder in TFS 0.2.8 and replace with that 0.2.9. :p it works fine for me
 
I'm getting the error:
Lua Script Error: [Npc interface]
data/npc/scripts/bpmagic.lua:eek:nCreatureSay

data/npc/lib/npcsystem/modules.lua:684: attempt to perform arithmetic on field 'cost' (a nil value)

~Kiwi Dan~
 
I'm getting the error:
Lua Script Error: [Npc interface]
data/npc/scripts/bpmagic.lua:eek:nCreatureSay

data/npc/lib/npcsystem/modules.lua:684: attempt to perform arithmetic on field 'cost' (a nil value)

~Kiwi Dan~


U forgot to add an code in modules
 
Code:
[09/03/2008  20:04:38] Lua Script Error: [Npc interface] 
[09/03/2008  20:04:38] data/npc/scripts/runes.lua

[09/03/2008  20:04:38] data/npc/scripts/runes.lua:26: attempt to call method 'buyContainer' (a nil value)
[09/03/2008  20:04:38] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/runes.lua
[09/03/2008  20:04:38] data/npc/scripts/housekits.lua:1: unexpected symbol near '{'

Dont get it to work :/ using latest tfs
 
I recieve this error when i try to buy a bp sd

Code:
[13/03/2008  18:24:27] data/npc/lib/npcsystem/modules.lua:685: attempt to perform arithmetic on field 'cost' (a nil value)
 
Code:
[09/03/2008  20:04:38] Lua Script Error: [Npc interface] 
[09/03/2008  20:04:38] data/npc/scripts/runes.lua

[09/03/2008  20:04:38] data/npc/scripts/runes.lua:26: attempt to call method 'buyContainer' (a nil value)
[09/03/2008  20:04:38] Warning: [NpcScript::NpcScript] Can not load script. data/npc/scripts/runes.lua
[09/03/2008  20:04:38] data/npc/scripts/housekits.lua:1: unexpected symbol near '{'

Dont get it to work :/ using latest tfs

U forgot to add the codes in global.lua

I recieve this error when i try to buy a bp sd

Code:
[13/03/2008  18:24:27] data/npc/lib/npcsystem/modules.lua:685: attempt to perform arithmetic on field 'cost' (a nil value)
You forgot to define cost
 
[27/03/2008 05:49:21] Lua Script Error: [CreatureScript Interface]
[27/03/2008 05:49:21] data/creaturescripts/scripts/login.lua:eek:nLogin

[27/03/2008 05:49:21] data/creaturescripts/scripts/login.lua:12: LuaSQL: Error executing query. MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CM Throy''' at line 1
 
Back
Top