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

error help plz :)

Sexy Vampire

New Member
Joined
Jan 11, 2010
Messages
71
Reaction score
0
i have a smal error i cant seem to fix

Code:
[24/01/2010 15:00:35] [Error - Npc interface] 
[24/01/2010 15:00:35] data/npc/scripts/loot.lua
[24/01/2010 15:00:35] Description: 
[24/01/2010 15:00:35] data/lib/050-function.lua:222: attempt to index a boolean value
[24/01/2010 15:00:35] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/loot.lua

i think its becuse i eddited an npc to sell and buy all items.

mt loot
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

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

npcHandler:addModule(FocusModule:new())

my npc
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Jacob" script="data/npc/scripts/loot.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="154" head="58" body="114" legs="116" feet="76" addons="3"/>
	
<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy and sell. swords, clubs, axes, helmets, boots, legs, shields and armors.You can see my products using the {Trade} channel."/>
		<parameter key="shop_sellable" value="royal helmet,2498,40000;warrior helmet,2475,6000;crusader helmet,2497,9000;crown helmet,2491,5000;devil helmet,2462,4000;mystic turban,2663,500;chain helmet,2458,35;iron helmet,2459,30;steel boots,2645,40000;boots of haste,2195,40000;golden boots,2646,200000;magic plate armor,2472,200000;dragon scale mail,2492,60000;demon armor,2494,90000;golden armor,2466,30000;crown armor,2487,20000;knight armor,2476,5000;blue robe,2656,15000;lady armor,2500,2500;plate armor,2463,400;brass armor,2465,200;chain armor,2464,100;golden legs,2470,80000;crown legs,2488,15000;knight legs,2477,6000;plate legs,2647,500;brass legs,2487,100;mastermind shield,2514,150000;demon shield,2520,40000;blessed shield,2523,150000;great shield,2522,100000;vampire shield,2534,25000;medusa shield,2536,8000;amazon shield,2537,4000;crown shield,2519,5000;tower shield,2528,4000;guardian shield,2515,200;beholder shield,2518,1500;dwarven shield,2525,100;magic longsword,2390,150000;warlord sword,2408,100000;magic sword,2400,120000;giant sword,2393,10000;bright sword,2407,6000;ice rapier,2396,4000;fire sword,2392,3000;serpent sword,2409,1500;spike sword,2383,800;two handed sword,2377,400;broad sword,2413,70;short sword,2406,30;sword,2376,25;dragon lance,2414,10000;stonecutter axe,2431,90000;guardian halberd,2427,7500;fire axe,2432,10000;knight axe,2430,2000;double axe,2387,200;halberd,2381,200;paladin armor,8891,30000;skullcracker armor,8889,60000;battle axe,2378,100;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,1000;dragon hammer,2434,2000;clerical mace,2423,200;battle hammer,2417,60;mace,2398,30;"/>
		<parameter key="shop_buyable" value="dragon hammer,2434,12000;mastermind shield,2514,200000;magic plate armor,2472,260000;golden legs,2470,200000;demon helmet,2493,200000;giant sword,2393,50000;knight axe,2430,10000;poison dagger,2411,100;scimitar,2419,300;serpent sword,2409,1800;skull staff,2436,20000;dragon lance,2414,50000;fire axe,2432,16000;fire sword,2392,16000;war hammer,2391,2400;spike sword,2383,2000;ice rapier,2396,2000;broad sword,2413,1000;obsidian lance,2425,1000;dragon slayer,7402,30000;war axe,2454,18000;amber staff,7426,16000;sapphire hammer,7437,4000;lunar staff,7424,10000;diamond sceptre,7387,6000;dragonbone staff,7430,12000;beastslayer axe,3962,3000;brutetamer's staff,7379,3000;wyvern fang,7408,3000;daramanian waraxe,2440,2000;furry club,27432,2000;crystal sword,7449,1200;taurus mace,7425,1000;silver dagger,2402,1000;mammoth whopper,7381,600;daramanian mace,2439,220;heavy machete,2442,180;crown armor,2487,40000;blue robe,2656,34000;noble armor,2486,1800;dark armor,2489,800;knight armor,2476,20000;dragon scale mail,2492,140000;golden armor,2466,40000;mammoth fur cape,7463,12000;leopard armor,3968,2000;pirate shirt,605,1000;royal helmet,2498,60000;crusader helmet,2497,12000;crown helmet,2491,10000;dark helmet,2490,500;mystic turban,2663,300;strange helmet,2479,1000;warrior helmet,2475,10000;skull helmet,5741,80000;beholder helmet,3972,15000;devil helmet,2462,2000;pirate hat,6096,2000;ragnir helmet,7462,800;crown legs,2488,36000;boots of haste,2195,60000;knight legs,2477,2000;steel boots,2645,20000;pirate boots,5462,4000;fur boots,7457,4000;crocodile boots,3982,2000;pirate knee breeches,5918,400;phoenix shield,2539,32000;crown shield,2519,20000;dragon shield,2516,14000;guardian shield,2515,4000;beholder shield,2518,2400;ancient shield,2532,1800;black shield,2529,1600;tower shield,2528,16000;vampire shield,2534,30000;demon shield,2520,60000;medusa shield,2536,18000;castle shield,2535,10000;scarab shield,2540,4000;dark shield,2521,800;tortoise shield,6131,300;bone shield,2541,160;magic lightwand,2162,60;wand of vortex,2190,200;wand of dragonbreath,2191,400;wand of plague,2188,2000;wand of cosmic energy,2189,4000;wand of inferno,2187,6000;tempest rod,2183,6000;moonlight rod,2186,400;snakebite rod,2182,200;volcanic rod,2185,2000;quarmire rod,2181,4000;war hammer,2391,20000;spike sword,2383,16000;noble armor,2486,16000;beholder shield,2518,14000;ice rapier,2396,10000;serpent sword,2409,12000;dark armor,2489,3000;dark helmet,2490,2000;ancient shield,2532,10000;" />"
</parameters>
</npc>

using

0.3.6.3429
The Forgotten Server
 
Hmmm what's on line 222 in 050-functions.lua (data/lib)?

Try this NPC:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Jacob" script="data/npc/scripts/loot.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="154" head="58" body="114" legs="116" feet="76" addons="3"/>
	
<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy and sell. swords, clubs, axes, helmets, boots, legs, shields and armors.You can see my products using the {Trade} channel."/>
		<parameter key="shop_sellable" value="royal helmet,2498,40000;warrior helmet,2475,6000;crusader helmet,2497,9000;crown helmet,2491,5000;devil helmet,2462,4000;mystic turban,2663,500;chain helmet,2458,35;iron helmet,2459,30;steel boots,2645,40000;boots of haste,2195,40000;golden boots,2646,200000;magic plate armor,2472,200000;dragon scale mail,2492,60000;demon armor,2494,90000;golden armor,2466,30000;crown armor,2487,20000;knight armor,2476,5000;blue robe,2656,15000;lady armor,2500,2500;plate armor,2463,400;brass armor,2465,200;chain armor,2464,100;golden legs,2470,80000;crown legs,2488,15000;knight legs,2477,6000;plate legs,2647,500;brass legs,2487,100;mastermind shield,2514,150000;demon shield,2520,40000;blessed shield,2523,150000;great shield,2522,100000;vampire shield,2534,25000;medusa shield,2536,8000;amazon shield,2537,4000;crown shield,2519,5000;tower shield,2528,4000;guardian shield,2515,200;beholder shield,2518,1500;dwarven shield,2525,100;magic longsword,2390,150000;warlord sword,2408,100000;magic sword,2400,120000;giant sword,2393,10000;bright sword,2407,6000;ice rapier,2396,4000;fire sword,2392,3000;serpent sword,2409,1500;spike sword,2383,800;two handed sword,2377,400;broad sword,2413,70;short sword,2406,30;sword,2376,25;dragon lance,2414,10000;stonecutter axe,2431,90000;guardian halberd,2427,7500;fire axe,2432,10000;knight axe,2430,2000;double axe,2387,200;halberd,2381,200;paladin armor,8891,30000;skullcracker armor,8889,60000;battle axe,2378,100;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,1000;dragon hammer,2434,2000;clerical mace,2423,200;battle hammer,2417,60;mace,2398,30;"/>
		<parameter key="shop_buyable" value="dragon hammer,2434,12000;mastermind shield,2514,200000;magic plate armor,2472,260000;golden legs,2470,200000;demon helmet,2493,200000;giant sword,2393,50000;knight axe,2430,10000;poison dagger,2411,100;scimitar,2419,300;serpent sword,2409,1800;skull staff,2436,20000;dragon lance,2414,50000;fire axe,2432,16000;fire sword,2392,16000;war hammer,2391,2400;spike sword,2383,2000;ice rapier,2396,2000;broad sword,2413,1000;obsidian lance,2425,1000;dragon slayer,7402,30000;war axe,2454,18000;amber staff,7426,16000;sapphire hammer,7437,4000;lunar staff,7424,10000;diamond sceptre,7387,6000;dragonbone staff,7430,12000;beastslayer axe,3962,3000;brutetamer's staff,7379,3000;wyvern fang,7408,3000;daramanian waraxe,2440,2000;furry club,27432,2000;crystal sword,7449,1200;taurus mace,7425,1000;silver dagger,2402,1000;mammoth whopper,7381,600;daramanian mace,2439,220;heavy machete,2442,180;crown armor,2487,40000;blue robe,2656,34000;noble armor,2486,1800;dark armor,2489,800;knight armor,2476,20000;dragon scale mail,2492,140000;golden armor,2466,40000;mammoth fur cape,7463,12000;leopard armor,3968,2000;pirate shirt,605,1000;royal helmet,2498,60000;crusader helmet,2497,12000;crown helmet,2491,10000;dark helmet,2490,500;mystic turban,2663,300;strange helmet,2479,1000;warrior helmet,2475,10000;skull helmet,5741,80000;beholder helmet,3972,15000;devil helmet,2462,2000;pirate hat,6096,2000;ragnir helmet,7462,800;crown legs,2488,36000;boots of haste,2195,60000;knight legs,2477,2000;steel boots,2645,20000;pirate boots,5462,4000;fur boots,7457,4000;crocodile boots,3982,2000;pirate knee breeches,5918,400;phoenix shield,2539,32000;crown shield,2519,20000;dragon shield,2516,14000;guardian shield,2515,4000;beholder shield,2518,2400;ancient shield,2532,1800;black shield,2529,1600;tower shield,2528,16000;vampire shield,2534,30000;demon shield,2520,60000;medusa shield,2536,18000;castle shield,2535,10000;scarab shield,2540,4000;dark shield,2521,800;tortoise shield,6131,300;bone shield,2541,160;magic lightwand,2162,60;wand of vortex,2190,200;wand of dragonbreath,2191,400;wand of plague,2188,2000;wand of cosmic energy,2189,4000;wand of inferno,2187,6000;tempest rod,2183,6000;moonlight rod,2186,400;snakebite rod,2182,200;volcanic rod,2185,2000;quarmire rod,2181,4000;war hammer,2391,20000;spike sword,2383,16000;noble armor,2486,16000;beholder shield,2518,14000;ice rapier,2396,10000;serpent sword,2409,12000;dark armor,2489,3000;dark helmet,2490,2000;ancient shield,2532,10000;"/>
</parameters>
</npc>
 
Last edited:
still get this

Code:
[26/01/2010 09:57:05] [Error - Npc interface] 
[26/01/2010 09:57:05] data/npc/scripts/loot.lua
[26/01/2010 09:57:05] Description: 
[26/01/2010 09:57:05] data/lib/050-function.lua:222: attempt to index a boolean value
[26/01/2010 09:57:05] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/loot.lua
 
I noticed that the error is because you have in the script an itemID that doesn't exist.


EDIT:

Try this npc:
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Jacob" script="loot.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="154" head="58" body="114" legs="116" feet="76" addons="3"/>
	
<parameters>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy and sell. swords, clubs, axes, helmets, boots, legs, shields and armors.You can see my products using the {Trade} channel."/>
	        <parameter key="message_farewell" value="Good bye. Come back soon."/>

		<parameter key="module_shop" value="1"/>
		<parameter key="shop_sellable" value="royal helmet,2498,40000;warrior helmet,2475,6000;crusader helmet,2497,9000;crown helmet,2491,5000;devil helmet,2462,4000;mystic turban,2663,500;chain helmet,2458,35;iron helmet,2459,30;steel boots,2645,40000;boots of haste,2195,40000;golden boots,2646,200000;magic plate armor,2472,200000;dragon scale mail,2492,60000;demon armor,2494,90000;golden armor,2466,30000;crown armor,2487,20000;knight armor,2476,5000;blue robe,2656,15000;lady armor,2500,2500;plate armor,2463,400;brass armor,2465,200;chain armor,2464,100;golden legs,2470,80000;crown legs,2488,15000;knight legs,2477,6000;plate legs,2647,500;brass legs,2487,100;mastermind shield,2514,150000;demon shield,2520,40000;blessed shield,2523,150000;great shield,2522,100000;vampire shield,2534,25000;medusa shield,2536,8000;amazon shield,2537,4000;crown shield,2519,5000;tower shield,2528,4000;guardian shield,2515,200;beholder shield,2518,1500;dwarven shield,2525,100;magic longsword,2390,150000;warlord sword,2408,100000;magic sword,2400,120000;giant sword,2393,10000;bright sword,2407,6000;ice rapier,2396,4000;fire sword,2392,3000;serpent sword,2409,1500;spike sword,2383,800;two handed sword,2377,400;broad sword,2413,70;short sword,2406,30;sword,2376,25;dragon lance,2414,10000;stonecutter axe,2431,90000;guardian halberd,2427,7500;fire axe,2432,10000;knight axe,2430,2000;double axe,2387,200;halberd,2381,200;paladin armor,8891,30000;skullcracker armor,8889,60000;battle axe,2378,100;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,1000;dragon hammer,2434,2000;clerical mace,2423,200;battle hammer,2417,60;mace,2398,30;"/>
		<parameter key="shop_buyable" value="dragon hammer,2434,12000;mastermind shield,2514,200000;magic plate armor,2472,260000;golden legs,2470,200000;demon helmet,2493,200000;giant sword,2393,50000;knight axe,2430,10000;poison dagger,2411,100;scimitar,2419,300;serpent sword,2409,1800;skull staff,2436,20000;dragon lance,2414,50000;fire axe,2432,16000;fire sword,2392,16000;war hammer,2391,2400;spike sword,2383,2000;ice rapier,2396,2000;broad sword,2413,1000;obsidian lance,2425,1000;dragon slayer,7402,30000;war axe,2454,18000;amber staff,7426,16000;sapphire hammer,7437,4000;lunar staff,7424,10000;diamond sceptre,7387,6000;dragonbone staff,7430,12000;beastslayer axe,3962,3000;brutetamer's staff,7379,3000;wyvern fang,7408,3000;daramanian waraxe,2440,2000;furry club,7432,2000;crystal sword,7449,1200;taurus mace,7425,1000;silver dagger,2402,1000;mammoth whopper,7381,600;daramanian mace,2439,220;heavy machete,2442,180;crown armor,2487,40000;blue robe,2656,34000;noble armor,2486,1800;dark armor,2489,800;knight armor,2476,20000;dragon scale mail,2492,140000;golden armor,2466,40000;mammoth fur cape,7463,12000;leopard armor,3968,2000;pirate shirt,6095,1000;royal helmet,2498,60000;crusader helmet,2497,12000;crown helmet,2491,10000;dark helmet,2490,500;mystic turban,2663,300;strange helmet,2479,1000;warrior helmet,2475,10000;skull helmet,5741,80000;beholder helmet,3972,15000;devil helmet,2462,2000;pirate hat,6096,2000;ragnir helmet,7462,800;crown legs,2488,36000;boots of haste,2195,60000;knight legs,2477,2000;steel boots,2645,20000;pirate boots,5462,4000;fur boots,7457,4000;crocodile boots,3982,2000;pirate knee breeches,5918,400;phoenix shield,2539,32000;crown shield,2519,20000;dragon shield,2516,14000;guardian shield,2515,4000;beholder shield,2518,2400;ancient shield,2532,1800;black shield,2529,1600;tower shield,2528,16000;vampire shield,2534,30000;demon shield,2520,60000;medusa shield,2536,18000;castle shield,2535,10000;scarab shield,2540,4000;dark shield,2521,800;tortoise shield,6131,300;bone shield,2541,160;magic lightwand,2162,60;wand of vortex,2190,200;wand of dragonbreath,2191,400;wand of plague,2188,2000;wand of cosmic energy,2189,4000;wand of inferno,2187,6000;tempest rod,2183,6000;moonlight rod,2186,400;snakebite rod,2182,200;volcanic rod,2185,2000;quarmire rod,2181,4000;war hammer,2391,20000;spike sword,2383,16000;noble armor,2486,16000;beholder shield,2518,14000;ice rapier,2396,10000;serpent sword,2409,12000;dark armor,2489,3000;dark helmet,2490,2000;ancient shield,2532,10000;"/>


</parameters>
</npc>

Is the same that yours, but I modified the furry club itemID (you had 27432 instead of 7432) and the pirate shirt (you had 605 instead of 6095).
 
Last edited:
ty fixed him Rep ++

and by any chance can you help me with this
Code:
[26/01/2010 12:11:18] [Warning - Event::loadScript] Event onStepOut not found (data/movements/scripts/snow.lua)
[26/01/2010 12:11:18] [Warning - Event::loadScript] Event onStepOut not found (data/movements/scripts/snow.lua)

your foot prints no show in the snow
 
Yes... Remove the lines of movements.xml file, some line like this:
<movevent type="StepOut" fromid="6580" toid="6593" event="script" value="snow.lua"/>

Remember, delete only the movement type "StepOut" (from movements.xml), cause in items.xml there's already a function that "removes" the footprints.


edit:

In items.xml there's something like this (in this case for 6594 ID):
Code:
	<item id="6594" name="snow">
		<attribute key="description" value="Someone must have walked here recently." />
		<attribute key="decayTo" value="670" />
		<attribute key="duration" value="30" />
	</item>
 
sory im confuzed

Code:
  <!-- Snow footprint tiles -->
	<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
	<movevent type="StepOut" fromid="6580" toid="6593" event="script"
value="snow.lua"/>

Code:
	<item id="6594" name="snow">
		<attribute key="description" value="Someone must have walked here recently."/>
		<attribute key="decayTo" value="670"/>
		<attribute key="duration" value="120"/>
 
Last edited:
No, whole both lines:
<movevent type="StepOut" itemid="670" event="script" value="snow.lua"/>
<movevent type="StepOut" fromid="6580" toid="6593" event="script" value="snow.lua"/>
 
Remove the 2 lines that I said to you from movements.xml, you don't have to do nothing in items.xml xD.
 
Back
Top