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

Solved Help making NPCS / script

Soul Baker

New Member
Joined
Dec 8, 2015
Messages
16
Reaction score
0
hi im currently at the phase where i need to start making npcs on map. ive imported what npcs were on the free forgotten server thing and none of them are what im looking for.

so im looking for basic npc scripts for cities. //manashop//lootseller/post office/ things like that
 
15 00:08:02] [Error - Npc interface]
[18/12/2015 00:08:02] data/npc/scripts/UltimateRashid.lua
[18/12/2015 00:08:02] Description:
[18/12/2015 00:08:02] data/npc/lib/npcsystem/modules.lua:1093: attempt to index local 'v' (a boolean value)
[18/12/2015 00:08:02] [Warning - NpcScript::NpcScript] Cannot load script: data/npc/scripts/UltimateRashid.lua

doesnt work when i try to use it.

<?xml version="1.0" encoding="UTF-8"?>
<npc name="UltimateRashid" script="data/npc/scripts/UltimateRashid.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="146" head="12" body="101" legs="122" feet="115" addons="2"/>
</npc>


and this is lua >> i removed 90% of sell loot list so its short enough to post

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end

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

shopModule:addBuyableItem({'brass helmet'}, 2460,20, 'brass helmet')
shopModule:addBuyableItem({'chain helmet'}, 2458, 52, 'chain helmet')
shopModule:addBuyableItem({'dark helmet'}, 2490,000, 'dark helmet')
shopModule:addBuyableItem({'helmet of the deep'}, 5461, 5000, 'helmet of the deep')
shopModule:addBuyableItem({'iron helmet'}, 2459, 390, 'iron helmet')
shopModule:addBuyableItem({'leather helmet'}, 2461,2, 'leather helmet')
shopModule:addBuyableItem({'party hat'}, 6578, 600, 'party hat')
shopModule:addBuyableItem({'steel helmet'}, 2457, 580, 'steel helmet')
shopModule:addBuyableItem({'soldier helmet'}, 2481,10, 'soldier helmet')
shopModule:addBuyableItem({'studded helmet'}, 2482, 63, 'studded helmet')
shopModule:addBuyableItem({'viking helmet'}, 2473, 265, 'viking helmet')



npcHandler:addModule(FocusModule:new())
 
ok so no issues loading server on this one. works perfect execpt. i can buy items but when i try to sell items to rashid it doesnt let me. i click on it and click accept and nothing

new script

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Rashid" script="data/npc/scripts/Rashid.lua" walkinterval="2000" floorchange="0">
<health now="150" max="150"/>
<look type="146" head="99" body="102" legs="122" feet="115" addons="2"/>
<parameters>
<parameter key="module_shop" value="1"/>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy and sell helmets, boots, legs, shields, and armors."/>
<parameter key="shop_buyable" value="
dark helmet,2490,1000;
serpent sword,2409,6000;
spike sword,2383,8000;
short sword,2406,30;
sword,2376,85;
ice rapier,2396,5000;
rochhill sword,2395,473;
crimson sword,7385,610;
dagger,2379,5;
jagged sword,8602,500;
longsword,2397,160;
machete,2420,35;
rapier,2384,15;
sabre,2385,25;
two handed sword,2377,950;
axe,2386,20;
barbarian axe,2429,590;
battle axe,2378,235;
hand axe,2380,8;
hatchet,2388,85;
obsidian lance,2425,3000;
sickle,2405,7;
steel axe,8601,500;

leather boots,2643,2;
sandals,2642,2;

studded armor,2484,90;
spirit cloak,8870,1000;
scale armor,2483,260;
ranger's cloak,2660,450;
plate armor,2463,1200;
magician's robe,8819,450;
leather armor,2467,25;
jacket,2650,10;
green tunic,2652,25;
ethno coat,8892,750;
doublet,2485,16;
coat,2651,8;
chain armor,2464,200;
cape,2654,9;
brass armor,2465,450;
belted cape,8872,1300;
noble armor,2486,8000;
dark armor,2489,1500;

ancient shield,2532,5000;
brass shield,2511,65;
dwarven shield,2525,500;
plate shield,2510,125;
steel shield,2509,200;
studded shield,2526,50;
viking shield,2531,260;
wooden shield,2512,13;

studded legs,2468,60;
leather legs,2649,9;
chain legs,2648,80;
brass legs,2487,195
" />
<parameter key="shop_sellable" value="
Zaogun Shoulderplates,11325,1500;
Zaoan Sword,11301,30000;
Zaoan Shoes,11297,5000;
Zaoan Legs,11298,14000;
Zaoan Helmet,11296,45000;
Zaoan Halberd,11317,500;
Zaoan Armor,11295,14000;
Twin Hooks,11303,500;
Spiked Iron Ball,11319,1000;
Sais,11300,16000;
Legionnaire Flags,11328,1000;
wailing widow necklace,11323,3000;
High Guard Shoulderplates,11327,1300;
Guardian Boots,11234,35000;
Drakinata,11299,10000;Drachaku,11302,10000;
Cursed Shoulder Spikes,11321,3200;
Broken Halberd,11329,1000;
Axe ring,2208,100;
Club ring,2209,100;
Power ring,2166,50;
Stealth ring,2165,200;
Sword ring,2207,100;
Bronze amulet,2172,50;
Garlic necklace,2199,50;
elven amulet,2198,100;
Stone skin amulet,2197,500;
Wand of cosmic energy,2189,2000;
Wand of decay,2188,1000;
Wand of dragonbreath,2191,200;
Wand of inferno,2187,3000;
Wand of vortex,2190,100;
Wand of Draconia,8921,1500;
Wand of Starstorm,8920,3600;
Wand of Voodoo,8922,4400;
Magic Light Wand,2162,35;
Life Crystal,4851,50;
Mind Stone,2178,100;
Orb,7493,750;
warrior helmet,2475,5000;
viking helmet,2473,66;
tribal mask,3967,250;
terra hood,7903,2500;
studded helmet,2482,20;
strange helmet,2479,500;
steel helmet,2457,293;
skull helmet,5741,40000;
ragnir helmet,7462,400;
pirate hat,6096,1000;
pair of earmuffs,7459,1500;
magma monocle,7900,2500;
mage hat,8820,150;
lightning headband,7901,2500;
legion helmet,2480,22;
leather helmet,2461,4;
krimhorn helmet,7461,200;
iron helmet,2459,150;
horseman helmet,3969,280;
royal helmet,2498,30000;
crusader helmet,2497,6000;
crown helmet,2491,2500;
devil helmet,2462,1000;
mystic turban,2663,150;
chain helmet,2458,17;
iron helmet,2459,150;
dark helmet,2490,250;
strange helmet,2479,500;
batwing hat,10016,8000;
beholder helmet,3972,3000;
brass helmet,2460,30;
charmer's tiara,3971,900;
feather headdress,3970,850;
glacier mask,7902,2500;
helmet of the deep,5461,5000;

steel boots,2645,30000;
boots of haste,2195,30000;
crocodile boots,3982,1000;
fur boots,7457,2000;
glacier shoes,7892,2500;
leather boots,2643,2;
lightning boots,7893,2500;
magma boots,7891,2500;
patched boots,2641,2000;
pirate boots,5462,3000;
terra boots,7886,2500;

beholder shield,2518,1000;
crown shield,2519,8000;
demon shield,2520,30000;
dragon shield,2516,4000;
dwarven shield,2525,100;
guardian shield,2515,2000;
medusa shield,2536,9000;
phoenix shield,2539,16000;
tower shield,2528,8000;
vampire shield,2534,15000;
ancient shield,2532,900;
battle shield,2513,95;
black shield,2529,800;
bone shield,2541,80;
brass shield,2511,25;
castle shield,2535,5000;
copper shield,2530,50;
dark shield,2521,400;
norse shield,7460,1500;
plate shield,2510,45;
salamander shield,3975,280;
scarab shield,2540,2000;
sentinel shield,3974,120;
steel shield,2509,80;
studded shield,2526,16;
tortoise shield,6131,150;
tusk shield,3973,850;
viking shield,2531,85;
wooden shield,2512,5;
spellbook of enlightenment,8900,4000;
spellbook of warding,8901,8000;
spellbook of mind control,8902,13000;
spellbook of lost souls,8903,19000;
broad sword,2413,500;
earth spike sword,7854,1000;
energy spike sword,7869,1000;
fiery spike sword,7744,1000;
fire sword,2392,4000;
giant sword,2393,17000;
ice rapier,2396,1000;
icy spike sword,7763,1000;
serpent sword,2409,900;
short sword,2406,10;
spike sword,2383,1000;
sword,2376,25;
osbrooken sword,7391,16000;
assassin dagger,7404,20000;
berserker,7403,40000;
blacksteel sword,7406,1000;
rochhill sword,2395,118;
crystal sword,7449,600;
dagger,2379,2;
demonrage sword,7382,36000;
dragon slayer,7402,15000;
earth blacksteel sword,7857,1000;
earth dragon slayer,7858,15000;
earth mystic blade,7856,30000;
earth relic sword,7855,25000;
energy blacksteel sword,7872,1000;
energy dragon slayer,7873,15000;
energy mystic blade,7871,30000;
energy relic sword,7870,25000;
epee,2438,8000;
fiery blacksteel sword,7747,1000;
fiery dragon slayer,7748,15000;
fiery mystic blade,7746,30000;
fiery relic sword,7745,25000;
haunted blade,7407,8000;
heavy machete,2442,90;
icy blacksteel sword,7766,1000;
icy dragon slayer,7767,15000;
icy mystic blade,7765,30000;
icy relic sword,7764,25000;
justice seeker,7390,60000;
katana,2412,35;
knife,2403,1;
longsword,2397,51;
machete,2420,6;
mercenary sword,7386,12000;
mystic blade,7384,30000;
nightmare blade,7418,35000;
poison dagger,2411,50;
rapier,2384,7;
relic sword,7383,25000;
sabre,2385,12;
scimitar,2419,150;
silver dagger,2402,500;
templar scytheblade,3963,200;
two handed sword,2377,450;
wyvern fang,7408,1500;
"/>
</parameters>
</npc>

(Error comes when i try to sell item to npc)

[18/12/2015 01:41:42] [Error - Npc interface]
[18/12/2015 01:41:42] (Unknown script file)
[18/12/2015 01:41:42] Description:
[18/12/2015 01:41:42] data/npc/lib/npcsystem/modules.lua:1234: bad argument #2 to 'error' (number expected, got string)
[18/12/2015 01:41:42] stack traceback:
[18/12/2015 01:41:42] [C]: in function 'error'
[18/12/2015 01:41:42] data/npc/lib/npcsystem/modules.lua:1234: in function 'callbackOnSell'
[18/12/2015 01:41:42] data/npc/lib/npcsystem/npchandler.lua:265: in function 'processModuleCallback'
[18/12/2015 01:41:42] data/npc/lib/npcsystem/npchandler.lua:450: in function 'onSell'
[18/12/2015 01:41:42] data/npc/lib/npcsystem/modules.lua:1296: in function <data/npc/lib/npcsystem/modules.lua:1295>
 
Back
Top